Skip to content

Instantly share code, notes, and snippets.

View bulkan's full-sized avatar
🇯🇵

Savun Bulkan Evcimen bulkan

🇯🇵
View GitHub Profile
@indexzero
indexzero / mockreadwritestream.js
Created May 20, 2011 06:26
A mock stream for node.js that is both Readable and Writeable.
var events = require('events'),
util = require('util');
var MockReadWriteStream = helpers.MockReadWriteStream = function () {
//
// No need to do anything here, it's just a mock.
//
};
util.inherits(MockReadWriteStream, events.EventEmitter);
@Marak
Marak / mockreadwritestream.js
Created May 20, 2011 06:29 — forked from indexzero/mockreadwritestream.js
A mock stream for node.js that is both Readable and Writeable.
var events = require('events'),
util = require('util');
var MockReadWriteStream = helpers.MockReadWriteStream = function () {
//
// No need to do anything here, it's just a mock.
//
};
util.inherits(MockReadWriteStream, events.EventEmitter);
@fathat
fathat / triangle.py
Created May 27, 2011 23:12
Infinitely prints fractal triangles using only one root expression and no statements.
(lambda:
not globals().__setitem__('sys', __import__('sys'))
and not globals().__setitem__('this', sys.modules[globals()['__name__']])
and not globals().__setitem__('time', __import__('time'))
and
#program
[setattr(this, k, v) for k,v in {
'set_color': (lambda c: w(['*', ' '][c])),
'abs': (lambda t: (t + (t >> 31)) ^ (t >> 31)),
'w': sys.stdout.write,
@torgeir
torgeir / install_redis_on_ubuntu.md
Last active June 7, 2018 17:44 — forked from lucasmazza/script.md
Redis 2.4.8 Install on Ubuntu 10.04

Installation commands:

$ wget http://redis.googlecode.com/files/redis-2.4.8.tar.gz
$ tar xvfz redis-2.4.8.tar.gz 
$ cd redis-2.4.8/
$ mkdir -p /opt/redis
$ make PREFIX=/opt/redis install
$ cp redis.conf /opt/redis/redis.conf
$ chown -R redis:redis /opt/redis
@hrldcpr
hrldcpr / tree.md
Last active June 8, 2024 18:11
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@jessedearing
jessedearing / gist:2351836
Created April 10, 2012 14:44 — forked from twoism-dev/gist:1183437
Create self-signed SSL certificate for Nginx
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key
@mbains
mbains / gist:3219002
Created July 31, 2012 18:05
Python strings should stay immutable.
#!/usr/bin/env python
from ctypes import CDLL
foo = "Fiesta"
bar = "Fiesta"
#Change foo with low level C
libc = CDLL('libc.so.6')
libc.strcpy(foo, "Nachos")
import time
import win32api, win32con
VK_CODE = {'left_arrow':0x25,
'spacebar':0x20,
'right_arrow':0x27}
def press(x):
win32api.keybd_event(VK_CODE[x], 0,0,0)
win32api.keybd_event(VK_CODE[x],0 ,win32con.KEYEVENTF_KEYUP ,0)
@afeld
afeld / gist:5704079
Last active November 27, 2023 15:43
Using Rails+Bower on Heroku
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active July 7, 2024 19:32
A badass list of frontend development resources I collected over time.