Skip to content

Instantly share code, notes, and snippets.

View utkarshkukreti's full-sized avatar

Utkarsh Kukreti utkarshkukreti

View GitHub Profile
Alien = class()
-- Free game by juaxix
-- http://www.xixgames.com
-- Copyright LGPL - 11/2011
function Alien:init(avoidy)
self.position = vec2(0,math.max(math.abs(math.random(HEIGHT)-avoidy)),66)
self.angle = math.pi
self.points= 500
end
digraph widening {
node [style=filled, colorscheme=pastel13, color=2] "i8"; "i16"; "i32"; "i64";
node [style=filled, colorscheme=pastel13, color=3] "u8"; "u16"; "u32"; "u64";
"i8" -> "i16"
"i8" -> "i32"
"i8" -> "i64"
"i16" -> "i32"
"i16" -> "i64"
"i32" -> "i64"
# DESCRIPTION: Cap task to setup the current (initialized) git directory as a remote repository.
#
# INSTALL: Copy to home directory as ~/.caprc
# RUN: cap git:setup scm=t
#
# AUTHOR: Geoffrey Grosenbach http://peepcode.com
#
# Assumes ability to run commands as sudo and the presence of a "git" user and group on remote server.
# The Capistrano :user is used only to connect and setup directories.
// Drives the Bieber-graph at http://awesometown.no.de.
// Run through a recent-ish version of node.js.
var sys = require('sys'),
http = require('http'),
twitter = http.createClient(80, 'search.twitter.com'),
twitterPath = "/search.json?&q=bieber",
chartId = "4c7a650eba12e9c41d000005",
interval = 5000,
lastId = null;
/*
Less CSS3 utils.
Usage:
.fooClass {
border: 3px solid #000;
.vbg-gradient(#FFF, #CCC);
.hbox();
}
*/
require "benchmark"
N = (ARGV.shift || 40).to_i
def fib(n)
return n if n < 2
fib(n-2) + fib(n-1)
end
Benchmark.bmbm do |x|
@fnichol
fnichol / database.yml
Created March 24, 2011 02:12
An example using ActiveRecord to connect to a WordPress database
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: rails_proj_development
pool: 5
username: rp_dev
password: wootwoot
host: localhost
$ wget "http://createyourproglang.com/download.php?cbreceipt=WPXCNE6F&time=1302748966&item=1&cbpop=D8F9D688"
--2011-04-13 23:11:24-- http://createyourproglang.com/download.php?cbreceipt=WPXCNE6F&time=1302748966&item=1&cbpop=D8F9D688
Resolving createyourproglang.com... 173.236.190.249
Connecting to createyourproglang.com|173.236.190.249|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 41189241 (39M) [application/zip]
Saving to: `download.php?cbreceipt=WPXCNE6F&time=1302748966&item=1&cbpop=D8F9D688'
51% [=======================================> ] 21,100,649 65.8K/s in 5m 30s
@beoran
beoran / c_parser.rb
Created May 12, 2011 12:11 — forked from postmodern/c_parser.rb
An ANSI C Parser using the Ruby Parslet library.
#
# A C Parser using the Parslet library.
#
# ANSI C Grammar:
#
# * http://www.lysator.liu.se/c/ANSI-C-grammar-l.html
# * http://www.lysator.liu.se/c/ANSI-C-grammar-y.html
#
require 'parslet'
<?php
function doubleclick_adplanner() {
$data = file_get_contents('http://www.google.com/adplanner/static/top1000/');
preg_match_all('/href=["\']([^"\']+)?["\']target=["\']_blank/im',$data,$matches);
return implode("\n",$matches[1]);
}
function alexa_global($num = 500) {
static $topsites;