Skip to content

Instantly share code, notes, and snippets.

View pho3nixf1re's full-sized avatar
🛩️
I'd rather be flying

Matthew Turney pho3nixf1re

🛩️
I'd rather be flying
View GitHub Profile
@chetan
chetan / yardoc_cheatsheet.md
Last active May 10, 2024 02:53
YARD cheatsheet
@cypriss
cypriss / README.md
Last active June 18, 2018 11:57
Rails 2.3.14 Ruby 1.9.3 - Monkey Patches

How we upgraded UserVoice, a Rails 2.3.14 app, to Ruby 1.9.3.

Blog post here

@paulnicholson
paulnicholson / powssl
Last active November 24, 2021 16:40
ssl with pow using stud

Instructions

  • Install stud $ brew install https://raw.github.com/paulnicholson/homebrew/master/Library/Formula/stud.rb
  • Download and install the powssl script $ curl https://gist.githubusercontent.com/paulnicholson/2050941/raw/7e4d2178e3733bed18fdfe737277c3cb72241d39/powssl > ~/bin/powssl $ chmod +x ~/bin/powssl
  • Run powssl to create development certificate and configure stud.
  • $ powssl
@eric
eric / _using_it.rb
Created March 16, 2012 20:41
Use Arel in Rails 2.3
>> engine = ArelBack::Engine.new(ar.connection, Arel::Visitors::MySQL)
>> table = Arel::Table.new(ar.table_name, engine)
>> table.project(Arel.sql('*')).to_sql
=> "SELECT * FROM `awesome_table` "
>>
@bokmann
bokmann / ActiveRepository.rb
Created March 27, 2012 16:15
ActiveRepository Strawman
# MOTIVATION: As rails apps are growing, people are noticing the drawbacks
# of the ActiveRecord pattern. Several apps I have seen, and several
# developers I have spoken to are looking towards other patterns for object
# persistence. The major drawback with ActiveRecord is that the notion
# of the domain object is conflated with what it means to store/retrieve
# it in any given format (like sql, json, key/value, etc).
#
# This is an attempt to codify the Repository pattern in a way that would
# feel comfortable to beginner and seasoned Ruby developers alike.
#
@cypriss
cypriss / action_mailer_no_tmail.rb
Created August 14, 2012 17:32
Use TMail -> Mail gem in Rails 2.3
require 'action_mailer'
require 'mail'
module ActionMailer
class Base
def clean_address(str)
EmailAddress.parse(str, :no_default_name => true).quoted rescue str
end
@joshearl
joshearl / blank-sublime-text-snippet.xml
Created December 1, 2012 13:21
Sublime Text 2 Recruiter Response Snippet
<snippet>
<content><![CDATA[]]></content>
<tabTrigger></tabTrigger>
<scope></scope>
<description></description>
</snippet>
@mpapis
mpapis / powrc.sh
Last active June 10, 2020 21:31 — forked from nbibler/gist:5307941
if
[ -f "$rvm_path/scripts/rvm" ]
then
__env="$( "$rvm_path/bin/rvm" . do env --path )"
if
[ -n "$__env" ] &&
[ -s "$__env" ]
then
source "$__env"
fi
@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`
@tungd
tungd / react-helper.js
Last active November 30, 2018 06:33
React Helper to initialize the component from HTML, similar to AngularJS.
/**
* react-helper.js
*
* Helper for Facebook's React UI Library. Add support for declare
* component on DOM (similar to AngularJS Directive).
*
* Usage:
* - Register a component:
* ReactHelper.register('MyComponent', MyComponent)
* - Declare the DOM node: