use std::thread;
use std::sync::{Arc, RwLock};
// Represents a reference to a node.
// This makes the code less repetitive to write and easier to read.
type NodeRef<T> = Arc<RwLock<_Node<T>>>;
// The private representation of a node.
struct _Node<T> {
inner_value: T,
View wormery.rb
#!/usr/bin/env ruby
# Downloads the entire 'Worm' story and builds an ebook out of it in HTML form,
# ready to be processed by Calibre into whatever format you need.
require 'nokogiri'
require 'open-uri'
View gulpfile.sample.js
var gulp = require('gulp'),
sass = require('gulp-sass'),
plumber = require('gulp-plumber');
gulp.task('sass', function() {
includePaths: ['_scss/includes/']
View pi.c
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <math.h>
#include <omp.h>
/* Estimate pi using the Monte Carlo algorithm */
double pi_thread(int n) {
int n1 = 0;
double x, y;
#!/usr/bin/env python
Simple Naive Bayes tweet classifier.
It analyses a number of tweets of a given user and determines if that user is
a spammer.
from __future__ import division
View chrome.css
body#home { background: none; }
div#left { display: none; width: 0px; }
div#main { padding-left: 100px !important; }
View brushie.rb
#!/usr/bin/env ruby
# encoding: UTF-8
require 'nokogiri'
require 'open-uri'
require 'yaml'
def scrape(url)
View image_extractor.rb
#!/usr/bin/env ruby
# TODO: Process thread URL directly without RES help.
require 'nokogiri'
def get_image_urls(filename)
doc = Nokogiri::HTML(
urls = doc.css('a[type="IMAGE"]').map {|el| el['href']}
View IR_Black.itermcolors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<key>Ansi 0 Color</key>
<key>Blue Component</key>
<key>Green Component</key>
View gist:1226262
==> Environment
HEAD: ab66b4b20a8243980d1753750f79758a7eced55c
HOMEBREW_PREFIX: /Users/meqif/homebrew
HOMEBREW_CELLAR: /Users/meqif/homebrew/Cellar
HOMEBREW_REPOSITORY: /Users/meqif/homebrew
HOMEBREW_LIBRARY_PATH: /Users/meqif/homebrew/Library/Homebrew
Hardware: 8-core 64-bit sandybridge
OS X: 10.6.8
Kernel Architecture: x86_64