This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#= require jquery | |
#= require underscore | |
# pick randomly from an array | |
randomInArray = (arr) -> | |
arr[Math.floor(Math.random()*arr.length)] | |
# interesting looking characters | |
bgChars = ["€","ç","∅","ξ","φ","ð","⊗","∴","∉","♣","¤","‰", "◊"] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 [email protected] 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "benchmark/ips" | |
require "attr_extras" | |
first_name = "John" | |
last_name = "Brown" | |
module FullName | |
def full_name | |
[first_name, last_name].compact.join(" ") | |
end |