This file has been truncated, but you can view the full file.
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
require 'formula' | |
class Php52 <Formula | |
@url='http://www.php.net/get/php-5.2.17.tar.bz2/from/www.php.net/mirror' | |
@version='5.2.17' | |
@homepage='http://php.net/' | |
@md5='b27947f3045220faf16e4d9158cbfe13' | |
depends_on 'jpeg' | |
depends_on 'freetype' |
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 _ = require('underscore'); | |
function serialize(arr, object) { | |
if (_(arr).contains(object)) | |
{ | |
throw "cycle detected"; | |
} | |
var szfn = _(serialize).bind(null, arr); | |
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'); | |
var client = http.createClient(1337, 'localhost'); // to access this url i need to put basic auth. | |
for (var j=0; j<=100000; j++) { | |
var request = client.request('GET', '/', | |
{'host': 'www.example.com'}); | |
request.end(); | |
} |
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
{-# LANGUAGE BangPatterns #-} | |
module Main where | |
import System.IO | |
import System.Environment (getArgs) | |
import Control.Arrow (first) | |
main = do | |
handle <- openFile "IntegerArray.txt" ReadMode | |
numbers <- fmap (map read . lines) $ hGetContents handle | |
print (countInversions numbers) |
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
module Main where | |
import System.IO | |
import System.Environment (getArgs) | |
main = do | |
handle <- openFile "IntegerArray.txt" ReadMode | |
numbers <- fmap (map read . lines) $ hGetContents handle | |
print (countInversions numbers) | |
hClose handle | |
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'); | |
zlib = require('zlib') | |
var request = http.get({ host: 'www.desilva.biz', | |
path: '/php/zlib.html', | |
port: 80, | |
headers: { 'accept-encoding': 'gzip,deflate' } }); | |
request.on('response', function(resp){ | |
var headers = resp.headers['content-encoding'] |
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
> require('compress') | |
Error: Cannot find module 'compress' | |
at Function._resolveFilename (module.js:334:11) | |
at Function._load (module.js:279:25) | |
at Module.require (module.js:357:17) | |
at require (module.js:368:17) | |
at repl:1:2 | |
at REPLServer.eval (repl.js:80:21) | |
at Interface.<anonymous> (repl.js:182:12) | |
at Interface.emit (events.js:67:17) |
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
request: function(options, cb) { | |
var cache; | |
if (options.cache) cache = './data/cache/' + options.cache; | |
var http_req = function() { | |
req(options, function(error, response, body){ | |
if (!error && options.cache) { | |
if (response.headers['content-encoding'].search('gzip') != -1) { | |
// UHOH | |
} |
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
#! /usr/bin/ruby | |
require 'rubygems' | |
require 'syslog_logger' | |
require 'net/http' | |
require 'logger' | |
COOKIE_FILE = File.expand_path('../cookies.yml', __FILE__) | |
def log | |
@log ||= SyslogLogger.new('keep_logged_in') |
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 sys = require('sys'); | |
var irc = require('irc'); | |
var channel = "#animestan"; | |
var incoming = 'message' + channel; | |
function make_client(server) { | |
var client = new irc.Client(server, 'ze_bot', { | |
channels: [channel], | |
}); | |
client.addListener('error', function(message) { |