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 | |
| # Save your tab history once you've reached a state | |
| # where too many windows/tabs are open. ^^ | |
| DATE=$(date "+%Y%m%d%H%M%S") | |
| SAFARI_TABS_DB="$HOME/Library/Containers/com.apple.Safari/Data/Library/Safari/SafariTabs.db" | |
| sqlite3 "$SAFARI_TABS_DB" <<EOF | |
| .headers ON |
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
| # Remove formulae which are dependencies from the Brewfile | |
| # As crafted by @stealthybox: https://github.com/Homebrew/homebrew-bundle/issues/236#issuecomment-437644953 | |
| cat ~/Brewfile | egrep "$(brew leaves | xargs printf '"%s"|')tap|cask|mas" |
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
| # list merge commits between HEAD and the last tag | |
| git log --merges $(git describe --abbrev=0)..HEAD --format=%s | |
| # compare changes between the last two tags | |
| # note: HEAD must be at least "equal" to the most recent tag | |
| git diff -w $(git describe --abbrev=0 $(git rev-list --tags --max-count=2 | tail -n 1))..$(git describe --abbrev=0) | |
| # create a remote counterpart and name it after the current branch | |
| git push -u origin $(git branch --show-current) |
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
| module HashDecorator | |
| def deep_symbolize_keys | |
| each.with_object({}) do |(k, v), new_hash| | |
| new_hash[k.to_sym] = | |
| case v | |
| when Hash then v.deep_symbolize_keys | |
| when Array then v.deep_symbolize_elements | |
| else v | |
| end | |
| end |
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
| ffmpeg -i ~/Desktop/Screen\ Recording\ 2021-01-20\ at\ 10.53.21.mov -vcodec libx265 -crf 28 ~/Desktop/Screen\ Recording\ 2021-01-20\ at\ 10.53.21.mp4 |
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
| ffmpeg -i /Users/jcsanti/Desktop/Screen\ Recording\ 2020-11-27\ at\ 10.04.15.mov -vf "fps=10,scale=900:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 /Users/jcsanti/Desktop/new_gif_from_screen_recording.gif |
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
| CREATE TABLE reservation (room int, during tsrange); | |
| INSERT INTO reservation VALUES | |
| (1108, '[2010-01-01 14:30, 2010-01-01 15:30)') | |
| ,(1108, '[2010-01-01 15:00, 2010-01-01 16:30)'); | |
| CREATE FUNCTION tsrange_union_accum(tsrange, tsrange) | |
| RETURNS tsrange | |
| AS 'SELECT $1 + $2' | |
| LANGUAGE SQL | |
| IMMUTABLE |
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
| {*,.*}~log/**~tmp/**~coverage/**~public/assets/**~assets/images/** |
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
| class Person | |
| KEYWORD_ARGS = [:name, :age].freeze | |
| class_eval(%Q{ | |
| def initialize(#{KEYWORD_ARGS.map { |kw| "#{kw}:" }.join(', ')}) | |
| #{KEYWORD_ARGS.map { |kw| "instance_variable_set(\"@#{kw.to_s}\", #{kw})" }.join("\n")} | |
| end | |
| }) | |
| def self_introduction |