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 beep () { | |
var b = 2; | |
var c = 10; | |
var foo = 'foo'; | |
var biz = foo; | |
var str = foo +' '+ biz; | |
var sum = b + c; | |
return [str, sum]; | |
} |
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
$ cc s-struct-initalization.c && ./a.out | |
foo 1 bar | |
biz 2 baz | |
beep 3 boop |
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
jwerle:~/repos/libhttp ☂ (modifications) master | |
× clib install hash | |
fetch : https://raw.github.com/clibs/hash/master/package.json | |
fetch : https://raw.github.com/clibs/hash/master/hash.c | |
save : ./deps/hash/hash.c | |
fetch : https://raw.github.com/clibs/hash/master/hash.h | |
error : unable to fetch https://raw.github.com/clibs/hash/master/hash.h | |
clib-install(72753,0x7fff7d37f310) malloc: *** error for object 0x7fa619501b20: pointer being freed was not allocated | |
*** set a breakpoint in malloc_error_break to debug |
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
<? $a = array(); ?> | |
// should yield `null' | |
"unset element in array" = <?= json_encode($a['foo']); ?> | |
// should yield nothing | |
"false" = <?= false; ?> | |
// should yield `1' | |
"true" = <?= true; ?> |
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 b (fn) { | |
var str = fn.toString(); | |
var buf = ""; | |
var ch = 0; | |
var len = str.length; | |
var i = 0; | |
var inBody = false; | |
while (len--) { | |
ch = str[i++]; |
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 s (fn, args) { | |
var code = null; | |
var f = null; | |
args = args.map(function (a) { | |
return 'function' == typeof a ? a.toString() : a; | |
}); | |
args = JSON.stringify(args); | |
code = '(' + fn.toString() +').apply(null,'+ args + ')'; | |
f = new Function(code); |
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
#define X(n) \ | |
if (isset($opts[ # n ])) { \ | |
self::$ n = $opts[ # n]; \ | |
} |
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
import foo from A; // - this just declares the identifier `foo' | |
console.log(foo); // undefined - (but doesn't throw ?) | |
console.log(A.foo); // [Function: foo] - (maybe this is available due to the `import' statement) | |
console.log(B.bar); // [Function: bar] - (I guess not, there is no need for an `import' statement for the `B' module?) | |
/** | |
* The following will throw: | |
* |
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
curl -s https://ws.spotify.com/search/1/track.json?q=portugal+the+man | bpkg json -b | grep tracks | grep href | grep spotify:track | awk '{print $2}' | tr -d '"' | tr -d 'spotify:track:' |
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
files.items | |
.filter(function (file) { | |
// search parents array looking for atleast once | |
// parent that has the id you are looking for | |
return file.parents.some(function (parent) { | |
return PARENT_ID_YOU_CARE_ABOUT == parent.id | |
}); | |
}) | |
.forEach(function (file) { | |
// do stuff with each file after filtering here... |
OlderNewer