Skip to content

Instantly share code, notes, and snippets.

Benefits

  • Configuration is not in code
  • Easily deploy of crud apps
  • Easy scaling
  • Easily addons
  • Enforces scalable architecture

Drawbacks

@jpotts18
jpotts18 / aws_cli.sh
Created July 13, 2015 22:45
bulk upload cloudsearch data aws cli
aws cloudsearchdomain \
--endpoint-url [document endoint] \
upload-documents \
--content-type application/json \
--documents [json file]
Author
Hamilton
Jay
Jay
Jay
Jay
Hamilton
Hamilton
Hamilton
Hamilton
@jpotts18
jpotts18 / heroku.sh
Last active August 29, 2015 14:23
Heroku Config
heroku apps:create dev-limesmart
heroku addons:create cleardb
heroku addons:create flying-sphinx
heroku addons:destroy heroku-postgresql
# Adding buildpack
heroku buildpacks:set https://github.com/ddollar/heroku-buildpack-multi.git
echo "https://github.com/shunjikonishi/heroku-buildpack-ffmpeg" >> .buildpacks
echo "https://github.com/heroku/heroku-buildpack-ruby.git" >> .buildpacks
<% require "uri" %>
db_config: &db_config
<% if ENV["DATABASE_URL"].present? %>
<% uri = URI.parse(ENV["DATABASE_URL"]) if ENV["DATABASE_URL"].present? %>
username: <%= uri.user %>
password: <%= uri.password %>
host: <%= uri.host %>
<% else %>
username: root
@jpotts18
jpotts18 / circle.yml
Last active August 29, 2015 14:22
Android Continuous Integration
deployment:
alpha:
branch: alpha
commands:
- ./gradlew assembleDebug
- ./upload_to_hockeyapp.sh alpha
beta:
branch: master
commands:
- ./gradlew assembleDebug
@jpotts18
jpotts18 / build.groovy
Created May 20, 2015 16:30
Gradle Build Script Sync with Git Android
def gitSha = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim()
def commitCount = Integer.parseInt('git rev-list master --count'.execute([], project.rootDir).text.trim())
def gitCurrentTag = 'git describe --tags --abbrev=0'.execute([], project.rootDir).text.trim()
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.some.app"

Basic SQL Debugging

Use Whitespace

Can you find the syntax error?

SELECT u.id, u.name, alliance.ally FROM users u JOIN alliance ON
(u.id=alliance.userId) JOIN team ON (alliance.teamId=team.teamId
// THIS DOESN'T Come through
<%= @model %>
public class <%= 3 + 4 %> {
private int id;
private string email;
private string first;
private string lastname;
}
#!/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