Skip to content

Instantly share code, notes, and snippets.

@shanesveller
shanesveller / gist:44413
Created January 7, 2009 20:45 — forked from anonymous/gist:44410
Basecamp-style subdomains with Rails in 3 easy steps, courtesy of DHH
# 1) Point *.example.com in your DNS setup to your server.
#
# 2) Setup an Apache vhost to catch the star pointer:
#
# <VirtualHost *:80>
# ServerName *.example.com
# </VirtualHost>
#
# 3) Set the current account from the subdomain
class ApplicationController < ActionController::Base
@sr75
sr75 / centos6-barebones-vps-rails-server-walkthrough
Last active October 2, 2015 12:38
centos6-barebones-vps-rails-server-walkthrough (rvm, nginx, mysql, memcached)
# CentOS 6.4 barebones walkthrough guide for a new vps rails server instance
# assumes you already have a personal ssh key locally
#
# script implements the following security approaches:
# disables root login
# configures ssh setup for deployer user
# opens up standard ports
#
# setup includes:
# rvm & ruby-1.9.3-p429
@sr75
sr75 / Gemfile
Created July 25, 2012 01:36 — forked from flomotlik/Gemfile
Unicorn config for cedar stack on Heroku.
gem 'unicorn'
@sr75
sr75 / code-style-guides.md
Last active December 24, 2015 14:09
(Google/jQuery) HTML/CSS & JavaScript Code Style guides links:
@cmaitchison
cmaitchison / chef_solo_bootstrap.sh
Created August 17, 2012 09:45
CentOS 6.3 Chef-Solo bootstrap (RackSpace)
#!/bin/bash -xe
#THIS SCRIPT MUST BE RUN AS ROOT
ADMIN_USER=admin
ADMIN_GROUP=admin
#add admin group
(cat /etc/group | grep -E '\b$ADMIN_GROUP\b') || sudo groupadd $ADMIN_GROUP
@vgrichina
vgrichina / SQLServerDialect.java
Created November 3, 2009 22:51
Improved MSSQL dialect for Hibernate (using more appropriate data types)
/*
* Copyright © 2009, Componentix. All rights reserved.
*/
package com.componentix.hibernate.dialect;
import java.sql.Types;
/**
* A proper dialect for Microsoft SQL Server 2000 and 2005.
@sr75
sr75 / bash_profile
Last active June 8, 2018 03:34
Nice simple bash_profile & bashrc for rbenv/python/node/sublime/brew & bash completion terminal setup with colors on osx mavericks
# rbenv & brew git/bash completion terminal setup
# for dev desktop only on osx
# Run the following commands in order to use this script:
################################################################
# !! => Update/Install xcode Command Line Tools <= !!
# In your shell/terminal:
# Homebrew perms needed:
# sudo chown -R root:admin /usr/local
# sudo chown -R root:admin /Library/Caches/Homebrew
# ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@sr75
sr75 / .gitconfig
Last active October 24, 2019 21:17
gitconfig for git v1.8+ with terminal color and command aliases
[user]
name = yourname
email = yourname @ whatever
[core]
excludesfile = yourhomedir/.gitignore
#git config --global core.eol lf
#git config --global core.autocrlf input
eol = lf
autocrlf = input
#git rm -rf --cached .
@sr75
sr75 / osx-homebrew-setup.md
Last active June 18, 2020 06:35
Mac Yosemite OSX - Homebrew (RVM/MySQL/Redis) setup

Mac Homebrew (RVM/MySQL/Redis) setup

Follow the steps below to setup a local development environment:

XQuartz

Recommended to download latest XQuartz

iTerm2

@amosshapira
amosshapira / get-all-s3-prefix-lists
Created December 2, 2015 03:54
Fetch the S3 prefix list ID's for S3 in all AWS regions. These are can then be used as destinations in route tables
#!/bin/bash
# Fetch the S3 prefix list ID's for S3 in all AWS regions.
# These are can then be used as destinations in route tables
aws ec2 describe-regions --query 'Regions[*].RegionName' | \
jq -r '.[]' | \
while read REGION
do
echo ==== $REGION ====