- node.js
- Installation paths: use one of these techniques to install node and npm without having to sudo.
- Node.js HOWTO: Install Node+NPM as user (not root) under Unix OSes
- Felix's Node.js Guide
- Creating a REST API using Node.js, Express, and MongoDB
- Node Cellar Sample Application with Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB
- JavaScript Event Loop
- Node.js for PHP programmers
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
# | |
# This config file is a combination of ideas from: | |
# http://www.37signals.com/svn/posts/1073-nuts-bolts-haproxy | |
# http://www.igvita.com/2008/05/13/load-balancing-qos-with-haproxy/ | |
# http://wiki.railsmachine.com/HAProxy | |
# http://elwoodicious.com/2008/07/15/nginx-haproxy-thin-fastcgi-php5-load-balanced-rails-with-php-support/ | |
# http://upstream-berlin.com/2008/01/09/using-haproxy-with-multiple-backends-aka-content-switching/ | |
# http://wiki.railsmachine.com/HAProxy | |
# http://gist.github.com/raw/25482/d39fb332edf977602c183194a1cf5e9a0b5264f9 | |
# |
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
// In a state class : | |
//Here we use Box2D. /!\ Don't forget that your _hero must have its touchable property set to true! | |
var draggableHeroArt:DisplayObject = view.getArt(_hero) as DisplayObject; | |
draggableHeroArt.addEventListener(MouseEvent.MOUSE_DOWN, _handleGrab); | |
stage.addEventListener(MouseEvent.MOUSE_UP, _handleRelease); | |
private function _handleGrab(mEvt:MouseEvent):void { |
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
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
/* Author @jpsarda | |
* A drawing class. | |
* | |
* Examples : | |
* |
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
#!/usr/bin/env pypy-c | |
from __future__ import print_function | |
import random | |
import math | |
import sys | |
import signal | |
import os | |
import time |
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 program to demonstrate sharing public keys from CryptoApi to CNG | |
Note: Reversing the process would allow sharing public keys from CNG to | |
CryptoApi. You would need to be careful of padding parameters and | |
versions. | |
License (yes, yes, BSD): | |
Copyright (c) 2013, Marc Durdin |
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 "PrecompiledHeader.h" | |
#include "NetworkLogic.h" | |
#if defined _EG_MARMALADE_PLATFORM | |
# if defined I3D_ARCH_X86 | |
# if(defined _MSC_VER && !defined __clang__ && !defined __gcc__) | |
# define PLAYER_NAME L"Marmalade X86 Windows" | |
# else | |
# define PLAYER_NAME L"Marmalade X86 OS X" | |
# endif |
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
#!/bin/sh | |
for f in *.gif | |
do | |
short=${f:0:4} | |
if ls $short".png" &> /dev/null; then | |
echo "file exists" | |
else | |
montage -tile x1 -geometry +0+0 -background none $short*.gif $short.png | |
convert $short.png -transparent white $short.png |
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
import sys | |
from StringIO import StringIO | |
class SilencedError ( Exception ): | |
pass | |
class Silencer( object ): | |
''' | |
suppress stdout and stderr |
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
var socket = io.connect('http://localhost'); | |
var startTime; | |
setInterval(function() { | |
startTime = Date.now(); | |
socket.emit('ping'); | |
}, 2000); | |
socket.on('pong', function() { | |
latency = Date.now() - startTime; |