Skip to content

Instantly share code, notes, and snippets.

#compdef tmuxinator mux
# zsh completion for tmuxinator
# Install:
# $ mkdir -p ~/.tmuxinator/completion
# $ cp _tmuxinator ~/.tmuxinator/completion
# $ vi ~/.zshrc # add the following codes
# fpath=($HOME/.tmuxinator/completion ${fpath})
# autoload -U compinit
#!/bin/sh
# Cisco Anyconnect CSD wrapper for OpenConnect
CSTUB="$HOME/.cisco/hostscan/bin/cstub"
$ARCH=$(uname -m)
if [[ "$ARCH" == "x86_64" ]]
then

Keybase proof

I hereby claim:

  • I am jc00ke on github.
  • I am jc00ke (https://keybase.io/jc00ke) on keybase.
  • I have a public key whose fingerprint is 820A 5BE1 B38C 55E5 1C2C A163 FA06 5807 F03A B48B

To claim this, I am signing this object:

case point
pattern (x, y): ... # 2d point
pattern (x, y, z): ... # 3d point
pattern (x, y, z, w): ... # quaternion
# etc.
sealed abstract class Expression
case class X() extends Expression
case class Const(value : Int) extends Expression
case class Add(left : Expression, right : Expression) extends Expression
case class Mult(left : Expression, right : Expression) extends Expression
case class Neg(expr : Expression) extends Expression
def eval(e : Expression, x : Int) : Int = e match {
case X() => x
case Const(c) => c
beach(Temperature) ->
case Temperature of
{celsius, N} when N >= 20, N =< 45 ->
'favorable';
{kelvin, N} when N >= 293, N =< 318 ->
'scientifically favorable';
{fahrenheit, N} when N >= 68, N =< 113 ->
'favorable in the US';
_ ->
'avoid beach'
@rbxbx
rbxbx / incrudable.rb
Created March 3, 2011 14:35
CRUD with decent_exposure
# pulled out of a project authored by tpope && rbxbx
# not generic enough for general use, but a decent example of
# an application specific restful crud abstraction
module Incrudable
extend ActiveSupport::Concern
included do
expose(controller_name) { controller_name.classify.constantize.scoped }
expose(controller_name.singularize)
@jc00ke
jc00ke / nginx.conf
Created August 23, 2011 21:52 — forked from pogodan/tunnel.thor
thor/pow reverse SSH tunnel
server {
listen [YOUR IP]:80;
server_name *.dev.jc00ke.com;
location / {
if ($host ~* "(.*)\.dev\.jc00ke\.com" ) {
set $tunnel_app $1.lvh.me;
}
proxy_set_header X-Real-IP $remote_addr;
@jc00ke
jc00ke / dnsd.rb
Created December 2, 2011 23:49 — forked from peterc/dnsd.rb
Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# By Peter Cooper
#
# MIT license
#
# * Not advised to use in your production environment! ;-)
# * Requires Ruby 1.9
# * Supports A and CNAME records
# * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance
# * All records get the same TTL
@jc00ke
jc00ke / maglev-peek-inside-proc.txt
Created December 6, 2011 21:04 — forked from timfel/gist:1439913
Want to look at the code a block would run when called?
~ maglev ✔ maglev-irb -f
irb(main):001:0> b = proc { p 1 }
=> #<Proc>
irb(main):002:0> b.instance_variable_get("@_st_block")
=> #<ExecBlock:0x561a6201
irb(main):003:0> block = b.instance_variable_get("@_st_block")
=> #<ExecBlock:0x561a6201
irb(main):004:0> block.class
=> ExecBlock
irb(main):005:0> block.class.primitive '_sourceString', '_sourceString'