Skip to content

Instantly share code, notes, and snippets.

@noomerikal
noomerikal / Statistics.js
Created November 28, 2015 11:31
Loading Segment.io analytics.js open source version async
// Create a dummy analytics object until real loaded
window.analytics || (window.analytics = []);
window.analytics.methods = ['identify', 'track', 'trackLink', 'trackForm', 'trackClick', 'trackSubmit', 'page', 'pageview', 'ab', 'alias', 'ready', 'group', 'on', 'once', 'off'];
window.analytics.factory = function(method) {
return function() {
var args = Array.prototype.slice.call(arguments);
args.unshift(method);
window.analytics.push(args);
return window.analytics;
};
# Puma upstream
upstream puma {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response (in case the Unicorn master nukes a
# single worker for timing out).
# for UNIX domain socket setups:
server unix:/mnt/project/api/shared/tmp/sockets/puma.sock fail_timeout=0;
}
<html>
<head>
<title>Checkbox</title>
<style>
input[type=checkbox] {
display:none;
}
input[type=checkbox] + label
{
require "spec_helper"
describe ExampleController do
context "GET #index" do
let(:resources) { FactoryGirl.create_list(:resource) }
before do
get :index
end

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@noomerikal
noomerikal / S3.java
Last active August 29, 2015 14:15 — forked from abh1nav/S3.java
package com.twitsprout.sproutscore.bolts;
import java.util.HashMap;
import java.util.Map;
import com.google.common.collect.Maps;
import backtype.storm.task.OutputCollector;
import backtype.storm.task.TopologyContext;
import backtype.storm.topology.IRichBolt;
<?xml version="1.0"?>
<response>
<sports>
<sportsItem>
<name>basketball</name>
<id>40</id>
<type>points</type>
<leagues>
<leaguesItem>
<name>National Basketball Assoc.</name>
{
"sports":[
{
"name":"basketball",
"id":40,
"type":"points",
"leagues":[
{
"name":"National Basketball Assoc.",
"abbreviation":"nba",
<?xml version="1.0"?>
<response>
<sports>
<sportsItem>
<name>basketball</name>
<id>40</id>
<leagues>
<leaguesItem>
<name>National Basketball Assoc.</name>
<abbreviation>nba</abbreviation>
{
"sports":[
{
"name":"basketball",
"id":40,
"leagues":[
{
"name":"National Basketball Assoc.",
"abbreviation":"nba",
"id":46,