Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am diwakergupta on github.
  • I am diwaker (https://keybase.io/diwaker) on keybase.
  • I have a public key whose fingerprint is C970 E785 A79A 46A2 A5B3 4753 401F EE74 A63B B63A

To claim this, I am signing this object:

#!/usr/bin/env python
# copy-ratings.py
# @Author: Diwaker Gupta (diwaker@floatingsun.net)
# @Last Change: 2008-05-28
import os
import sys
import optparse
from pysqlite2 import dbapi2 as sqlite
#!/usr/bin/env python
# copy-ratings-to-mysqle.py
# @Author: Diwaker Gupta (diwaker@floatingsun.net)
# @Last Change: 2009-01-04
import os
import sys
import optparse
import re
import re
import string
import sys
patterns = []
def load_patterns():
f = open('patterns.txt')
for line in f:
i, o = line.split()
import std.stdio;
import std.string;
import std.conv;
class AllocationItem {
int value;
this(int v) {value = v;}
};
void RunAllocations(int iters) {
class AllocationItem {
int value;
public AllocationItem(int value) {
this.value = value;
}
}
public class Benchmark {
public static void main(String[] args) {
#include <iostream>
#include <cstdlib>
#include <cstring>
using namespace std;
struct AllocationItem {
int value;
AllocationItem(int v) : value(v) {}
@diwakergupta
diwakergupta / functions.php
Created July 8, 2010 01:55
add webfonts to thematic
<?php
function my_head_scripts($content) {
$content .= '<script type="text/javascript"' .
'src="http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js">' .
'</script>' .
'<script type="text/javascript">' .
'WebFont.load({' .
' google: { families: ["Cardo", "Crimson Text", "Vollkorn"] }' .
'});' .
'</script>';
var sys = require("sys");
var http = require("http");
http.createServer(function (req, res) {
res.writeHead(200, {"Content-Type": "text/plain"});
res.end("Hello, World\n");
}).listen(8124, "127.0.0.1");
sys.puts("Server running at http://localhost:8124");
var sys = require('sys');
var http = require('http');
var url = require('url');
var path = require('path');
function search() {
stdin = process.openStdin();
stdin.setEncoding('utf8');
stdin.on('data', function(term) {
term = term.substring(0, term.length - 1);