Skip to content

Instantly share code, notes, and snippets.

View dannguyen's full-sized avatar
💭
havin a normal one

Dan Nguyen dannguyen

💭
havin a normal one
View GitHub Profile
@dannguyen
dannguyen / padrinosetup.sh
Last active October 13, 2015 02:38
Padrino setup
padrino g project someproj -t minitest -e erb -d mongoid -m rr -s jquery -c sass -b
padrino g project foo_proj -t minitest -e erb -d activerecord -m rr -s jquery -c scss -a sqlite -b
@dannguyen
dannguyen / escher.py
Created December 14, 2012 01:20 — forked from lecram/escher.py
Just typo fixing
#! /usr/bin/env python
"""{escher} -- one-file key-value storage.
What?
This is a toy application to manage persistent key-value string data.
The file {escher} is *both* the application and its data.
When you run any of the commands below, the file will be executed and,
after data change, it will rewrite itself with updated data.
You can copy the file with whatever name to create multiple datasets.
@dannguyen
dannguyen / coffee.sh
Last active December 14, 2015 10:48
Setting up my computers for coffee
# remove current npm
npm uninstall npm -g
brew uninstall node
# install latest node
brew install node
## install coffeescript
npm install -g coffee-script
@dannguyen
dannguyen / rake-task-padrino-choose-env.sh
Created April 2, 2013 22:05
Because I always forget how to reset the right database with rake
padrino rake ar:schema:load -e test
@dannguyen
dannguyen / EC2-ruby-setup.md
Last active December 16, 2015 08:29
Setting up EC2 ruby 1.9.3
@dannguyen
dannguyen / aws-write-to-s3-acl.rb
Created April 17, 2013 18:06
Using Ruby AWS-SDK to write an object to S3 and set its ACL
#!/usr/bin/ruby
require 'rubygems'
require 'aws-sdk'
#creates an interface object to AWS S3
AWS.config( :access_key_id => '' , :secret_access_key => '' )
#creates an interface to the S3
s3interface = AWS::S3.new
@dannguyen
dannguyen / bash-config.sh
Created April 17, 2013 20:23
Some useful scripts to configure bash with
# Create ~/.inputrc and fill it with this:
# https://coderwall.com/p/oqtj8w
# This allows you to search through your history using the up and down arrows … i.e. type "cd /" and press the up arrow and you'll search through everything in your history that starts with "cd /".
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on
@dannguyen
dannguyen / ec2-centos-ruby-rvm-nginx-passenger.md
Last active November 27, 2023 15:43
Setting up Ruby 1.9.3 stable, RVM, nginx, passenger on Amazon Linux AMI (CentOS)

Ruby 1.9.3 stable, RVM, nginx, passenger on Amazon Linux AMI (CentOS, 03-2013)

This combines the instructions on a few different tutorials:

@dannguyen
dannguyen / centos-nginx.sh
Last active December 16, 2015 09:49
This is a nginx initialization script for CentOS that slightly modifies this template from Slicehost to use nginx's default install paths: http://articles.slicehost.com/2009/2/2/centos-adding-an-nginx-init-script
#!/bin/sh
#
# used in https://gist.github.com/dannguyen/5415628 for CentOS
# modification of: http://articles.slicehost.com/2009/2/2/centos-adding-an-nginx-init-script
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
@dannguyen
dannguyen / yeoman-node-etc.sh
Last active December 16, 2015 15:29
Setting up yeoman on my several confusing laptops
# make sure Homebrew is ready
brew update
# this upgrades both node and npm
brew upgrade node
# install packages
npm install
# (optional) coffeescript for textmate