Clone repo:
git clone git://github.com/maccman/juggernaut.git
cd juggernaut
Create Heroku app:
heroku create myapp --stack cedar
heroku addons:add redistogo:nano
git push heroku master
#!/usr/bin/env bash | |
# A script for fixing disabled Mail.app bundles due to SupportedPluginCompatibilityUUIDs | |
# Author: Jaeho Shin <[email protected]> | |
# Created: 2011-03-24 | |
# See-Also: http://stib.posterous.com/how-to-fix-unsupported-plugins-after-upgradin | |
set -eu | |
newMailUUID=$(defaults read /Applications/Mail.app/Contents/Info PluginCompatibilityUUID) | |
newMsgUUID=$(defaults read /System/Library/Frameworks/Message.framework/Resources/Info PluginCompatibilityUUID) |
$ git branch -r --merged | | |
grep origin | | |
grep -v '>' | | |
grep -v master | | |
xargs -L1 | | |
awk '{split($0,a,"/"); print a[2]}' | | |
xargs git push origin --delete |
#!/bin/bash | |
# This script automatically sets the version and short version string of | |
# an Xcode project from the Git repository containing the project. | |
# | |
# To use this script in Xcode 4, add the contents to a "Run Script" build | |
# phase for your application target. | |
set -o errexit | |
set -o nounset |
Clone repo:
git clone git://github.com/maccman/juggernaut.git
cd juggernaut
Create Heroku app:
heroku create myapp --stack cedar
heroku addons:add redistogo:nano
git push heroku master
# Nginx+Unicorn best-practices congifuration guide. Heartbleed fixed. | |
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies. | |
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module | |
# | |
# Deployment structure | |
# | |
# SERVER: | |
# /etc/init.d/nginx (1. nginx) | |
# /home/app/public_html/app_production/current (Capistrano directory) | |
# |
# Git pre-commit hook to check all staged Ruby (*.rb/haml/coffee) files | |
# for Pry binding references | |
# | |
# Installation | |
# | |
# ln -s /path/to/pre-commit.sh /path/to/project/.git/hooks/pre-commit | |
# | |
# Based on | |
# | |
# http://codeinthehole.com/writing/tips-for-using-a-git-pre-commit-hook/ |
I'm hunting for the best solution on how to handle keeping large sets of DB records "sorted" in a performant manner.
Most of us have work on projects at some point where we have needed to have ordered lists of objects. Whether it be a to-do list sorted by priority, or a list of documents that a user can sort in whatever order they want.
A traditional approach for this on a Rails project is to use something like the acts_as_list
gem, or something similar. These systems typically add some sort of "postion" or "sort order" column to each record, which is then used when querying out the records in a traditional order by position
SQL query.
This approach seems to work fine for smaller datasets, but can be hard to manage on large data sets with hundreds (or thousands) of records needing to be sorted. Changing the sort position of even a single object will require updating every single record in the database that is in the same sort group. This requires potentially thousands of wri
In August 2007 a hacker found a way to expose the PHP source code on facebook.com. He retrieved two files and then emailed them to me, and I wrote about the issue:
http://techcrunch.com/2007/08/11/facebook-source-code-leaked/
It became a big deal:
http://www.techmeme.com/070812/p1#a070812p1
The two files are index.php (the homepage) and search.php (the search page)
Sometimes you want to use a gem on Heroku that is in a private repository on GitHub.
Using git over http you can authenticate to GitHub using basic authentication. However, we don't want to embed usernames and passwords in Gemfiles. Instead, we can use authentication tokens.
First you will need to get an OAuth Token from GitHub using your own username and "note"
One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.
Most workflows make the following compromises:
Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure
flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.
Use production SSL certificates locally. This is annoying