This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# (Above line comes out when placing in Xcode scheme) | |
# | |
API_TOKEN=<TestFlight API token here> | |
TEAM_TOKEN=<TestFlight team token here> | |
SIGNING_IDENTITY="iPhone Distribution: Development Seed" | |
PROVISIONING_PROFILE="${HOME}/Library/MobileDevice/Provisioning Profiles/MapBox Ad Hoc.mobileprovision" | |
#LOG="/tmp/testflight.log" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template name='reservation'> | |
{{#each venues}} | |
{{> venue}} | |
{{/each}} | |
</template> | |
<template name='venue'> | |
<div class='venue'> | |
{{bambam reservation}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "bundler/setup" | |
# require your gems as usual | |
require "fog" | |
require 'fog/aws/glacier' | |
aws_access_key_id = "??" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
TIMEOUT_PERIOD=600 | |
EMAIL_ADDRESS="your@email.com" | |
# Updated to make use of timeout and email variables | |
# Also see: http://vitobotta.com/resque-automatically-kill-stuck-workers-retry-failed-jobs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# initializers/devise.rb | |
config.omniauth :facebook, [APP_ID], [APP_SECRET] | |
config.omniauth :facebook_app1, [APP_ID], [APP_SECRET], :iframe => true, :scope => 'publish_stream,offline_access,email' | |
config.omniauth :facebook_app2, [APP_ID], [APP_SECRET], :iframe => true, :scope => 'publish_stream,offline_access,email' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define( ['jquery'], function ( $ ) { | |
var token = $( 'meta[name="csrf-token"]' ).attr( 'content' ); | |
$.ajaxSetup( { | |
beforeSend: function ( xhr ) { | |
xhr.setRequestHeader( 'X-CSRF-Token', token ); | |
} | |
}); | |
return token; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>Testing Pie Chart</title> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.1.3"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?2.1.3"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?2.1.3"></script> | |
<style type="text/css"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'lograge' # more readable logs | |
gem 'logstash-event' # for logstash json format | |
gem 'mono_logger' # threadsafe logging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is an example how to perform multi-select faceting in ElasticSearch. | |
Selecting multiple values from the same facet will result in an OR filter between each of the values: | |
(facet1.value1 OR facet1.value2) | |
Faceting on more than one facet will result in an AND filter between each facet: | |
(facet1.value1 OR facet1.value2) AND (facet2.value1) | |
I have chosen to update the counts for each facet the selected value DOES NOT belong to since we are performing an AND between each facet. I have included an example that shows how to keep the counts if you don't want to do this (filter0.sh). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# An example of using ngram analysis in ElasticSearch with the Tire rubygem | |
# ========================================================================== | |
# The original, raw example: https://gist.github.com/988923 | |
require 'rubygems' | |
require 'tire' | |
require 'yajl/json_gem' | |
class URL | |
def initialize(attributes={}) |
OlderNewer