Skip to content

Instantly share code, notes, and snippets.

View idosela's full-sized avatar

Ido Sela idosela

  • Google
  • New York, NY
View GitHub Profile
@craigbeck
craigbeck / introspection-query.graphql
Created April 6, 2016 20:20
Introspection query for GraphQL
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {
@rwaldron
rwaldron / hack.sh
Created March 31, 2012 13:56 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@mrspeaker
mrspeaker / gist:2105288
Created March 19, 2012 09:35
JavaScript merge sort
function merge(a, b, c) {
c = c || [];
if(!a.length && !b.length) return c;
c.push(a[0] < b[0] || isNaN(b[0]) ? a.shift() : b.shift());
return merge(a, b, c);
}
function msort(inp) {
var mid = (inp.length / 2) << 0;
@alobato
alobato / find_replace
Created May 11, 2010 22:46
Find and replace text in multiple files
# Find and replace text in multiple files
# http://www.24hourapps.com/2009/03/linux-tips-17-find-and-replace-text-in.html
# Multiple file find and replace is a rarely used, but an extremely time saving, ability of
# Linux that I cannot live without. It can be achieved by chaining a few commands together
# to get the list of files you want to change (find), make sure the files contain the strings
# you want to replace (grep), and do the replacements (sed).
# Lets say we have a lot of code that uses the function registerUser that was implemented when
# there was only one class of users, but now another class of users need to access the system
@alobato
alobato / rename_multiple_files
Created May 11, 2010 22:43
Rename multiple files
# Rename multiple files
# http://www.24hourapps.com/2009/03/linux-tips-10-rename-multiple-files.html
# Renaming multiple files in Linux is surprisingly difficult given the simplistic power
# provided by many other system commands. Unlike DOS, which provided a rename command that
# allowed wild cards, Linux's rename/mv command is less versatile. Therefore to rename files one needs to write a loop. Luckily bash helps a lot here.
# Lets say we have in our directory a number of .txt files that we need to rename to .nfo.
# To do this we would need to use the command: