Skip to content

Instantly share code, notes, and snippets.

require 'httparty'
URL = 'http://localhost:3000/posts?search='
def get(search_term)
HTTParty.get(
"#{URL}#{search_term}"
)
end
# frozen_string_literal: true
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
# frozen_string_literal: true
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
@abaldwin88
abaldwin88 / fstash.zsh
Last active March 31, 2017 21:45 — forked from dekz/fstash.zsh
fzf + git stash
fstash() {
local out q k sha
while out=$(
git stash list --pretty="%C(yellow)%h %>(14)%Cgreen%cr %C(blue)%gs" |
fzf --ansi --no-sort --query="$q" --print-query \
--expect=ctrl-d,ctrl-b);
do
IFS=$'\n'; set -f
lines=($(<<< "$out"))
unset IFS; set +f
@abaldwin88
abaldwin88 / gist:5ee8677c2363d632c1f4a049642c7c4d
Created April 12, 2016 19:59 — forked from viola/gist:1070410
Example of fetching Hash (key,value) to the simple_form collection.
-- model
some sort of constant hash:
HASH_NAME = {
0 => "Choose:",
1 => "On-Campus Recruiting - CSO",·
2 => "CSO Staff Referral",
3 => "Faculty Contact",·
4 => "Career Day",·
5 => "CSO Summer Job Listing",·
6 => "Alumni Contact",·