Skip to content

Instantly share code, notes, and snippets.

View EmmanuelOga's full-sized avatar
🏠
Working from home

Emmanuel Oga EmmanuelOga

🏠
Working from home
View GitHub Profile
#!/bin/sh
# Usage: gemcopy [user@]hostname
ruby << LOCAL_RB | sudo sh
require 'rubygems'
specs = Gem.source_index.search ""
local_spec_tuples = specs.map do |spec|
[spec.name, spec.version.to_s]
end
remote_spec_tuples = `
class Proc
def <<(other)
case other
when Proc
Proc.new do |*args|
call(other.call(*args))
end
else
call(other)
end
#!/custom/ree/bin/ruby
# USAGE:
#
# echo "|/path/to/core_helper.rb %p %s %u %g" > /proc/sys/kernel/core_pattern
#
require 'etc'
require 'net/smtp'
@ckirkendall
ckirkendall / clojure-match.clj
Created June 15, 2012 02:26 — forked from bkyrlach/Expression.fs
Language Compare F#, Ocaml, Scala, Clojure, Ruby and Haskell - Simple AST example
(use '[clojure.core.match :only [match]])
(defn evaluate [env [sym x y]]
(match [sym]
['Number] x
['Add] (+ (evaluate env x) (evaluate env y))
['Multiply] (* (evaluate env x) (evaluate env y))
['Variable] (env x)))
(def environment {"a" 3, "b" 4, "c" 5})
@cocagne
cocagne / read_only_filesystem.py
Created November 16, 2012 16:00
Per-process, read-only filesystem view via Linux's unshare() system call
#!/usr/bin/python
import ctypes
import os
import sys
def err_exit( msg ):
print >> sys.stderr, msg
sys.exit(1)
@ndarville
ndarville / business-models.md
Last active October 23, 2024 17:18
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@mstepniowski
mstepniowski / Tree.hs
Created January 29, 2013 22:03
2-3 tree implemented in Haskell
-- Module implementing a dictionary-like abstract data structure
-- on a 2-3 tree concrete data structure <en.wikipedia.org/wiki/2-3_tree>.
module Tree (Tree,
empty,
singleton,
Tree.lookup,
insert,
fromList,
toList) where
@quchen
quchen / trolling_haskell
Last active November 12, 2024 00:10
Trolling #haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now
@nickloewen
nickloewen / bret_victor-reading_list.md
Last active November 14, 2024 21:10
Bret Victor’s Reading List

This is a plain-text version of Bret Victor’s reading list. It was requested by hf on Hacker News.


Highly recommended things!

This is my five-star list. These are my favorite things in all the world.

A few of these works have had an extraordinary effect on my life or way of thinking. They get a sixth star. ★

@lucabrunox
lucabrunox / autotools.nix
Last active December 19, 2018 02:38
Nix pill 10
pkgs: attrs:
with pkgs;
let defaultAttrs = {
builder = "${bash}/bin/bash";
args = [ ./builder.sh ];
setup = ./setup.sh;
baseInputs = [ gnutar gzip gnumake gcc binutils coreutils gawk gnused gnugrep patchelf findutils ];
buildInputs = [];
system = builtins.currentSystem;
};