Skip to content

Instantly share code, notes, and snippets.

View jrunning's full-sized avatar

Jordan Running jrunning

View GitHub Profile
class GetterSetterTest
constructor: (@_obj = null) ->
# nada
# 'obj' is defined via the prototype, the definition proxied through to
# 'Object.defineProperty'. Remember, the value of '@' is GetterSetterTest
# itself when used in the body of its class definition.
Object.defineProperty @prototype, 'obj'
get: -> @_obj
set: (value)-> @_obj = value * 2
#!/usr/bin/env ruby
module Spreadsheet
module ColumnNotation
Alphabet = Hash[ (?A..?Z).each_with_index.map {|chr,idx| [ idx + 1, chr ] } ]
def self.position_to_column_notation(num)
quotient, remainder = num.divmod(Alphabet.size)
if remainder == 0
require 'set'
require 'benchmark/ips'
def process_old(list)
list.join(" ").split.uniq
end
def process_set(list)
unique = Set.new
list.each {|str| unique.merge(str.split) }
@jrunning
jrunning / functions.sh
Last active July 18, 2018 17:03 — forked from junegunn/functions.sh
Key bindings for git with fzf (https://junegunn.kr/2016/07/fzf-git/)
# GIT heart FZF
# -------------
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --height 50% "$@" --border
}