Skip to content

Instantly share code, notes, and snippets.

View DAddYE's full-sized avatar

Davide D'Agostino DAddYE

  • Uber
  • San Francisco
View GitHub Profile
@myobie
myobie / mountain-lion-brew-setup.markdown
Created February 18, 2012 20:14
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from the App Store.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@lomereiter
lomereiter / Makefile
Created April 8, 2012 14:55
howto: d & ruby ffi
test: test_c.o test_d.o
cc -shared -m32 test_c.o test_d.o -o test.so -lphobos2
test_c.o: test.c
gcc -c -m32 test.c -o test_c.o
test_d.o: test.d
dmd -c -m32 test.d -oftest_d.o
@matz
matz / gist:3066997
Created July 7, 2012 16:00
code to migrate between 2 mrb_state
#include "mruby.h"
#include "mruby/string.h"
#include "mruby/array.h"
mrb_value
migrate_simple_value(mrb_state *mrb, mrb_value v, mrb_state *mrb2)
{
mrb_value nv; /* new value */
const char *s;
int len;
@dive
dive / gist:3070807
Created July 8, 2012 12:48
Terminal.app tips and tricks
# navigation
# ctrl + A - moves to the start of the line
# ctrl + E - moves to the end of the line
# ctrl + B - move back on character
# ctrl + F - move forward one character
# esc + B - move back one word
# esc + F - move forward one word
# alt + <-/->
# ctrl + U - delete from the cursor to the beginning of the line
# ctrl + K - delete from the cursor to the end of the line
@mikehaertl
mikehaertl / gist:3258427
Created August 4, 2012 15:40
Learn you a Haskell - In a nutshell

Learn you a Haskell - In a nutshell

This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.


1. Introduction

  • Haskell is a functional programming language.
@naan
naan / source_maps.rb
Last active December 14, 2015 13:48 — forked from alexspeller/source_maps.rb
Monkey patch for Coffee Script v.1.6.2 Source Maps for Rails.
# config/initializers/source_maps.rb
if Rails.env.development?
module CoffeeScript
class SourceMapError < StandardError; end;
class << self
def compile script, options
script = script.read if script.respond_to?(:read)
require 'fiddle'
class GVL
handle = Fiddle::Handle::DEFAULT
address = handle['rb_thread_blocking_region']
func = Fiddle::Function.new address, [Fiddle::TYPE_VOIDP,
Fiddle::TYPE_VOIDP,
Fiddle::TYPE_VOIDP,
Fiddle::TYPE_VOIDP], Fiddle::TYPE_VOIDP
###
# Execute tests in parallel using multiple processes. Uses DRb to communicate
# between processes over a unix socket.
gem 'minitest', '~> 5.1.0'
require 'minitest'
require 'minitest/spec'
require 'minitest/mock'
require 'drb'
require 'drb/unix'
@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell
@richardhundt
richardhundt / swarm-http-router.shn
Last active August 29, 2015 13:58
Swarm framework HTTPRouter using patterns
class HTTPRouter
self()
self.routes = { }
end
add(verb is String, path is String, func is Function)
self.routes[#self.routes + 1] = Route(verb, path, func)
end
match(verb, path)
for i=1, #self.routes do
m, q = self.routes[i].match(verb, path)