Skip to content

Instantly share code, notes, and snippets.

View fnky's full-sized avatar
⚠️
TypeError: Cannot read property 'status' of undefined.

Christian Petersen fnky

⚠️
TypeError: Cannot read property 'status' of undefined.
View GitHub Profile
# These are my notes from the PragProg book on CoffeeScript of things that either
# aren't in the main CS language reference or I didn't pick them up there. I wrote
# them down before I forgot, and put it here for others but mainly as a reference for
# myself.
# assign arguments in constructor to properties of the same name:
class Thingie
constructor: (@name, @url) ->
# is the same as:
@joelambert
joelambert / README
Created June 1, 2011 11:03
Drop in replacements for setTimeout()/setInterval() that makes use of requestAnimationFrame() where possible for better performance
Drop in replace functions for setTimeout() & setInterval() that
make use of requestAnimationFrame() for performance where available
http://www.joelambert.co.uk
Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php
@bradwright
bradwright / websockets-server.js
Created June 11, 2011 23:29
Pure Node.js WebSockets server
/*
* node-ws - pure Javascript WebSockets server
* Copyright Bradley Wright <brad@intranation.com>
*/
// Use strict compilation rules - we're not animals
'use strict';
var net = require('net'),
crypto = require('crypto');
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@uhunkler
uhunkler / SketchLayers.jstalk
Last active September 12, 2016 02:59
SketchLayers - JSTalk Sketch
/**
* SketchLayers - a collection of layer related functions
*
* @type {object}
*/
var SketchLayers =
{
collection : [],
selection : function()
@ogrrd
ogrrd / dnsmasq OS X.md
Last active April 16, 2024 20:28
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@jedi4ever
jedi4ever / nodejs-cluster-zero-downtime.md
Last active February 11, 2024 13:45
nodejs clustering, zero downtime deployment solutions

Clustering: The basics

The trick? pass the file descriptor from a parent process and have the server.listen reuse that descriptor. So multiprocess in their own memory space (but with ENV shared usually)

It does not balance, it leaves it to the kernel.

In the last nodejs > 0.8 there is a cluster module (functional although marked experimental)

@drocco007
drocco007 / _question.rst
Last active January 11, 2016 12:20
Short version: what is the best way to create fixture factories?

I'm working on a user search feature and would like some feedback about the best way to structure the creation of test data using pytest. Below I have defined a test file, test_basic.py, that defines fixture functions to create users and add them to my "database" of users:

@pytest.fixture
def user_alice():
    alice = User('Alice')
    users.append(alice)
    return alice
@FiloSottile
FiloSottile / 32.asm
Last active March 23, 2024 12:28
NASM Hello World for x86 and x86_64 Intel Mac OS X (get yourself an updated nasm with brew)
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32
global start
section .text
start:
push dword msg.len
push dword msg
push dword 1
mov eax, 4
// simpler, faster, version that will throw a TypeError if the path is invalid
// by yorick
function extract(obj, key){
return key.split('.').reduce(function(p, c) {return p[c]}, obj)
}
extract
// for example: