This file contains hidden or 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
#include "LinkedList.h" | |
template <class T> | |
LinkedList<T>::LinkedList() | |
{ | |
first = NULL; | |
last = NULL; | |
} | |
template <class T> |
This file contains hidden or 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
ArgumentsStruct: cover { | |
val1: String | |
val2: Int | |
} | |
Arguments: cover from ArgumentsStruct* { | |
new: static func -> This { | |
gc_malloc(Arguments size) as This | |
} |
This file contains hidden or 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 'socket' | |
s=TCPSocket.new *ARGV[0,2] | |
s.puts "USER A B C D | |
NICK waffles" | |
until s.eof? | |
s.puts case s.gets | |
when /^\S+ 001 / | |
"JOIN "+ARGV[2] | |
when /.+ :-quit( .+)?/ | |
"QUIT :#{$1}" |
This file contains hidden or 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
run proc({|env| [200, {'Content-Type' => 'text/plain'}, env.map{|k, v| "#{k.rjust(20)} = #{v}\n" }.join] }) |
This file contains hidden or 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 EventMachine | |
module Protocols | |
module JsonProtocol | |
def post_init | |
@parser = Yajl::Parser.new | |
@parser.on_parse_complete = method(:receive_object) | |
@encoder = Yajl::Encoder.new | |
end | |
def receive_data(data) |
This file contains hidden or 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/env ruby | |
require 'digest/md5' | |
require 'find' | |
@hashfun = Digest::MD5.new | |
@digests = {} | |
def digest filename | |
@hashfun.hexdigest File.read(filename) |
This file contains hidden or 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
def create | |
@bit = Bit.new(params[:bit]) | |
@bit.IP = request.remote_ip | |
respond_to do |format| | |
if @bit.save | |
flash[:notice] = 'Bit was successfully created.' | |
#cookies[:bitbin] = { :value => @bit.id.to_i, :expires => Time.now + 3600} | |
format.html { redirect_to(@bit) } | |
format.xml { render :xml => @bit, :status => :created, :location => @bit } |