Skip to content

Instantly share code, notes, and snippets.

View supernullset's full-sized avatar

Sean Williamson supernullset

View GitHub Profile
var repo_prefixes = []string{"git://","git@","http://","https://","ssh://"}
func (r *Repo) isGitImproved() bool {
for _,prefix := range repo_prefixes {
if strings.HasPrefix(r.Path, prefix) { return true }
}
return false
}
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="sugar-1.3.5-full.min.js"></script>
</head>
<body>
<div id="container" style="height: 900px; min-width: 310px; max-width: 1400px; margin: 0 auto"></div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
require "rails"
require "action_controller/railtie"
class Dummy < Rails::Application
config.root = File.dirname(__FILE__)
config.session_store :cookie_store, key: '****************************************'
config.secret_token = '****************************************'
# Log to spec/dummy/test.log
require "benchmark"
class KWBM
attr_reader :foo, :baz
def initialize(foo: "bar", baz: "biz")
@foo = foo
@baz = baz
end
def call
(global-set-key [f2] 'toggle-selective-display-at-depth)
(defun toggle-selective-display-at-depth (column)
(interactive "P")
(set-selective-display
(if selective-display nil (or column 3))))
(global-set-key [f2] 'toggle-selective-display-at-depth)
(defun toggle-selective-display-at-depth (column)
(interactive "P")
(set-selective-display
(if selective-display nil (or column 3))))
(defun assign-group-from-hash (hash keys)
"creates a series of instance variable assignments in the style @key = hash.fetch(:key)"
(interactive "sHash Name: \nsKeys(separated by a space): ")
(let ((hash-keys (split-string keys)))
(mapc (lambda (key) (insert (format "@%s = %s.fetch(:%s)\n" key hash key))) hash-keys)
)
)
@supernullset
supernullset / .zshrc.sh
Created June 7, 2013 21:48
Terminal Quote- A first draft of my own inspirational startup quotes
PHRASES=(
"A leader leads by example not by force. \n- Sun Tzu"
"All warfare is based on deception. \n- Sun Tzu"
"To know your Enemy, you must become your Enemy.\n- Sun Tzu"
"It is said that if you know your enemies and know yourself, you will not be imperilled in a hundred battles; if you do not know your enemies but do know yourself, you will win one and lose one; if you do not know your enemies nor yourself, you will be imperilled in every single battle.\n- Sun Tzu"
"He who knows when he can fight and when he cannot will be victorious.\n- Sun Tzu"
"Subtle and insubstantial, the expert leaves no trace; divinely mysterious, he is inaudible. Thus he is master of his enemy's fate.\n- Sun Tzu"
"The key is to keep company only with people who uplift you, whose presence calls forth your best.\n- Epictetus"
"There is only one way to happiness and that is to cease worrying about things which are beyond the power of our will.\n- Epictetus"
"When you are offended at any man's fault, turn to yourself and study your ow
# Seans Theme
if patched_font_in_use; then
TMUX_POWERLINE_SEPARATOR_LEFT_BOLD="⮂"
TMUX_POWERLINE_SEPARATOR_LEFT_THIN="⮃"
TMUX_POWERLINE_SEPARATOR_RIGHT_BOLD="⮀"
TMUX_POWERLINE_SEPARATOR_RIGHT_THIN="⮁"
else
TMUX_POWERLINE_SEPARATOR_LEFT_BOLD="◀"
TMUX_POWERLINE_SEPARATOR_LEFT_THIN="❮"
@supernullset
supernullset / email-date-grouper.rb
Created April 1, 2013 05:48
mail-grouper one off script
require "tempfile"
require "fileutils"
require "csv"
require "time"
# -*- coding: utf-8 -*-
rents = "/Users/seanjw/Library/Thunderbird/Profiles/gdg1f8hw.default/ImapMail/imap.googlemail.com/Parents"
output = "/Users/seanjw/Dropbox/Programming-Languages/Ruby/rents-email-dates.txt"
odd_output = "/Users/seanjw/Dropbox/Programming-Languages/Ruby/odd-rents-dates.txt"