Skip to content

Instantly share code, notes, and snippets.

@MirkoCindric
MirkoCindric / gist:3d0962a7a071b92b1e44
Created Oct 20, 2014
Fixing PG after Yosimite Install
View gist:3d0962a7a071b92b1e44
brew update
rvm get stable
rvm gemset pristine
mkdir /usr/local/var/postgres/pg_tblspc
mkdir /usr/local/var/postgres/pg_twophase
mkdir /usr/local/var/postgres/pg_stat_tmp
View caveatPatchor.js
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
@MirkoCindric
MirkoCindric / Pod.bridgesupport file
Created Sep 7, 2012
Pod bridgesupport file issue
View Pod.bridgesupport file
<?xml version='1.0'?>
<signatures version='1.0'>
<constant const='true' name='AFNetworkingErrorDomain' declared_type='NSString*' type='@'/>
<constant const='true' name='AFNetworkingOperationDidFinishNotification' declared_type='NSString*' type='@'/>
<constant const='true' name='AFNetworkingOperationDidStartNotification' declared_type='NSString*' type='@'/>
<constant const='true' name='AFNetworkingReachabilityDidChangeNotification' declared_type='NSString*' type='@'/>
<enum value='0' name='AFFormURLParameterEncoding'/>
<enum value='1' name='AFJSONParameterEncoding'/>
<enum value='0' name='AFNetworkReachabilityStatusNotReachable'/>
<enum value='1' name='AFNetworkReachabilityStatusReachableViaWWAN'/>
@MirkoCindric
MirkoCindric / Postgres User Set Up
Created Aug 3, 2012
Setting up users on Postgres
View Postgres User Set Up
psql template1
CREATE USER develop WITH PASSWORD 'develop';
CREATE USER postgres WITH PASSWORD 'postgres';
CREATE USER test WITH PASSWORD 'test';
ALTER USER develop CREATEUSER CREATEDB;
ALTER USER test CREATEUSER CREATEDB;
ALTER USER postgres CREATEUSER CREATEDB;
@MirkoCindric
MirkoCindric / Base Gems
Created Apr 30, 2012
Gems to use on a greenfield rails app
View Base Gems
# database
gem 'pg'
gem 'interactive_migrations'
# Views
gem 'haml'
gem 'simple_form', '~>2.0.0'
gem 'country-select'
gem 'pjax_rails'
View routes.rb
ActionController::Routing::Routes.draw do |map|
map.twitter 'twitter', :controller => "twitter", :action => "twitter"
map.root :controller => "twitter"
end
View Sentia.rake
#Simple task that updates development and test db all at once.
namespace :db do
namespace :migrate do
desc "Migrates development and test databases"
task :all do
puts "Migrating development database"
Rake::Task["db:migrate"].invoke
puts "Migrating test database"
View UserMethods.rb
#Methods for use with Authlogic
module UserMethods
protected
# Redirects back or if that fails, redirects to the supplied path
# Also accepts a notice if you want to flash something
def redirect_back_or_to(path, notice=nil)
flash[:notice] = notice unless notice.blank?
begin