This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The language list was generated using the following lines of Python | |
from pygments.lexers import get_all_lexers | |
import json | |
xs = [ (x[0], i) for i, x, _, _ in get_all_lexers() ] | |
xs.sort() | |
f = open('file', 'w') | |
json.dump(xs, f) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Mclarens Bar: Redis based Instant Messaging | |
* Nikhil Marathe - 22/04/2010 | |
* A simple example of an IM client implemented using | |
* Redis PUB/SUB commands so that all the communication | |
* is offloaded to Redis, and the node.js code only | |
* handles command interpretation,presentation and subscribing. | |
* | |
* Requires redis-node-client and a recent version of Redis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
startshape sun | |
rule sun { | |
sq { } | |
36* { r 10 } sq { } | |
} | |
rule sq { | |
CIRCLE { hue 200 saturation 150 } | |
sq { x 1 y 1 s 0.8 brightness 0.3 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple script which runs code when a file is modified | |
# | |
# You will have to install pyinotify | |
# | |
# Run with the directory to watch | |
# eg. python autobuild.py ./ | |
# currently hardcoded to use | |
# | |
# (c) 2009, Nikhil Marathe <[email protected]> | |
# Licensed under the MIT License |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
http.createServer(function (req, res) { | |
var result = req.url.match(/^\/user\/([a-z]+)$/); | |
if( result ) { | |
res.writeHead(200, {'Content-Type': 'text/html'}); | |
res.end('<html><head><title>Greeting App</title></head><body><h1>Hello '+ result[1] + '!</h1></body></html>'); | |
} | |
else { | |
res.writeHead(403); | |
res.end("You aren't allowed here!"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#toplevel in herqq/ | |
project(HUpnp) | |
set(HUpnp_MAJOR_VERSION 0) | |
set(HUpnp_MINOR_VERSION 9) | |
set(HUpnp_PATCH_VERSION 0) | |
find_package(Qt4 COMPONENTS QtCore QtXml QtNetwork REQUIRED) | |
add_subdirectory(hupnp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Overcomplicated shit: | |
mvn archetype:generate \ | |
-DarchetypeGroupId=org.apache.maven.archetypes \ | |
-DgroupId=com.mycompany.app \ | |
-DartifactId=my-app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Made by Nikhil Marathe <[email protected]> | |
// This code is in the public domain. | |
import java.util.Iterator; | |
import java.util.List; | |
import me.prettyprint.hector.api.beans.ColumnSlice; | |
import me.prettyprint.hector.api.beans.HColumn; | |
import me.prettyprint.hector.api.exceptions.HectorException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
segmentLengthBound = ... // B, originally set to s.length/2 | |
counter = {} // o | |
bestSavings = 0 // M | |
maxRepetitions = 0 // N | |
bestSegment = 0 // e | |
longestSegmentLength = 0 // Z | |
segmentLength = 0 // t | |
while (segmentLength <= segmentLengthBound) { | |
start = 1; |
OlderNewer