Skip to content

Instantly share code, notes, and snippets.

@lucasdavila
lucasdavila / 1_ubuntu_terminal_command
Last active February 21, 2024 16:26
Installing Source Code Pro fonts in ubuntu
# to execute this gist, run the line bellow in terminal
\curl -L https://raw.github.com/gist/3875946/install_source_code_pro.sh | sh
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@yorkxin
yorkxin / KeyBindings.json
Last active November 29, 2018 20:40
My Sublime Text 2 Config
/* Default (OS X).sublime-keymap */
/* Key Bindings - User */
[
{ "keys": ["ctrl+shift+."], "command": "erb", "context":
[
{
"key": "selector",
"operator": "equal",
"operand": "text.html.ruby, text.haml, source.yaml, source.css, source.scss, source.js, source.coffee"
}
@thomasbhatia
thomasbhatia / qos-opendpi.sh
Created July 22, 2012 20:45 — forked from nacx/qos-opendpi.sh
Basic QoS with iproute2 and OpenDPI Netfilter wrapper
#!/bin/bash
# Basic QoS script that uses OpenDPI (http://www.opendpi.org/)
# Netfilter wrapper to identify packets by the protocol.
#
# This script enqueues packets in three queues, each one
# with a different priority:
#
# The first queue has the higher priority and gets the TCP SYN
# packets, ACKs, ICMPs and packets with Minimize-Delay TOS.
anonymous
anonymous / mysql wrapper class
Created July 19, 2012 02:24
MySql Connection pool & Auto reconnection
/*
use ver 2
provide:
connection pool
auto reconnect
Usage:
MySql = require 'lib/mysql' This one
mysql = new MySql(Config)
@nemf
nemf / gist:3109649
Created July 14, 2012 06:09
Minimal Kickstart for CentOS 6.3
install
url --url http://ftp.iij.ad.jp/pub/linux/centos/6.3/os/x86_64/
# if you use proxy
# url --url http://ftp.iij.ad.jp/pub/linux/centos/6.3/os/x86_64/ --proxy http://proxy-ip:8080/
lang en_US.UTF-8
keyboard us
network --bootproto=dhcp
rootpw password
firewall --disabled
authconfig --enableshadow --passalgo=sha512
@chrissharkey
chrissharkey / impartialoutsider.coffee
Created March 11, 2012 20:03
Pizza voting IRC bot in Node.js
#!/usr/bin/env node
CHANNEL = '#bozler'
MINIMUM_HUMAN_REACTION = 2
DIALOGUE =
ACTIONS_IN_REPLY: [
"I vote for pizza",
"Disregard that, I vote for pizza",
"Another vote for pizza!"
@farnoy
farnoy / main.go
Created February 12, 2012 10:38
golang websockets
package main
import (
"websocket"
"http"
"fmt"
"io"
)
func EchoServer(ws *websocket.Conn) {
anonymous
anonymous / bootstrap-notifications.js
Created January 6, 2012 09:43
Javascript for notifications (alerts) for Twitter Bootstrap
/*
I created the following javascript to use bootstrapt's notifications through Javascript.
If you like it you may consider adding it to bootstrapt. Feel free to modify if necessary.
Be sure you define a div #notification-area, where the notifications are going to be displayed by default.
I use it with jQuery 1.7.1 but it should work with older versions. Is also use jquery.hotkeys.js ( https://github.com/jeresig/jquery.hotkeys ) for block messages hotkeys
*/
(function( $ ){
var pub = {
@xeoncross
xeoncross / f.php
Created December 20, 2011 22:30
1kB Forum with added IP logging
<?checkdnsrr(join('.',array_reverse(explode('.',$p=getenv('REMOTE_ADDR')))).".opm.tornevall.org","A")&&die('Bad Bot');mysql_connect(0,'root','');mysql_select_db('d');extract($_REQUEST);$v=(int)@$v;$i=0;$q='mysql_query';$f='mysql_fetch_row';$n='mysql_num_rows';$x='<input type="';$s="SELECT*FROM";$t='CREATE TABLE IF NOT EXISTS t(i INT AUTO_INCREMENT,a INT,b TEXT,KEY(i))';$h='htmlspecialchars';$q($t);$q(strtr($t,'t','p'));$l=' ORDER BY';$o='';$u='INSERT INTO';$c="b)VALUES(";if(@$b){if(!$v)$q("$u t(a,$c INET_ATON('$p'),'$e')");$v=max($v,mysql_insert_id());$q("$u p(a,$c'$v','$b')");}if($v){$t=$q("$s p WHERE a=$v$l i");echo'<a href="f.php">Back</a>';for(;$i<$n($t);++$i){$r=$f($t);echo'<hr/>'.nl2br($h($r[2]));}}else{$t=$q("$s t$l-i");for(;$i<$n($t);++$i){$r=$f($t);echo'<a href="f.php?v='.$r[0].'">'.$h($r[2]).'</a><br/>';}$o='Title:'.$x.'text"name="e"/><br/>';}echo'<hr/>Post:<form method="post">'.$x.'hidden"name="v"value="'."$v\"/>$o<textarea name=\"b\"></textarea>$x";?>submit"name="w"value="Post"/></form>