Skip to content

Instantly share code, notes, and snippets.

View flatmap_test.js
/*jshint esversion: 6 */
const assert = require('assert');
// sugar for FlatMapper.prototype.flatMapp
class FlatMapper {
constructor() {
// do stuff
}
View AVPlayerCaching.m
//
// ViewController.m
// AVPlayerCaching
//
// Created by Anurag Mishra on 5/19/14.
// Sample code to demonstrate how to cache a remote audio file while streaming it with AVPlayer
//
#import "ViewController.h"
#import <AVFoundation/AVFoundation.h>
View video_preview.html
<!--
Tutorial code for: http://www.binpress.com/tutorial/generating-nice-movie-previews-with-ffmpeg/138
-->
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
</head>
<body>
<a href="https://www.youtube.com/watch?v=v1uyQZNg2vE" target="_blank" class="video-preview" data-frames="100" data-source="http://i.imgur.com/BX0pV4J.jpg"></a>
View uuid_time_precision_test.go
package main
import (
"crypto/rand"
"fmt"
"io"
"net"
"sync/atomic"
"time"
)
View bolt_299.go
package main
import (
"log"
"os"
"github.com/boltdb/bolt"
)
var path = "bolt.db"
View bolt_size.go
package main
import (
"fmt"
"log"
"os"
"github.com/boltdb/bolt"
)
@GregIngelmo
GregIngelmo / ffmpeg.md
Last active Aug 29, 2015
ffmpeg commands
View ffmpeg.md

ffmpeg commands

Rotate all videos in current directory 90 degrees and remove rotate metadata that's used by iOS & Quicktime.

find *.mp4 | xargs -I {} ffmpeg -i "{}" -v 0 -vf "transpose=1" -qscale 0 -y -metadata:s:v:0 "rotate=0" "rotated/{}"

Print the width, height and filename for every video in the current directory

@GregIngelmo
GregIngelmo / nslayoutconstraint_test.swift
Last active Aug 29, 2015
NSLayoutConstraint playground test
View nslayoutconstraint_test.swift
// how to programatically create NSLayoutConstraints inside a playground
import UIKit
let viewFrame = CGRect(x: 0, y: 0, width: 640, height: 750)
let view = UIView(frame: viewFrame)
view.backgroundColor = UIColor.greenColor()
// initially the subView will obscure the entire view
let subView = UIVisualEffectView(effect: UIBlurEffect(style: UIBlurEffectStyle.Dark))
View influxdb.md

Influx db

Execute a qeury via curl

http get "http://localhost:8086/db/test/series?u=root&p=root&q=select first(docCount) from /yahoo.search_ssb_customer.app.pyc_referralanalytics.search/ group by time(1d) where time > now() -48h"
View ping.md

Ping Utils

Parse ping response time

brew install fping
fping -c 1 google.com 2&>1| head -n1 | cut -d "(" -f2 | cut -d " " -f1