Skip to content

Instantly share code, notes, and snippets.

View GregIngelmo's full-sized avatar

Greg Ingelmo GregIngelmo

View GitHub Profile
/*jshint esversion: 6 */
const assert = require('assert');
// sugar for FlatMapper.prototype.flatMapp
class FlatMapper {
constructor() {
// do stuff
}
//
// 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>
<!--
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>
package main
import (
"crypto/rand"
"fmt"
"io"
"net"
"sync/atomic"
"time"
)
@GregIngelmo
GregIngelmo / bolt_299.go
Created February 22, 2015 23:30
Bolt #299
package main
import (
"log"
"os"
"github.com/boltdb/bolt"
)
var path = "bolt.db"
@GregIngelmo
GregIngelmo / bolt_size.go
Created February 16, 2015 22:06
bolt issue 303
package main
import (
"fmt"
"log"
"os"
"github.com/boltdb/bolt"
)
@GregIngelmo
GregIngelmo / ffmpeg.md
Last active August 29, 2015 14:06
ffmpeg commands

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 August 29, 2015 14:04
NSLayoutConstraint playground test
// 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))

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"
@GregIngelmo
GregIngelmo / ping.md
Created May 9, 2014 22:09
Ping Utils

Ping Utils

Parse ping response time

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