Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/ruby
# tp-dailylog.rb - Log TaskPaper tasks completed on the current day to a Day One entry
# Brett Terpstra 2012 <http://brettterpstra.com>
#
# Run it with launchd at 11pm and forget about it
#
# Notes:
# * Uses `mdfind` to locate all .taskpaper files changed in the last day
# * Scans for @done(xxxx-xx-xx) tags in each line matching today's date
# * Does not alter TaskPaper files in any way
INFO [62ef3222] Running RBENV_ROOT=/usr/local/rbenv RBENV_VERSION=2.1.1 /usr/local/rbenv/bin/rbenv exec bundle install --binstubs /home/deploy/apps/tmcyf_production/shared/bin --path /home/deploy/apps/tmcyf_production/shared/bundle --without development test --deployment --quiet on 162.243.103.14
DEBUG [62ef3222] Command: cd /home/deploy/apps/tmcyf_production/releases/20140417060020 && ( RBENV_ROOT=/usr/local/rbenv RBENV_VERSION=2.1.1 RBENV_ROOT=/usr/local/rbenv RBENV_VERSION=2.1.1 /usr/local/rbenv/bin/rbenv exec bundle install --binstubs /home/deploy/apps/tmcyf_production/shared/bin --path /home/deploy/apps/tmcyf_production/shared/bundle --without development test --deployment --quiet )
DEBUG [62ef3222] Unfortunately, a fatal error has occurred. Please see the Bundler
DEBUG [62ef3222]
DEBUG [62ef3222] troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
DEBUG [62ef3222]
DEBUG [62ef3222] /usr/local/rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/bundler-1.6.2/lib/bundler/

autosuggest

Eventually, a library that enables me to do interactive fish-shell style autosuggestions from within Ruby command-line tools.

# Description:
# Looks up the phone number for a given name in the YF.
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# Description:
# Looks up the phone number for a given name in the YF.
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
class SmsController < ApplicationController
skip_before_filter :verify_authenticity_token, only: [:receive_sms]
def new_sms
# validate that user is an admin
redirect_to :root unless current_user && current_user.admin?
end
def send_sms
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
require 'nokogiri'
require 'open-uri'
require 'chronic'
post_titles_and_dates = (1..3).flat_map do |i|
page = Nokogiri::HTML(open("http://somethingdoneright.net/page/#{i}"))
blog_posts = page.css(".post")
# need to go from post title and post date to YEAR-MONTH-DAY-title.MARKUP
blog_posts.map do |post|
title = post.at_css("h2")
@stijlist
stijlist / _form.html.haml
Created June 10, 2012 16:58
Trying to add CSS classes to form_for
= form_for (@user, :html => {:class => "well"}) do |f|
-if @user.errors.any?
#error_explanation
%h2= "#{pluralize(@user.errors.count, "error")} prohibited this user from being saved:"
%ul
- @user.errors.full_messages.each do |msg|
%li= msg
.field
= f.label :fname
@stijlist
stijlist / flexbox-grid.scss
Created October 10, 2015 18:20 — forked from zeusdeux/flexbox-grid.scss
flexbox based simple grid system
/* Simple flexbox based grid system */
$columns: 12;
@mixin layout-cols($device) {
@for $i from 1 through 12 {
.l-#{$device}-col-#{$i} {
flex: 0 0 $i / $columns * 100%;
}
}