Skip to content

Instantly share code, notes, and snippets.


Andrew Stelmach Yorkshireman

View GitHub Profile
Yorkshireman / _hello_world.slim
Last active May 6, 2021
slim partials in Sinatra
View _hello_world.slim
h1 Hello, World! Hello #{name}!
/ I initially had only `.render({}, locals)`, which meant that the partials didn't
/ have access to any helper methods contained inside `OtherHelperMethods` (but `home.slim` did).
/ Passing `self` into `.render`, as the first argument, fixes that (if you're curious
/ about that, look up the `Tilt::Template #render` documentation.
/ With this PartialsHelper, passing locals is optional, as is specifying a different
/ path to the partial (relative to `settings.views`).
Yorkshireman / circle.yml
Created Jun 29, 2016
Installing Chrome on Circle CI machine (Ubuntu 14.04)
View circle.yml
- sudo apt-get install libxss1 libappindicator1 libindicator7
- wget
- sudo dpkg -i ./google-chrome*.deb
- sudo apt-get install -f
Yorkshireman / Gemfile
Last active Jun 16, 2016
Basic Sinatra starter Gemfile
View Gemfile
source ''
ruby '2.3.1'
gem 'sinatra'
group :development, :test do
gem 'byebug'
Yorkshireman / team.rb
Last active May 30, 2016
Neat Class.all pattern
View team.rb
class Team
TEAMS = []
attr_reader :name
def initialize(params)
@name = params[:team][:name]
TEAMS << self
def self.all
View gist:8d886dbfde6b2c1afc6af9141daa5e64


Ctrl + a Go to the beginning of the line.
Ctrl + e Go to the end of the line.

Terminal & Browser

Command + Shift + { or } Select tab on the left or right.
Command + Shift + { or } Select tab on the left or right.
Command + Shift + T Re-open a tab that you've just closed.
Command + T Open a new tab.

Yorkshireman / users.rb
Created Feb 1, 2016
PadrinoBlog users controller pre-refactor
View users.rb
PadrinoBlog::App.controllers :users do
get :new do
@user =
render 'users/new'
post :create do
user =[:user])
Yorkshireman / Gemfile
Last active Jan 27, 2016
spec_helper and Gemfile from a Padrino app. This successfully runs RSpec/Capybara Unit/Feature tests.
View Gemfile
source ''
# Padrino supports Ruby version 1.9 and later
ruby '2.3.0'
# Project requirements
gem 'rake'
# Component requirements
gem 'bcrypt'