Skip to content

Instantly share code, notes, and snippets.

View AJ-Acevedo's full-sized avatar
🤓
Studying

AJ Acevedo AJ-Acevedo

🤓
Studying
View GitHub Profile

Postgres 9.2 - Install, Setup and Quick Reference

Set the default template to UTF8

$ su postgres
$ psql -U postgres
psql (9.2.4)
Type "help" for help.
# app / controllers / application_controller.rb
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_filter :configure_permitted_parameters, if: :devise_controller?
protected
def configure_permitted_parameters
@AJ-Acevedo
AJ-Acevedo / mytest.txt
Created June 23, 2013 17:42
RailsApps Composer not working with Rails RC2
minibook:sandbox aj$ ruby -v
ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin11.4.2]
minibook:sandbox aj$ rvm gemset use mytest --create
minibook:sandbox aj$ gem install rails --version=4.0.0.rc2
Fetching: i18n-0.6.4.gem (100%)
Successfully installed i18n-0.6.4
Fetching: multi_json-1.7.7.gem (100%)
Successfully installed multi_json-1.7.7
Fetching: tzinfo-0.3.37.gem (100%)
Successfully installed tzinfo-0.3.37
@AJ-Acevedo
AJ-Acevedo / log2
Created June 1, 2013 18:31
debug output for rvm issue #1928
##############################################
####### $ rvm --debug requirements ruby #####
##############################################
$ rvm --debug requirements ruby
rvm_autolibs_flag=enable
Installing requirements for osx, might require sudo password.
requirements code for osx loaded
brew seems to be writable
Install custom packages: homebrew/dupes.
@AJ-Acevedo
AJ-Acevedo / log
Created June 1, 2013 00:01
rvm log for issue #1928
$ rvm --trace requirements ruby
+ [[ -n '' ]]
+ set -o errtrace
+ export 'PS4=+ $(date "+%s.%N") ${BASH_SOURCE##${rvm_path:-}} : ${FUNCNAME[0]:+${FUNCNAME[0]}()} ${LINENO} > '
+ PS4='+ $(date "+%s.%N") ${BASH_SOURCE##${rvm_path:-}} : ${FUNCNAME[0]:+${FUNCNAME[0]}()} ${LINENO} > '
+ 1370044767.N /scripts/cli : __rvm_parse_args() 709 > [[ -z '' ]]
+ 1370044767.N /scripts/cli : __rvm_parse_args() 709 > [[ -n '' ]]
+ 1370044767.N /scripts/cli : __rvm_parse_args() 712 > [[ error == '' ]]
+ 1370044767.N /scripts/cli : __rvm_parse_args() 712 > [[ 0 -eq 1 ]]
+ 1370044767.N /scripts/cli : __rvm_parse_args() 712 > [[ -n '' ]]
@AJ-Acevedo
AJ-Acevedo / passenger-install.md
Last active December 17, 2015 09:29
Installing Passenger On Mac OS 10.8.3 with SSL

Installing Phusion Passenger on Mac OS 10.8.3 with SSL

$ brew install pcre
$ gem install passenger
$ passenger-install-nginx-module
https://www.phusionpassenger.com/download

TODO:

  • create a deploy user and group
@AJ-Acevedo
AJ-Acevedo / rvm-install.md
Last active November 1, 2016 14:13
Installing RVM, Ruby, & Rails
@AJ-Acevedo
AJ-Acevedo / host.rb
Last active December 23, 2018 10:09
Ruby code snippets to determine host OS and currently running ruby version
#!/usr/bin/env ruby
# Ruby code snippets to determine host OS and currently running ruby version
##############################################################
# RbConfig to determine host OS and exit if not mac or linux #
##############################################################
require 'rbconfig'
@os = RbConfig::CONFIG['host_os']
@AJ-Acevedo
AJ-Acevedo / k4-hotfix.sh
Last active December 15, 2015 20:40
Bash script to add a directory to the CS6 installation which K4 depends on for non-admin users.
#!/usr/bin/env bash
# This script adds an empty Macintosh HD directory to the CS6 installation which K4 depends on for non-admin users.
# This script must be run with sudo from Terminal or deployed as an Administrator with Remote Desktop
# ie:
# $ sudo ./k4-hotfix.sh
# If you are unable to execute this file make sure it has executable permissions.
# $ chmod 777 k4-hotfix.sh
mkdir -p /Applications/Adobe\ InDesign\ CS6/Adobe\ InDesign\ CS6.app/Contents/MacOS/Macintosh\ HD
@AJ-Acevedo
AJ-Acevedo / test_chromatic.rb
Last active December 15, 2015 07:19
Chromatic gem
# This works
$ gem install colorize
$ ruby -rubygems -e 'require "colorize"; puts "This is a blinking blue on red string".blue.on_red.blink'
# this is broken
gem install chromatic
$ ruby -rubygems -e 'require "chromatic"; puts "This is a blinking blue on red string".blue.on_red.blink'