Skip to content

Instantly share code, notes, and snippets.

View danielres's full-sized avatar

Daniel Reszka danielres

View GitHub Profile
@danielres
danielres / database.yml
Created January 1, 2011 17:46
rails: read password data from a text file
production:
adapter: mysql
database: my_db
username: db_user
password: <%= begin IO.read("/home/my_deploy_user/.db") rescue "" end %>
## based on the example at:
## http://gist.github.com/17371
##
## put me in lib/un_haml.rb (in the haml-based project)
##
## call me on the command line thus:
## $ script/runner UnHaml app/views/layouts/application.html.haml
## $ script/runner UnHaml */*/*/*.haml
##
class UnHaml < Haml::Engine
@danielres
danielres / ubuntu_server_config.sh
Created January 9, 2011 00:04
steps used to install a rails environment for development on my Ubuntu 10.10 server box
# based on:
# http://www.hackido.com/2010/12/install-ruby-on-rails-on-ubuntu.html
# http://thekindofme.wordpress.com/2010/10/24/rails-3-on-ubuntu-10-10-with-rvm-passenger-and-nginx/
# http://ascarter.net/2011/01/02/rails-development-on-ubuntu-10.10.html
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install build-essential
sudo apt-get install git-core
@danielres
danielres / DRY database.yml
Created January 9, 2011 23:32
random personal notes and reminders related to my funny adventures with Rails
# inheritance in yml files:
development: &defaults
adapter: mysql
encoding: utf8
database: acme_development
username: root
test:
<<: *defaults
@danielres
danielres / VMonMaximizeWnd3.vbs
Created January 23, 2011 17:31
ultramon script to maximize window on virtual monitor
'script configuration:
'the coordinates of each monitor, either of the full screen area or parts of it, need to be specified, ordered from left to right.
'to take taskbars and desktop toolbars into account when maximizing or moving a window, specify the workspace coordinates instead of
'the screen coordinates. both types of coordinates are shown for each monitor under UltraMon menu > About
'
'sample script configuration:
'two monitors at 1024x768, the first monitor is split in a left and right half, the second monitor isn't split:
'MONITORS = Array("0,0,512,768","512,0,1024,768","1024,0,2048,768")
Option Explicit
@danielres
danielres / auto_refresh.ahk
Created January 24, 2011 12:53
This autohotkey script refreshes the browser window automatically when saving a file
; USAGE:
; 1. Install autohotkey.
; 2. Install the Firefox extension "CSS Reloader".
; 3. Save this script anywhere on your computer.
; 4. Open your website in Firefox.
; 5. In this script, replace "Expresto - Mozilla Firefox" with the title of the Firefox window you want to auto-refresh.
; 6. Run this script, it stays in the backgound.
; 7. Edit your website inside your preferred text editor or IDE.
; 8. Now, save your work, but instead of ctrl+s, use ctrl+alt+s (or altgr+s) and see Firefox refreshing stylesheets automagically in the background.
@danielres
danielres / generator.sh
Created February 8, 2011 14:34
random personal notes and reminders related to my funny adventures with RefineryCMS
# usage:
# curl https://gist.github.com/raw/816518/generator.sh | bash -s {APPNAME} {SSH_USER} {SSH_HOST}
APP=$1
SSH_USER=$2
SSH_HOST=$3
refinerycms -f $APP
cd $APP
# How to re-use the menu partial for a submenu in Refinery CMS >= 0.9.8.5
# header menu (main menu) which hides its children.
<%= render :partial => "/shared/menu",
:locals => {
:dom_id => 'menu',
:css => 'menu',
:collection => @menu_pages,
:hide_children => true
} -%>
# shoestring.rb
# Rails template
# from Judd Kussrow of Octopus Inc
# $ rails new Project -Jm http://octopusinc.com/shoestring.rb
################################### MAINTENANCE ######
gem 'rails3-generators', :group => 'development'
gem 'nifty-generators', :group => 'development'
@danielres
danielres / notes.sh
Created March 11, 2011 13:53
random personal notes and reminders related to my funny adventures with Heroku
# $APP=$1
# S3_KEY=$2
# S3_SECRET=$3
# S3_BUCKET=$4
# GEMS=$5
gem install heroku --no-rdoc --no-ri
refinerycms $APP --heroku -g aws-s3,refinerycms-inquiries
# ,$5
cd $APP