Skip to content

Instantly share code, notes, and snippets.

View henrypoydar's full-sized avatar
🤓

Henry Poydar henrypoydar

🤓
View GitHub Profile
require 'rubygems'
require 'mongoid'
Mongoid.configure do |config|
config.master = Mongo::Connection.new.db("mongoid_key_test")
end
Mongoid.master.collection("users").drop
class User
# Cookbooks and DNA stored within app codebase
# Pro: no separate repo for deploy config/setup
# Con: keeping sync'd with changes to eycloud-recipes repo harder (solve w/ subtree?)
# Structure
railsapp
|-- deploy
| |-- after_restart.rb
| |-- before_migrate.rb
~ $ rvm --trace update
+__rvm_parse_args:414> [[ -z 4.3.9 ]]
+__rvm_parse_args:570> [[ -z '' && -n '' ]]
+__rvm_parse_args:572> [[ 0 -eq 1 || -n '' ]]
+__rvm_parse_args:15> [[ -n update ]]
+__rvm_parse_args:17> rvm_token=update
+__rvm_parse_args:19> [[ 0 -gt 0 ]]
+__rvm_parse_args:19> next_token=''
+__rvm_parse_args:21> case update (fetch|version|srcdir|reset|debug|reload|update|monitor|notes|implode|seppuku|question|answer|env)
+__rvm_parse_args:23> rvm_action=update
@henrypoydar
henrypoydar / progress.coffee
Created January 9, 2012 16:14
Global progress
$(document).ready ->
$('#progress').ajaxStart ->
$(@).show()
$('#progress').ajaxStop ->
$(@).hide()
~ $ rvm use jruby-head
Using /Users/hpoydar/.rvm/gems/jruby-head
~ $ jruby -v
jruby 1.7.0.dev (ruby-2.0.0dev) (2012-03-16 61bd77a) (OpenJDK 64-Bit Server VM 1.7.0-u4-b13) [darwin-amd64-java]
~ $ jruby --1.9 -v
jruby 1.7.0.dev (ruby-2.0.0dev) (2012-03-16 61bd77a) (OpenJDK 64-Bit Server VM 1.7.0-u4-b13) [darwin-amd64-java]
~ $
@henrypoydar
henrypoydar / Gemfile
Created December 11, 2012 14:41
New Relic setup for Rails app in Torquebox
...
gem "newrelic_rpm", "~> 3.5.3.25", :require => false
...
#RP5_HOME: "" # windoes users should set this
PROCESSING_ROOT: "/usr/share/processing" # Works for ArchLinux
#PROCESSING_ROOT: "/home/tux/processing-2.1.0" # Other linux distros with user tux
#PROCESSING_ROOT: "/Applications/Processing.app/Contents/Resources/Java" # Path for Mac?
#PROCESSING_ROOT: "C:\Java\processing-2.1.0" # if you follow PhiLhos suggestion for windoes
namespace :deploy do
desc "Tag a release and deploy the application to production"
task :production do
release_tag_name = "release-#{Time.now.utc.strftime('%Y%m%d.%H%M')}"
sh "git push origin integration"
sh "git checkout master"
sh "git merge integration"
@henrypoydar
henrypoydar / gist:a27ac4643646248b0947
Last active July 26, 2016 13:49
Mailplane CSS - Helvetica theme
/*=====
HIDING
======
/* Hide the Google+ buttons */
/*
.gb_ea,
.gb_fa
{ display: none; }
*/
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
load "#{Rails.root}/db/seeds.rb"
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction