Skip to content

Instantly share code, notes, and snippets.

View waymondo's full-sized avatar

justin talbott waymondo

View GitHub Profile
@waymondo
waymondo / benchmark.rb
Created July 24, 2023 14:40
Comparing Ruby Struct / Data / Class
require "benchmark/ips"
require "attr_extras"
first_name = "John"
last_name = "Brown"
module FullName
def full_name
[first_name, last_name].compact.join(" ")
end
namespace :haml do
desc "Convert HAML templates to ERB"
task :convert_to_erb do
# Assumes you have faraday in your Gemfile
conn = Faraday.new(url: "https://haml2erb.org") do |f|
f.request :json
f.response :json
end
haml_filenames = Dir["app/views/**/*.haml", "app/components/**/*.haml", base: Rails.root]
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 5 taps (homebrew/cask-versions, homebrew/core, homebrew/cask, homebrew/bundle and homebrew/services).
==> New Formulae
btop fastfec goplus libsoup@2 php@8.0 pocsuite3 rizin smug
cava git-branchless java-service-wrapper mt32emu pip-audit regula sevenzip symengine
==> Updated Formulae
Updated 775 formulae.
==> Renamed Formulae
rt-audio -> rtaudio
direct = (opts) ->
return unless $.isPlainObject opts
$el = $(opts.el or @)
_.reduce _.pairs(opts), (memo, opt) ->
fn = $.fn[opt[0]] or director[opts[0]]
return memo unless fn
fn.call(memo, opt[1])
, $el
@director =
@waymondo
waymondo / gist:7103228
Last active December 26, 2015 05:49
html5vid.sh
#!/bin/bash
# html5 videos maker
# first: `brew install ffmpeg --with-libvorbis --with-libvpx --with-theora`
ffmpeg -i $1 -b 1500k -vcodec libx264 -g 30 -s 720x480 $1.mp4
ffmpeg -i $1 -b:v 1500k -vcodec libvpx -acodec libvorbis -ab 55000 -f webm -g 30 -s 720x480 $1.webm
ffmpeg -i $1 -b 1500k -vcodec libtheora -acodec libvorbis -ab 55000 -g 30 -s 720x480 $1.ogv
@waymondo
waymondo / gist:4346664
Created December 20, 2012 16:52
trippy css3 perspective hover animation for justintalbott.com
#= require jquery
#= require underscore
# pick randomly from an array
randomInArray = (arr) ->
arr[Math.floor(Math.random()*arr.length)]
# interesting looking characters
bgChars = ["€","ç","∅","ξ","φ","ð","⊗","∴","∉","♣","¤","‰", "◊"]
@waymondo
waymondo / arrow.less
Created May 25, 2012 20:43
less css bordered arrow mixin
// requires element to have position defined
// example usaage =>
// #arrow > .left(10px, #fff, 2px, rgba(0,0,0,0.6));
#arrow {
.base(@size, @backgroundColor, @borderSize, @borderColor) {
border: @borderSize solid @borderColor;
&:after, &:before {
bottom: 100%;