This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See comments below. | |
// This code sample and justification brought to you by | |
// Isaac Z. Schlueter, aka isaacs | |
// standard style | |
var a = "ape", | |
b = "bat", | |
c = "cat", | |
d = "dog", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
struct node{ | |
void* data; | |
struct node* next; | |
}; | |
void set_int_value(struct node* node, int val) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
struct node{ | |
void* data; | |
struct node* next; | |
}; | |
void set_int_value(struct node* node, int val) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
userData = { | |
'person1' : [1,2,3,4], | |
'person2' : [3,4,5,6] | |
} | |
function returns | |
{ | |
'person1': {'person2': [3, 4]}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vim syntax file | |
" Language: HTML (version 5) | |
" Maintainer: Rodrigo Machado <rcmachado@gmail.com> | |
" URL: http://rm.blog.br/vim/syntax/html.vim | |
" Last Change: 2009 Aug 19 | |
" License: Public domain | |
" (but let me know if you liked it :) ) | |
" | |
" Note: This file just adds the new tags from HTML 5 | |
" and don't replace default html.vim syntax file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i = [10,20,30,40,50].index {|n| n > 20 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Code (gf3) | |
function units(n,l) { | |
if (typeof l === "undefined") l=0; | |
return (n > 1024 ? units(n/1024, ++l) : (n).toFixed(2)+['','k','m','g','t','p'][l]+'b/s'); | |
} | |
## Run | |
units(9001) | |
// 8.79kb/s | |
units(900001) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* jQuery whenLoaded - v0.1pre - 06/25/2010 | |
* http://benalman.com/ | |
* | |
* Copyright (c) 2010 "Cowboy" Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://benalman.com/about/license/ | |
*/ | |
// NOTE: TOTALLY UNTESTED! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Regenerate ctags on checkout | |
# project/.git/hooks/post-checkout | |
DIR=$GIT_DIR | |
if [ 0 -eq $3 ]; then | |
# file checkout | |
else | |
# tree checkout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Function#bind(context [, arg1 [, arg2 [, argN]]]) -> Function | |
* - context (Object): Object context to bind to. | |
* - arg1 (?): Optional argument to curry. | |
* | |
* Bind a function to a given `context`. Optionally curry arguments. | |
* | |
* ### Examples | |
* | |
* var new_func = my_func.bind(my_object, "no u"); |