Skip to content

Instantly share code, notes, and snippets.

#!/bin/zsh
play() {
while true; do
echo "~ Playing $1."
afplay ~/"Dropbox/Media/Meditation/Lifeflow/LifeFlow 2.0 Bonus/$1"
done
}
case "$1" in
#!/bin/sh
#echo "~ OS X updates."
#sudo softwareupdate -i -a
echo "~ Homebrew updates."
brew update && brew upgrade && brew cleanup && brew services cleanup
echo "~ Homebrew Cask updates."
brew cask upgrade && brew cask cleanup

Workflow

Option I

  • Editorial workflow that POSTs an article file in markdown format with headers to an endpoint.
  • Simple Rack app that exposes POST /publish.

Cons

  • Vendor lock-in (Editorial).

Option II

byc-api 2.1.5 % be rake spec [0]
Patching ActiveRecord::Relation#or. This might blow up
/home/botanicus/.rubies/ruby-2.1.5/bin/ruby -I/home/botanicus/.gem/ruby/2.1.5/gems/rspec-core-3.4.4/lib:/home/botanicus/.gem/ruby/2.1.5/gems/rspec-support-3.4.1/lib /home/botanicus/.gem/ruby/2.1.5/gems/rspec-core-3.4.4/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb
Patching ActiveRecord::Relation#or. This might blow up
..............................................................§§...................................................................................................................................................................................................................................FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF......FFFFFFFFFFFFFFFFFFFFFF..............................................................................................................................................................................................................
byc-api 2.2.10 % RAILS_ENV=test be rake db:schema:load [1]
Patching ActiveRecord::Relation#or. This might blow up
-- create_table("answers", {:force=>:cascade})
-> 0.0236s
-- add_index("answers", ["question_id"], {:name=>"index_answers_on_question_id", :using=>:btree})
-> 0.0104s
-- create_table("committee_members", {:force=>:cascade})
-> 0.0209s
-- add_index("committee_members", ["committee_id"], {:name=>"index_committee_members_on_committee_id", :using=>:btree})
-> 0.0119s
#!/bin/sh
# TODO: Rewrite to Ruby, so we can parse the config and display proper from - to in the notification.
BEFORE=$(networksetup -getairportpower en0)
internet-usage-limiter.is_online && /usr/sbin/networksetup -setairportpower en0 on || /usr/sbin/networksetup -setairportpower en0 off
if test "$(networksetup -getairportpower en0)" = "Wi-Fi Power (en0): Off" && test "$BEFORE" = "Wi-Fi Power (en0): On"; then
osascript -e 'display notification "Your WiFi has been switched off. Use the go-online utility to get online between 9:30 and 18:20." with title "Mindfulness"'
fi
plugin.command(:ReloadTaskPlugin) do |nvim|
nvim.command(":UpdateRemotePlugins")
load(__FILE__)
end
@botanicus
botanicus / README.md
Last active June 11, 2018 20:04
Post-commit hook to fix files with Rubocop.

Installation

gem install refined-refinements
git clone https://gist.github.com/40da4532046d65318f860bff115db603.git
cp 40da4532046d65318f860bff115db603/pre-commit 40da4532046d65318f860bff115db603/post-commit your_repo/.git/hooks

Features

#!/usr/bin/env ruby
Dir.chdir(File.dirname(__FILE__))
# IPod-Shuffle-4g ignores aiff files and besides, they are really, really big.
# (The originals are about 10 times bigger than the output mp3 after the conversion.)
# 57M vs. 5,2M
Dir.glob('**/*.aiff').each do |path|
command = "ffmpeg -i '#{path}' '#{path.sub('.aiff', '.mp3')}' && rm '#{path}'"
puts "~ #{command}"; system(command)
# encoding: utf-8
require_relative 'spec_helper'
describe 'GET /addresses/:id', role: :retailer, model: GiveIt::Models::Address do
include GiveIt::Spec::Endpoints
let(:attrs) do
{email: '[email protected]'}
end