Skip to content

Instantly share code, notes, and snippets.

@kfatehi
kfatehi / bash.sh
Created August 5, 2013 10:53
issue branching macro using ghi
##
# Use a ruby script tucked in .rubies
useruby() {
ruby ~/.rubies/$1.rb $@
}
##
# Create a new branch for an issue
branch_for() {
useruby ghi_brancher $@
@kfatehi
kfatehi / gist:6162123
Last active December 20, 2015 16:29
MDX Startup Guide
MDX Startup Guide
Establish milestone(s) to achieve freestanding business
Estimated time to achieve the milestone(s) by the company
building the application (Mindynamics Group / MDXGRP)
MDXGRP will determine its total cost to deliver the freestanding
business and report these figures back to the shareholders.
@kfatehi
kfatehi / key_to_dsl.rb
Last active December 21, 2015 00:08
KeyTo DSL rough draft
module IntroToObjects
include KeyTo::Lesson
name "Intro to Objects"
level("Make an object!") do |scene|
scene.background.image = "objects background.png"
scene.hint.text = "We can define objects using the #{code('class')} keyword, but that's not the only way!"
scene.hint.audio = "explain more.mp3"
scene.challenge = Challenge.load("...")
@kfatehi
kfatehi / gist:7312995
Created November 5, 2013 02:42
mediainfo output for a h264 mp4 video file suitable for streaming
luchia :: ~/Movies/HTML5 Capture » mediainfo movie.mp4
General
Complete name : movie.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 6.60 MiB
Duration : 35s 39ms
Overall bit rate : 1 581 Kbps
Encoded date : UTC 2013-08-08 18:10:09
@kfatehi
kfatehi / setup-ci-notes.sh
Created November 15, 2013 03:06
Headless Chromedriver CI Server Setup Notes
# Get google chrome and Xvfb
# Thanks http://www.howopensource.com/2011/10/install-google-chrome-in-ubuntu-11-10-11-04-10-10-10-04/
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
apt-get -y update
apt-get -y install xvfb google-chrome-stable
# Get chromedriver 2.6 installed and on your PATH
curl -O http://chromedriver.storage.googleapis.com/2.6/chromedriver_linux64.zip
unzip -d /usr/local/bin chromedriver_linux64.zip
@kfatehi
kfatehi / forever.log
Created November 19, 2013 18:56
Raspberry Pi NPM npm-replication-watcher output
Current disk size is 100934028105
Checking every 480 seconds
Remote disk size is 108760112246
Replication has stalled
Retriggered replication
Current disk size is 100934111367
Checking every 480 seconds
Downloading at ~0.00017903645833333332 MB/s
Remote disk size is 147241668005
Replication has stalled
@kfatehi
kfatehi / Dockerfile
Last active January 2, 2016 03:19
Dockerfile with Xvfb, Chromedriver
# Xvfb, Google Chrome, Chromedriver, Ruby, Node.js, Redis, Mongo
FROM ubuntu:12.04
MAINTAINER Keyvan Fatehi <[email protected]>
RUN apt-get update -y -q
RUN apt-get install -y -q unzip xvfb libgtk2.0-0 libnss3 libgconf-2-4
# fix https://code.google.com/p/chromium/issues/detail?id=318548
#RUN mkdir -p /usr/share/desktop-directories
@kfatehi
kfatehi / xvfb-daemon-run
Created January 6, 2014 17:02
Xvfb launcher script for insert into docker image
#!/bin/bash
export DISPLAY=:99
/etc/init.d/xvfb start
sleep 1
$@
exit_value=$?
/etc/init.d/xvfb stop
exit $exit_value
@kfatehi
kfatehi / gist:8487957
Created January 18, 2014 08:58
metadata json structure notes
{
unstructured: {
ffmbc: "Error command failed bla bla bla actual useful but unparsed data",
mediainfo: "Error command failed bla bla bla actual useful but unparsed data",
},
structured: {
mediainfo: {
"General": {
"Completename": "C:\\File.m4v",
"Format": "MPEG-4",
@kfatehi
kfatehi / afick_build_payload.sh
Last active January 4, 2016 11:19
disk diff payload via afick
afick -p > ~/before # dump the db prior to update
afick --update # update the db now
afick -p > after # dump the new db
diff before after > db_diff
cat db_diff | egrep -o "> directory .*|" > new_directories
cat db_diff | egrep -o "> file .*|" > new_files
./build_payload.rb
tar -cvpzf payload.tar.gz payload/