Skip to content

Instantly share code, notes, and snippets.

View adamlutz's full-sized avatar

Adam Lutz adamlutz

View GitHub Profile
@adamlutz
adamlutz / BMTNContext.php
Last active August 29, 2015 14:00
a simple static class example to set context using cookies.
<?php
final class BMTNContext {
const COOKIE_NAME = 'bmtn_context';
private function __construct()
{
return FALSE;
[user]
name = Adam Lutz
email = nerp
[core]
excludesfile = /Users/alutz/.gitignore
[heroku]
[push]
default = simple
[heroku]
account = gokart
@adamlutz
adamlutz / GIT cheatsheet
Last active August 29, 2015 14:09
GIT cheatsheet
# delete all remote origin branches that have been merged into master
git b -r --merged master | grep -v master | sed 's/origin\//:/' | xargs -n 1 git push origin
# delete all local branches merged into master
git branch --merged master | grep -v master | xargs git branch -d
@adamlutz
adamlutz / gist:c21369a09a20ed7c6cca
Created February 3, 2015 15:17
auth auto migration
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('communication', '0008_merge'),
('auth', '0001_initial'),
@adamlutz
adamlutz / github-issues-csv-export.rb
Created October 28, 2015 21:25
github-issues-csv-export.rb
require 'octokit'
require 'csv'
require 'date'
# Github credentials to access your private project
USERNAME="name"
PASSWORD="sekret"
# Project you want to export issues from
USER="gokart"
PROJECT="mayo-rx"
install meteor
deploy app to meteor cloud
$ meteor build ~/Meteor/ \
--server=lutz.meteor.com
install android studio: http://developer.android.com/sdk/installing/index.html?pkg=studio
start new project + create AVD from API 22.
$ brew install android-platform-tools
$ meteor add-platform android
function debug_string_backtrace() {
$output = '';
$backtrace = debug_backtrace();
foreach($backtrace as $key => $item) {
$output .= "\r\n item $key ".$item['file']." [".$item['line']."] ".$item['function'];
}
return $output;
}
@adamlutz
adamlutz / sublime.config
Last active January 4, 2016 17:24
sublime config
{
"ensure_newline_at_eof_on_save": true,
"ignored_packages":
[
"Vintage"
],
"trim_trailing_white_space_on_save": true,
"tab_size": 2,
"translate_tabs_to_spaces": true,
}
@adamlutz
adamlutz / gist:87754551ba05dba5a31e
Created October 12, 2015 14:52
rails vagrant postgres scotchbox
Clone Scotch Box git@github.com:scotch-io/scotch-box.git
Clone project into public
ssh into server install
sudo apt-get install libpq-dev
go into psql
sudo -u postgres psql
create vagrant user
CREATE USER vagrant WITH SUPERUSER;
bind rails server to scotchbox ip
rails server -b 192.168.33.10
@adamlutz
adamlutz / postgres rails config fix
Last active May 15, 2016 18:22
postgres rails config fix for postgres.app
gem install pg -v '0.18.4' -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/latest/bin/pg_config