This file contains hidden or 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
// A key to use for localStorage | |
var lsKey = "my very unique key" | |
// Some data to store in it, this could just as easily be from a web service | |
, dataStore = { | |
0: { | |
'name': 'Steven Patrick Morrissey', | |
'role': 'singer' | |
}, | |
1: { |
This file contains hidden or 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> | |
int main(int argc, char **argv) { | |
printf("Hello, World!\n"); | |
return 0; | |
} |
This file contains hidden or 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 map(arr, func) { return arr.length <= 1 ? [func(arr[0])] : [func(arr[0])].concat(map(arr.slice(1), func)) } | |
function reduce(arr, func, start) { return arr.length <= 1 ? func(arr[0], start) : func(arr[0], reduce(arr.slice(1), func, start)); } |
This file contains hidden or 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
# Example 1 | |
print('1\n2\n3\n4\n5\n6\n7\n8\n9\n10') | |
# Example 2 | |
i = 1 | |
while i <= 10: | |
print(i) | |
i = i + 1 | |
# Example 3 |