View piper.c
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/wait.h> | |
int main(int argc, char *argv[]) { | |
int pfd0[2], pfd1[2]; | |
pid_t ls_pid, wc_pid, wc1_pid; | |
pipe(pfd0); |
View echo.erl
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(echo). | |
-export([listen/1, accept/1]). | |
-define(TCP_OPTIONS, [binary, {active, false}]). | |
listen(Port) -> | |
{ok, Socket} = gen_tcp:listen(Port, ?TCP_OPTIONS), | |
accept(Socket). | |
accept(LSocket) -> | |
{ok, Socket} = gen_tcp:accept(LSocket), |
View Course.py
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
import web, models | |
from util import crs_obj, dept_obj, dumpl, dumps, loads, get_insts | |
from util import cls_obj, schd_obj, get_courses | |
class courses: | |
def GET(self): | |
objs = web.ctx.orm.query(models.Course).all() | |
return dumpl(objs) | |
class CourseDept: |
View gist:612218
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
import Data.Heap as H | |
import Data.Heap (viewHead,insert) | |
import Prelude hiding (id) | |
import Control.Monad.ST (runST) | |
import Data.STRef (newSTRef,readSTRef,modifySTRef) | |
import Data.IntSet (IntSet,singleton,empty,fromList) | |
import Data.List (elem,delete) | |
type Vertex = Int | |
type Weight = Int |
View message_test.rb
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
# imports via http://www.slideshare.net/pauldix/building-web-service-clients-with-activemodel | |
require 'rubygems' | |
require 'active_model' | |
require 'test/unit' | |
require File.expand_path('../../../app/models/message', __FILE__) | |
class MessageTest < ActiveModel::TestCase | |
include ActiveModel::Lint::Tests | |
# Replace this with your real tests. |
View gist:703113
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
can [:create, :update, :destroy], Foo do |foo| | |
habit.user == user | |
end |
View gist:708460
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
$ rspec spec/ | |
No examples were matched. Perhaps {:if=>#<Proc:0x93878c8@/home/blt/.rvm/gems/ruby-1.9.2-p0@mentorapp/gems/rspec-core-2.1.0/lib/rspec/core/configuration.rb:52 (lambda)>, :unless=>#<Proc:0x9384bb4@/home/blt/.rvm/gems/ruby-1.9.2-p0@mentorapp/gems/rspec-core-2.1.0/lib/rspec/core/configuration.rb:53 (lambda)>} is excluding everything? | |
Finished in 0.00003 seconds | |
0 examples, 0 failures |
View paths.rb
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
$ rake cucumber | |
(in /home/blt/Documents/projects/rails3apps/cobbler_shoes) | |
bundle exec /home/blt/.rvm/rubies/ruby-1.9.2-p0/bin/ruby -I "/home/blt/.rvm/gems/ruby-1.9.2-p0@mentorapp/gems/cucumber-0.9.4/lib:lib" "/home/blt/.rvm/gems/ruby-1.9.2-p0@mentorapp/gems/cucumber-0.9.4/bin/cucumber" --profile default | |
Using the default profile... | |
U-------------------- | |
(::) failed steps (::) | |
AbstractController::ActionNotFound (AbstractController::ActionNotFound) | |
<internal:prelude>:10:in `synchronize' |
View mongrel2.conf
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
web_app_proxy = Proxy(addr='127.0.0.1', port=80) | |
chat_demo_dir = Dir(base='examples/chat/static/', | |
index_file='index.html', | |
default_ctype='text/plain') | |
chat_demo = Handler(send_spec='tcp://127.0.0.1:9999', | |
send_ident='54c6755b-9628-40a4-9a2d-cc82a816345e', | |
recv_spec='tcp://127.0.0.1:9998', recv_ident='') |
OlderNewer