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
(defn generate-row [n] | |
(map (fn [_] | |
(rand-int 2)) | |
(range n))) | |
(defn generate-grid [n] | |
(map (fn [_] (generate-row n)) (range n))) | |
(generate-grid 5) |
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
#! /usr/bin/env ruby | |
require 'oj' | |
require 'csv' | |
require 'uri' | |
unless ARGV.size == 2 | |
puts 'USAGE:' | |
puts "\t har2csv.rb har_filename csv_filename" | |
exit 0 | |
end |
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
Show hidden characters
{ | |
"color_scheme": "Packages/Dayle Rees Color Schemes/sublime/freshcut.tmTheme", | |
"draw_white_space": "all", | |
"font_face": "Courier New", | |
"font_size": 14, | |
"ignored_packages": | |
[ | |
"Vintage" | |
], | |
"rulers": |
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
# Path to your oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="ys" | |
# Example aliases |
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
require 'goliath' | |
module Goliath | |
class Request | |
old_post_process = instance_method(:post_process) | |
define_method(:post_process) do |results| | |
status, headers, body = *results | |
# Include any data here | |
# All requests will pass here |
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
require 'goliath' | |
# require 'em-synchrony/activerecord' | |
class Hello < Goliath::API | |
def response env | |
[200, {}, 'Hello World'] | |
end | |
end |
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
#!/usr/bin/env ruby -I ../lib -I lib | |
# coding: utf-8 | |
require 'rtoken' | |
require 'json' | |
require 'sinatra/base' | |
require 'thin' | |
class Chat < Sinatra::Base |
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 <unistd.h> | |
#include <ruby.h> | |
/* Force ruby extension process signals like Ctrl + C */ | |
void process_signal(int signal) { | |
VALUE pid; | |
/* force call any block on trap function */ | |
pid = rb_funcall(rb_mProcess, rb_intern("pid"), 0); |