Skip to content

Instantly share code, notes, and snippets.

@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active November 10, 2024 03:45
A badass list of frontend development resources I collected over time.
@creationix
creationix / output.log
Created May 8, 2013 22:02
Working version of generator async code sample. Using node from https://github.com/andywingo/node/tree/v8-3.19
tim@touchsmart:~/Code$ nvm use v0.11.2-generators
Now using node v0.11.2-generators
tim@touchsmart:~/Code$ node --harmony testgen.js
<Buffer 76 61 72 20 66 73 20 3d 20 72 65 71 75 69 72 65 28 27 66 73 27 29 3b 0a 66 75 6e 63 74 69 6f 6e 20 72 65 61 64 46 69 6c 65 28 70 61 74 68 2c 20 65 6e 63 ...>
Sleeping for 2000ms...
Done
@isaacs
isaacs / .vimrc
Created November 10, 2012 04:08
set list listchars=tab:\ \ ,trail:·
@tj
tj / some.sh
Created October 11, 2012 18:45
change terminal tab name on cd
function tabname {
printf "\e]1;$1\a"
}
if [ x`type -t cd` == "xfunction" ]; then
# previously wrapped cd
eval $(type cd | grep -v 'cd is a function' | sed 's/^cd/original_cd/' | sed 's/^}/;}/' )
else
# builtin
eval "original_cd() { builtin cd \$*; }"
@karolk
karolk / multiple inheritance.md
Created October 5, 2012 09:41
Comparison of a multiple inheritance implementation in ES3 and ES5

I am always baffled by the complicated graphs people draw to explain the ES3 concept for inheritance. I don't think inheritance is the right word for what is in the language. The more appropriate word would be composition. Prototypal composition, because an object called prototype is used to bring in that magic. If you think this means JS doesn't have inheritance, don't forget that the goal is not to be able to inherit. What we are trying to achieve is code reuse, small memory footprint and polymorhism (defined here as an ability to mutate object slightly in relation to their generic prototypes).

ES3 prototypal composition pattern

ES3 in it's attempt to imitate Java (for familiarity purposes) emphasised the role of the class in instances creation. The idea was/is as follows

//1. Functions also serve as classes. There is no separate `class` keyword.

function Animal( sound ) {
anonymous
anonymous / stdin.txt
Created July 2, 2012 08:02
{"level":"info","message":"[37.4.129.251:anonymous] connection established","timestamp":"2012-06-28T15:43:04.228Z"}
{"level":"info","message":"[37.4.129.251:anonymous] data arrived","timestamp":"2012-06-28T15:43:04.347Z"}
{"level":"info","message":"[37.4.129.251:anonymous] USER alice","timestamp":"2012-06-28T15:43:04.348Z"}
{"level":"info","message":"[37.4.129.251:anonymous] accepted","timestamp":"2012-06-28T15:43:04.349Z"}
{"level":"info","message":"[37.4.129.251:anonymous] data arrived","timestamp":"2012-06-28T15:43:04.466Z"}
{"level":"info","message":"[37.4.129.251:anonymous] PASS ******","timestamp":"2012-06-28T15:43:04.466Z"}
{"level":"info","message":"[37.4.129.251:anonymous] accepted","timestamp":"2012-06-28T15:43:04.467Z"}
{"level":"info","message":"[37.4.129.251:anonymous] successful doctape login with user: alice","timestamp":"2012-06-28T15:43:04.919Z"}
{"level":"info","message":"[37.4.129.251:alice] data arrived","timestamp":"2012-06-28T15:43:05.245Z"}
{"level":"info","message":"[37.4.129.251:alice
@jboner
jboner / latency.txt
Last active November 18, 2024 08:23
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@damienklinnert
damienklinnert / gist:2718189
Created May 17, 2012 11:07
wikipedia game bookmarklet
<a href="javascript:(function(){
script = document.createElement( 'script' );
script.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js';
script.onload=releasetheKraken;
document.body.appendChild(script);
function releasetheKraken () {
@bebraw
bebraw / gameengines.md
Created January 6, 2011 18:07
List of JS game engines. You can find a wikified version at https://github.com/bebraw/jswiki/wiki/Game-Engines. Feel free to modify that. I sync it here every once in a while.

IMPORTANT! Remember to check out the wiki page at https://github.com/bebraw/jswiki/wiki/Game-Engines for the most up to date version. There's also a "notes" column in the table but it simply does not fit there... Check out the raw version to see it.

This table contains primarily HTML5 based game engines and frameworks. You might also want to check out the [[Feature Matrix|Game-Engine-Feature-Matrix]], [[Game Resources]] and [[Scene Graphs]].

Name Size (KB) License Type Unit Tests Docs Repository Notes
Akihabara 453 GPL2, MIT Classic Repro no API github Intended for making classic arcade-style games in JS+HTML5
AllBinary Platform Platform Dependent AllBinary 2D/2.5D/3D n