Skip to content

Instantly share code, notes, and snippets.

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 / gist:bb932fb93e22fe6260b2
Last active July 12, 2020 06:43
rich-hickey-mastery
Rich Hickey on becoming a better developer
Avatar
Rich Hickey • 3 years ago
Sorry, I have to disagree with the entire premise here.
A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.
Mastery comes from a combination of at least several of the following:
@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%;
}
}
@stijlist
stijlist / core.cljs
Last active May 30, 2016 16:39
2nd om/transact! not causing a re-render
(ns enough.core
(:require
[goog.dom :as dom]
[om.next :as om :refer-macros [defui]]
[sablono.core :refer-macros [html]]))
(enable-console-print!)
(defmulti read om/dispatch)
(defmulti mutate om/dispatch)

Keybase proof

I hereby claim:

  • I am stijlist on github.
  • I am stijlist (https://keybase.io/stijlist) on keybase.
  • I have a public key ASAB3FlQD0vCo7jDOfq5PHjc2zVJCV1eqF0tXbVCArX2qwo

To claim this, I am signing this object: