Eventually, a library that enables me to do interactive fish-shell style autosuggestions from within Ruby command-line tools.
This file contains 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
[code-reads]% cd ex-vi ○ | |
[ex-vi]% cloc . ± master f027810 | |
59 text files. | |
56 unique files. | |
47 files ignored. | |
http://cloc.sourceforge.net v 1.58 T=1.0 s (50.0 files/s, 28714.0 lines/s) | |
------------------------------------------------------------------------------- | |
Language files blank comment code | |
------------------------------------------------------------------------------- |
This file contains 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
/* 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%; | |
} | |
} |
This file contains 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
= 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 |
This file contains 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 '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") |
This file contains 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
# 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 |
This file contains 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 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 |
This file contains 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
# Description: | |
# Looks up the phone number for a given name in the YF. | |
# | |
# Dependencies: | |
# None | |
# | |
# Configuration: | |
# None | |
# | |
# Commands: |
This file contains 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
# Description: | |
# Looks up the phone number for a given name in the YF. | |
# | |
# Dependencies: | |
# None | |
# | |
# Configuration: | |
# None | |
# | |
# Commands: |
This file contains 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
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/ |