Skip to content

Instantly share code, notes, and snippets.

View ActiveRecord Cheat Sheet v1.md

ActiveRecord cheat sheet / EXAMPLES

INSTALL

$ gem install activerecord in GEMFILE: gem ‘activerecord’

REQUIRE

require ‘active_record’

View multisearch.go
package main
import (
"bytes"
"compress/gzip"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
View deis dump
Total 54 (delta 6), reused 52 (delta 6)
-----> Go app detected
-----> Installing go1.2... done
-----> Running: godep go install -tags heroku ./...
-----> Discovering process types
Procfile declares types -> web
-----> Compiled slug size is 1.9M
-----> Building Docker image
remote: Sending build context to Docker daemon 2.079 MB
View Create_Iframe_Index_M3U8.bash
#!/bin/bash
# Create an Iframe index from HLS segmented streams
# $1: Filename to be created
# $2: Location of segmented ts files
# Check how many arguments
if [ $# != 2 ]; then
echo "Usage: $0 [Input filename] [Location of segmented streams]"
exit 1;
fi
View gist:a0272ad53497f8ecfab8
# _/Users/fabrizio/workspace/stackoverflow
./struct_test.go:19: &Country literal escapes to heap
./struct_test.go:13: BenchmarkMapPointer b does not escape
./struct_test.go:15: BenchmarkMapPointer make(map[string]*Country, 0) does not escape
./struct_test.go:32: BenchmarkMapNoPointer b does not escape
./struct_test.go:34: BenchmarkMapNoPointer make(map[string]Country, 0) does not escape
./struct_test.go:63: &BigCountry literal escapes to heap
./struct_test.go:57: BenchmarkMapBigStructPointer b does not escape
./struct_test.go:59: BenchmarkMapBigStructPointer make(map[string]*BigCountry, 0) does not escape
./struct_test.go:76: BenchmarkMapBigStructNoPointer b does not escape
View context_example.go
// Default HTTP handler
type Handler func(ctx *Context, w http.ResponseWriter, r *http.Request) error
// ServeHTTP implements http.Handler for our custom type Handler
func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
ctx = NewContext(r)
defer ctx.Cancel()
err := h(ctx, w, r)
@Mistobaan
Mistobaan / competition.md
Created Aug 31, 2015
Startup Competition Italia
View competition.md

Startup Competition Italia

View operation-ios-sep-3-2015.md

Warehouse Operations-iOS

API CALLS

Login

POST /v2/warehouse/login HTTP/1.1
Host: api.therealreal.com
View FBAnimationPerformanceTracker.h
/*
* This is an example provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
* Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
View DownloadAllNumbers.txt
12 17 26 43 48 24
5 7 24 31 39 7
2 3 13 16 35 27
44 45 47 50 51 8
10 16 18 29 45 19
17 22 30 46 56 16
18 21 25 28 29 16
2 22 32 45 56 12
4 12 14 21 55 7
6 8 43 48 50 7