Skip to content

Instantly share code, notes, and snippets.

package main
import (
"bytes"
"io/ioutil"
"strings"
)
func isLetterWorks(entry []byte) bool {
return strings.Contains(strings.ToLower(compact(entry)), "letterworks")
def deb_compare(left, right)
mine = left.scan(/\d+|[^\d]+/)
theirs = right.scan(/\d+|[^\d]+/)
lhs = mine.shift
rhs = theirs.shift
while lhs
if rhs.nil?
if lhs == '~'
#!/bin/bash -v
apt-get update
apt-get install -y python-pip python-dev libffi-dev libssl-dev
pip install s3cmd
pip install markupsafe
mkdir /root/ansible
#!/bin/bash
echo "this should show double up arrow: ⇈"
function ps1_bgl {
source ~/.nightscout/info.sh
local RED="$(tput setaf 1 2>/dev/null || echo '')"
local GREEN="$(tput setaf 2 2>/dev/null || echo '')"
local YELLOW="$(tput setaf 3 2>/dev/null || echo '')"
local NO_COLOR="$(tput sgr0 2>/dev/null || echo '')"
local trend="?"
case ${nightscout_trend} in
#tunables!
VERBOSE = false
MAX_DEBT = 15_000
MIN_DEBT = 500
MAX_APR = 30
DEBT_MONEY = 1500
SIMULATION_ATTEMPTS = 1000
class Debt
require 'nokogiri'
require 'open-uri'
URL = "http://www.wunderground.com/US/TX/173.html" #change this if you're not in cedar park
TIMESTAMP = /^\d\d\/\d\d\/\d\d\d\d/
$seen = {}
def blah
puts "what"
end
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/'
}
function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
local GREEN="\[\033[0;32m\]"
local LIGHT_GREEN="\[\033[1;32m\]"
class DbLog < ActiveRecord::Base
belongs_to :loggable, :polymorphic => true
module Loggable
extend ActiveSupport::Concern
included do
has_many :db_logs, :foreign_key => "loggable_id" if self.respond_to?(:has_many)
end