Skip to content

Instantly share code, notes, and snippets.

@forest
forest / google_form.js
Last active August 29, 2015 13:56
Google Forms Integration with Constant Contact API
/**
* A trigger-driven function that adds the user to Constant Contact lists.
*
* @param {Object} e The event parameter for form submission to a spreadsheet;
* see https://developers.google.com/apps-script/understanding_events
*/
function onFormSubmit(e) {
Logger.log('onFormSubmit');
try {
@forest
forest / teaching_ruby_objects_first.rb
Created May 8, 2014 18:40
Sugar-Free Ruby: An Experiment in Object-first Teaching
# http://www.confreaks.com/videos/1112-gogaruco2012-sugar-free-ruby-an-experiment-in-object-first-teaching
# https://github.com/simeonwillbanks/gogaruco2012/blob/master/02_Sugar-Free_Ruby:_An_Experiment_in_Object-first_Teaching.md
# Everything is an Object.
5 # => 5
42.0 # => 42.0
"Hello!" # => Hello!
[1, 2, 3] # => [1, 2, 3]
@forest
forest / Gemfile
Last active August 29, 2015 14:02
SauceLabs Spec Helper
gem 'sauce', group: [:development, :sauce]
group :sauce do
gem 'rspec'
gem 'rspec-instafail'
gem 'capybara'
# gem 'parallel_tests'
gem 'ci_reporter'
gem 'sauce-connect'
end
// Refer to https://gist.github.com/remy/350433
try {
// Test webstorage existence.
if (!window.localStorage || !window.sessionStorage) throw "exception";
// Test webstorage accessibility - Needed for Safari private browsing.
localStorage.setItem('storage_test', 1);
localStorage.removeItem('storage_test');
} catch(e) {
(function () {
var Storage = function (type) {
# supervisor
#
# Author: Günter Grodotzki <gunter@grodotzki.co.za>
# Version: 2015-04-25
#
# set param "SUPERVISE=enable" to activate
#
packages:
yum:
python27-setuptools: []
@forest
forest / rakefile.rb
Created January 22, 2010 17:25
Rakefile to build xcode projects in nested directory structure. #xcode
###########################################################################
# XCode Tasks
###########################################################################
XCODE_PROJECTS_CACHE = 'xcode_projects_cache.yml'
def xcode_projects
projects = []
if File.exist?(XCODE_PROJECTS_CACHE)
@forest
forest / setup-statsd.sh
Created May 23, 2011 16:36 — forked from jasonroelofs/setup-statsd.sh
Turn an Ubuntu 10.10 EC2 into a StatsD/Graphite 0.9.8 server
# install git
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
# download the Node source, compile and install it
git clone https://github.com/joyent/node.git
cd node
./configure
make
sudo make install
# install the Node package manager for later use
@forest
forest / README.markdown
Created May 2, 2012 15:15 — forked from jrust/README.markdown
Bootstrap's Typeahead plugin extended (AJAX functionality, comma-separated values, autowidth, and autoselect)

This is a fork of a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

  • Ability to disable autoselect of first matched element.
  • Ability to automatically set the width of the dropdown to that of the text input.
  • Ability to fetch source element via AJAX
  • Ability to have a comma separated list of tags.

For the proper source, and other examples, please see the original gist.

Example showing off all the above features

@forest
forest / iterations.erb
Created August 15, 2012 17:30 — forked from cbrunnkvist/iterations.erb
Pivatol Tracker Iteration View
<% iterations.each do |iteration| %>
<h2 id='Sprint_<%= iteration.number %>' style='display:inline'>Sprint <%= iteration.number %></h2><i> - ends <%= iteration.finish.strftime("%Y-%m-%d") %></i><a href='#Sprint_<%= iteration.number %>' class='anchor'>&nbsp;&para;</a>
<ul>
<% iteration.stories.each do |story| %>
<li class='story'><h3 style='display:inline'><i>Story <%= story.id %> (<%= story.current_state %>)</i></h3>
<small class='taskCount'><i><%= " - #{story.tasks.size} tasks defined" if story.respond_to?(:tasks) %></i></small>
<p class='storyDescription'><span class="storyIngress"><%= story.name%></span><br><span class="storyRest" style="color:grey"></span></p>
<% end %>
</ul>
<% end %>
@forest
forest / deliver_stories
Created November 9, 2012 18:48
A script to connect to tracker, look for finished stories, grep the git log, and mark the finished ones as delivered
#!/usr/bin/env ruby
# gem 'pivotal-tracker'
require 'pivotal-tracker'
TRACKER_TOKEN = "..."
TRACKER_PROJECT_ID = "..."
PivotalTracker::Client.token = TRACKER_TOKEN
PivotalTracker::Client.use_ssl = true