Skip to content

Instantly share code, notes, and snippets.

View revans's full-sized avatar
🤠
Building Businesses

Robert Evans revans

🤠
Building Businesses
View GitHub Profile
@revans
revans / gist:1133370
Created August 9, 2011 03:54
Kilauea burger
What it is: jalapeno and black pepper crusted burger, pepper jack cheese, chipotle aioli and seasond red onion strings. Here is how you make it.
First the meat for the burger. Usually they are grilled. If you don't have a possibility to charcoal grill them, ..then pan grill.
1/2 lb. ground beef sirloin (92% lean)
1/2 lb. ground beef chuck (85% lean)
salt to taste
1 tablespoons cracked black pepper
1 or 1 1/2 tablespoon very finely diced jalapeno
6 hamburger buns, split
@revans
revans / example.rb
Last active November 18, 2022 14:41
# Instance Variable that is undefined
@person&.name # => nil
# Method that returns nil
def person; nil; end
person&.name # => nil
# local variable that is undefined - this is the one I am curious about since it "seems" to break convention
adult&.name # => undefined local variable exception raised
@revans
revans / gist:d7c240dfc3a8e79a76dce47842927784
Created May 14, 2021 00:38 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@revans
revans / user_script.sh
Last active October 27, 2020 18:16
AWS User Script for getting a server ready for Ruby, Rails, Sinatra, or Rack apps.
#!/usr/bin/env bash
#
# Author: Robert R Evans
#
# Description: AWS Ubuntu 13 Ruby Setup Script
#
# This script will setup a ubuntu box for Ruby, Rails, Sinatra, and/or Rack
# development/staging/production usage. It also installs Nodejs, Nginx, Git,
# Rbenv, and PostgreSQL adapters for using RDMS PostgreSQL. It assumes that
# git-deploy will be used, in place of the traditional capistrano deployments.
file -bI INPUT_FILENAME | cut -d ';' -f 2 | cut -d '=' -f 2 | xargs -I % sh -c 'iconv -f % -t utf-8 INPUT_FILENAME >> OUTPUT_FILENAME'
@revans
revans / LocalTimezoneDatabase.mkd
Last active June 8, 2020 12:08
This is a pretty rough explanation, with some examples, of how to setup a PostgreSQL database with PostGIS, and build your timezone table that you can query, given a latitude and longitude.

Installing and Setting a Timezone database

We're using Rails 4, PostgreSQL 9.3.4, and PostGIS 2.1.2.

Creating a Postgis enabled Postgresql template

createdb -E UTF8 template_postgis
createlang -d template_postgis plpgsq
psql -d template_postgis -c "CREATE EXTENSION postgis WITH SCHEMA public;"
# Copy this to your ~/.bash_profile
# for git
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
#!/bin/bash
#
# Needs to be saved into your ~/bin directory
#
# Example: git dev my-feature-name
#
# set -e
git checkout -b dev/$1
@revans
revans / demo.rb
Last active August 8, 2018 12:34
Using attr_reader with ||= and getting interesting results
# ruby 2.5.0p0 (2017-12-25 revision 61468)
class Demo
attr_reader :first_name
def initialize(first_name)
@first_name = first_name
end
def hi(myname = nil)
puts "Hello, #{first_name}"
@revans
revans / status_codes.rb
Last active January 19, 2018 23:27
Rails Status Codes
STATUS_CODES = {
100 => :continue,
101 => :switching_protocols,
102 => :processing,
200 => :ok,
201 => :created,
202 => :accepted,
203 => :non_authoritative_information,
204 => :no_content,