Skip to content

Instantly share code, notes, and snippets.


Matt Weppler mweppler

View GitHub Profile
mweppler / hex_color_changer.rb
Created Aug 21, 2015
Darken/Lighten a hex color value (CSS)
View hex_color_changer.rb
#!/usr/bin/env ruby
class HexColorChanger
def self.valid_hex?(hex)
def self.valid_lum?(lum)
View wedding-photography-rates-2015.html
<title>Wedding Photography Rates 2015</title>
body, h1, h2, h3, h4, h5, h6, hr, p, ul { margin: 0; padding: 0; }
header { text-align: center; margin: 0 0; }
.logo { width: 200px; }
h1, h2, h3, h4, h5, h6 { text-align: center; text-transform: uppercase; }
h2 { margin: 35px 0; }
View info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
mweppler / string_to_base64.rb
Created Apr 29, 2014
Base 64 encode a string at the command line via ruby.
View string_to_base64.rb
#!/usr/bin/env ruby
if ARGV[0].nil?
raise "Expecting a string as the first argument"
require 'base64'
based = Base64.encode64 ARGV[0]
if !ARGV[1].nil? && ARGV[1] == 'sep'
View titlize.rb
def titlize(the_title)
system("echo '#{the_title.downcase.gsub!(' ', '-')}' | pbcopy")
mweppler / link_helper.rb
Created Sep 5, 2013
wip - liquid tag plugin to build links...
View link_helper.rb
store = {}
store.setdefault = (key, def) ->
@[key] = def unless @[key]
namespace = 'pcache'
formatKey = ->
[] '.'
mweppler / cache.rb
Last active Dec 17, 2015
Ruby implementation of the python Cache class from Box CRE "The 'One' Thing" by Peter Potrebic
View cache.rb
#!/usr/bin/env ruby
# Ruby implementation of the python Cache class from Box CRE "The 'One' Thing" by Peter Potrebic
$store = {}
$namespace = 'rcache'
class Cache < Object
def initialize(cache_name)
do () ->
namespacer = (ns, obj) ->
if not typeof ns == "string" or not ns.length
throw new Error '[namespacer] Invalid namespace'
namespace = @
namespace = namespace[part] = namespace[part] or {} for part in ns.split '.'
namespace[attr] = obj[attr] for attr of obj if typeof obj == 'object'
@['namespacer'] = @['ns'] = namespacer