Skip to content

Instantly share code, notes, and snippets.

View msawangwan's full-sized avatar
😎

misha sawangwan msawangwan

😎
View GitHub Profile
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active May 16, 2024 16:51
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@technoweenie
technoweenie / gist:1072829
Created July 8, 2011 21:12
.netrc file so you can push/pull to https git repos without entering your creds all the time
machine github.com
login technoweenie
password SECRET
machine api.github.com
login technoweenie
password SECRET
@yewton
yewton / gist:2723321
Created May 18, 2012 05:23
LCG, xor shift
#include <iostream>
using namespace std;
class LCG {
unsigned long s;
static const unsigned long M = 1103515245UL;
static const unsigned long A = 12345UL;
static const unsigned long B = 2147483647UL;
public:
@speps
speps / DebugDraw.cs
Created September 11, 2012 19:48
DebugDraw - Unity3D based debug drawing for programmers
// Remi Gillig - http://speps.fr - 2012 - Public domain
using System;
using System.Collections.Generic;
using UnityEngine;
public class DebugDraw
{
static Material material = new Material(
@"Shader ""Custom/DebugDraw"" {
@michaelbartnett
michaelbartnett / .gitattributes
Created November 10, 2012 21:24
Git meta files for a Unity Project
*.meta -diff
*.asset -diff
*.unity -diff
@cespare
cespare / main.go
Created February 20, 2013 03:05
Example of testing Go HTTP servers using httptest.Server.
package main
import (
"log"
"myserver"
"net/http"
)
const addr = "localhost:12345"
@masa795
masa795 / UnityTextures.cs
Created June 17, 2013 14:12
Unityが持っているアイコンを表示する。 Unityのバージョンによってはパスが使えなくなるかもしれないので使用時は注意。
using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
//Unity 4.1.5
public class UnityTextures : EditorWindow
{
@shime
shime / _README.md
Last active April 2, 2024 17:00
getting tired of guessing tar flags in 2013?

Looks familiar?

Worry no more! Use extract and prosper!

Usage