Skip to content

Instantly share code, notes, and snippets.

View mattscilipoti's full-sized avatar

Matt Scilipoti mattscilipoti

View GitHub Profile
@mlanett
mlanett / rails http status codes
Last active May 14, 2024 08:48
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing

Command Line Tricks

  • !! Repeat Previous Command
  • !-1 Repeat Previous Command
  • !-2 Repeat 2nd Previous Command
  • !ps Execute Previous Command STARTING WITH ps
  • !^ First Argument From Previous Command
  • !:2 2nd Argument From Previous Command
  • !$ Last Argument From Previous Command
  • !!:$ Last Argument From Previous Command
@flarik
flarik / dot.powrc.sh
Created June 12, 2013 10:25
Pow's .porwrc config file for use with RVM's config files .rvmrc or .ruby-version (+ optional .ruby-gemset)
if [ -f "${rvm_path}/scripts/rvm" ]; then
source "${rvm_path}/scripts/rvm"
if [ -f ".rvmrc" ]; then
source ".rvmrc"
elif [ -f ".ruby-version" ] && [ -f ".ruby-gemset" ]; then
rvm use `cat .ruby-version`@`cat .ruby-gemset`
elif [ -f ".ruby-version" ]; then
rvm use `cat .ruby-version`
@equivalent
equivalent / README.md
Last active December 16, 2021 16:34
String "false" to_bool ... or how to convert Rails/SimpleForm radio buttons to boolean

This gist was writen in 2012 and it was solving specific problem in Rails & SimpleForm. Some fellow developers were pointing out this may be out dated concept. That's why I advise everyone to read comment section bellow to have a full grasp of alternative solutions

other sources that may be helpful to understand why this may not be best idea:

@mattscilipoti
mattscilipoti / cucumber.yml
Created June 6, 2012 14:58
cucumber.yml that moves rerun.txt to tmp (DRYly)
<%
# vars for default formats. These are overridden by command line args.default_format_multi = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'}"
default_format_single = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'}"
html_report_options = " --format html --out='public/reports/features.html'"
# Use tmp dir for rerun.txt (vs. root)
rerun_file = File.join('tmp', 'rerun.txt')
rerun = File.file?(rerun_file) ? IO.read(rerun_file) : ""
rerun_format = "--format rerun --out #{ rerun_file }"