Skip to content

Instantly share code, notes, and snippets.

Creating Black holes.

Pankaj Doharey metacritical

Creating Black holes.
View GitHub Profile
tomdunning / application.rhtml
Created Mar 6, 2010
Growl for rails helper method. Growl flash[:notice] or flash[:error] in rails
View application.rhtml
<% if flash[:notice] %>
<%= growl_a_flash("Thanks", flash[:notice]) %>
<% end %>
<% if flash[:error] %>
<%= growl_a_flash("Error", flash[:error]) %>
<% end %>
bytesource / csv_parser_csv_gem_benchmark.rb
Created Sep 4, 2011
Simple CSV Parser vs. CSV Gem Benchmark
View csv_parser_csv_gem_benchmark.rb
require 'open-uri'
require 'nokogiri'
require 'parslet'
require 'csv'
# --------------------------------------------------
# Auxiliary code
class String
metacritical / gist:1404985
Created Nov 29, 2011 — forked from seanlilmateus/gist:1386468
Macruby Face Detection in Mac OS X Lion
View gist:1404985
framework 'Cocoa'
framework 'QuartzCore'
class NSColor
def toCGColor
colorRGB = self.colorUsingColorSpaceName NSCalibratedRGBColorSpace
components ={}
colorRGB.getRed components[0], green:components[1], blue:components[2], alpha:components[3]

Continued from Results from the January 2012 Core Skills Course, by Gregory Brown

For our integration exercise we had students build multi-user email based applications. All ten students who completed the course worked on this exercise, and we ended up with everything from an email-based wiki to a system for sharing funny stories and jokes.

For our academic exercise, we asked students to make use of Markov Chains to do something interested. Seven of our students participated in this exercise, and we ended up all sorts of cool results, including a jazz chart generator and a tool which predicts movements in currency exchange rates.

For our [modeling e

View string_goals.markdown


  • Creating / Definition
  • Single vs. Double Quoted Strings
  • Combining Strings and Other Data
    • Concatenation with +
    • Wrapping in an Array and using join
  • Interpolating
hajimes / logsumexp-asm.js
Last active Jan 29, 2017
handwritten asm.js code for logsumexp
View logsumexp-asm.js
// MIT License. Copyright (c) 2016 Hajime Senuma.
* asm.js module for logsumexp
function asmModule(stdlib, foreign, heap) {
'use asm';
var exp = stdlib.Math.exp;
var log = stdlib.Math.log;
benolee /
Last active Aug 6, 2017
how easy it is to create and load a C extension in ruby

create a new dir

$ mkdir /tmp/ruby
$ cd /tmp/ruby

create extconf.rb


The following code should evaluate to true:

((or int? string?) 1)

But instead it evaluates to the int? function. In other words this evaluates to true:

(= int? ((or int? string?) 1))
clj -Sdeps '{:deps {github-mfikes/chambered {:git/url "" :sha "50265ab42f149450f15375117dcdf5d83c5efcf3"}}}' -m cljs.main -c chambered.core -r

After the REPL starts, if it doesn't automatically, open your browser to


The source for this project is at