Skip to content

Instantly share code, notes, and snippets.

View cararemixed's full-sized avatar
🏳️‍🌈

Cara Mitchell cararemixed

🏳️‍🌈
View GitHub Profile
@cararemixed
cararemixed / config
Created March 24, 2014 20:38
erln8.d/config
[Erln8]
color=true
banner=false
default_config=default
system_default=R17RC2-dirty
[Repos]
default=https://github.com/erlang/otp.git
[Erlangs]
@cararemixed
cararemixed / inject.txt
Created May 12, 2014 02:13
old articles I've written on Io
Everyone who has used Ruby for a little while will quickly become familiar with its custom control structures. They are easy to use and very quick to build. Here is an example implementation of Enumerable#inject:
def inject(initial)
memo = initial # note that this line is only here for clarity. It could be shorter.
each {|x| memo = yield(memo,x)}
memo
end
Now that was easy! It is easy to use and works cleanly:
[Erln8]
color=true
banner=false
default_config=default
system_default=OTP-17.0-dirty
[Repos]
default=https://github.com/erlang/otp.git
[Erlangs]
@cararemixed
cararemixed / merge
Last active August 29, 2015 14:11 — forked from anonymous/merge
#!/usr/bin/env escript
-mode(compile).
-export([main/1]).
main(_) ->
Mode = subtree_mode(),
Repos = read_repos(),
ok = filelib:ensure_dir(apps_path()),
{
"@context": {
"foo": {
"@id": "http://example.com/foo",
"@container": "@set"
}
},
"foo": [
{
"@context": {"foo": "http://example.com/other"},
@cararemixed
cararemixed / monochromatic.tmTheme
Created May 6, 2015 15:52
Monochromatic Theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Brian Mitchell</string>
<key>name</key>
<string>Monochromatic</string>
<key>settings</key>
<array>
@cararemixed
cararemixed / user.json
Created May 26, 2015 15:47
sublime config
{
"auto_complete": false,
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/User/SublimeLinter/monochromatic (SL).tmTheme",
"draw_centered": false,
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
"*.pyc",
-module(bench).
-compile(export_all).
init(_) ->
{ok, null}.
handle_call(ping, _, St) ->
{reply, pong, St}.
start() ->
zero:Scratch brian$ ruby --version # Should be similar on all versions of MRI
ruby 1.9.3dev (2010-06-30 trunk 28489) [x86_64-darwin10.4.0]
zero:Scratch brian$ ruby secure_cmp.rb
Rehearsal ------------------------------------------
binary 4.020000 0.000000 4.020000 ( 4.012945)
hash 2.180000 0.000000 2.180000 ( 2.187391)
--------------------------------- total: 6.200000sec
user system total real
binary 4.010000 0.010000 4.020000 ( 4.003827)
var vows = require('vows');
vows.describe('Deep Thought', {
topic: function () {
this.thought = new DeepThought; // prototypical scopes
},
'thought is logical': [
'define axioms' : {
topic: function () {...},
'assert something': function () {...}