Skip to content

Instantly share code, notes, and snippets.

View MirkoCindric's full-sized avatar

Mirko Cindric MirkoCindric

View GitHub Profile
@MirkoCindric
MirkoCindric / gist:3d0962a7a071b92b1e44
Created October 20, 2014 00:56
Fixing PG after Yosimite Install
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
#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
#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"
@MirkoCindric
MirkoCindric / routes.rb
Created September 1, 2010 02:18 — forked from radar/routes.rb
ActionController::Routing::Routes.draw do |map|
map.twitter 'twitter', :controller => "twitter", :action => "twitter"
map.root :controller => "twitter"
end
@MirkoCindric
MirkoCindric / Base Gems
Created April 30, 2012 00:57
Gems to use on a greenfield rails app
# database
gem 'pg'
gem 'interactive_migrations'
# Views
gem 'haml'
gem 'simple_form', '~>2.0.0'
gem 'country-select'
gem 'pjax_rails'
@MirkoCindric
MirkoCindric / Postgres User Set Up
Created August 3, 2012 07:12
Setting up users on Postgres
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 / Pod.bridgesupport file
Created September 7, 2012 00:30
Pod bridgesupport file issue
<?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'/>
/*
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 / prepare-commit-msg
Created June 27, 2021 02:36 — forked from stefanbuck/prepare-commit-msg
Ticket number git hook
#!/usr/bin/env bash
#
# Authors:
# Stefan Buck (https://github.com/stefanbuck)
# Thomas Ruoff (https://github.com/tomru)
#
#
# Description:
# Are you still prefixing your commits with a ticket number manually? You will love this script!
# This is a git hook script that will automatically prefix your commit messages with a ticket
Try these commands (although the third one may not be necessary for you):
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
A reboot may or may not be necessary (sudo shutdown -r 0)