Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Evan Owen kainosnoema

🏠
Working from home
View GitHub Profile
@kainosnoema
kainosnoema / channel-example.swift
Last active Dec 22, 2019
Golang-like concurrency semantics in Swift
View channel-example.swift
import Foundation
go(println("in a thread"))
// buffered channel
var c = Chan(buffer:20)
// sending routing
go {
while(true) {
View keybase.md

Keybase proof

I hereby claim:

  • I am kainosnoema on github.
  • I am kainosnoema (https://keybase.io/kainosnoema) on keybase.
  • I have a public key whose fingerprint is 172E 7E39 C0A9 FF55 DB79 02AE 9BE3 0DA7 5AF9 DEEE

To claim this, I am signing this object:

@kainosnoema
kainosnoema / rb_template_template.rb
Last active Aug 29, 2015
Jsonite in Rails using Ruby ActionView Template Handler
View rb_template_template.rb
# config/initializers/rb_template_template.rb
class RbTemplateHandler
cattr_accessor :default_format
self.default_format = Mime::JSON
def self.call(template)
%{rendered = begin;#{template.source};end
unless rendered.is_a?(String)
View cached_account.rb
class CachedAccount < CachedDelegateClass(Recurly::Account)
self.cache_key = :account_code
cache_constructor :find
cache(:billing_info)
cache(:subscription) { subscriptions.live.first }
cache(:add_ons) { subscription.try(:add_ons).to_a }
cache(:plan) { subscription.try :plan }
cache(:balance) {
@kainosnoema
kainosnoema / require-performance-fix.patch
Created May 28, 2011
require-performance-fix.patch - fixed for requires with multiple dots
View require-performance-fix.patch
diff --git a/.gitignore b/.gitignore
index 57557c9..7955376 100644
--- a/.gitignore
+++ b/.gitignore
@@ -129,3 +129,4 @@ y.tab.c
# /win32/
/win32/*.ico
+ext/win32ole/.document
diff --git a/array.c b/array.c