Skip to content

Instantly share code, notes, and snippets.

@hihihippp
hihihippp / ts-angular-boilerplate.sh
Created January 22, 2016 12:51 — forked from Quramy/ts-angular-boilerplate.sh
Angular2 TypeScript boilerplate
#!/bin/sh
APP_NAME=$1
[ -z "$APP_NAME" ] && echo "1 args required" && exit 1
[ -d "$APP_NAME" ] && echo "$APP_NAME exists" && exit 1
which tsc || npm install -g typescript
which browser-sync || npm install -g browser-sync
which watchify || npm install -g watchify
@hihihippp
hihihippp / gist:de675119ea291d24693c
Created January 18, 2016 06:48 — forked from rorito/gist:b6d92548f0ff1770e447
Tribute Video Editor requirements

Tribute Video Editor Project

Description

Tribute makes it easy for friends and family to create meaningful video montages that are given as gifts on important occasions. We feel like sharing your love and admiration is one of the most meaningful gifts that you can give or receive.

A key part of this process is having a very easy to user video editor. We don't need to re-create Final Cut Pro or even iMovie, what we need is a simple user experience so that people (especially those with low technical literacy) can easily combine these individual Tributes into a cohesive, nicely produced video gift.

Current Solution

We use a third party embeddable video editor from Stupeflix (https://developer.stupeflix.com/tasks/factory.video/). While there are a lot of features we like about it, the more control we have over our core technology and infrastructure, the better experience we'll be able to build for our users.

# -*- coding: utf-8 -*-
"""
Created on Fri Jun 15 14:00:29 2012
Author: Josef Perktold
License: MIT, BSD-3 (for statsmodels)
http://en.wikipedia.org/wiki/Distance_correlation
Yaroslav and Satrajit on sklearn mailing list
require "awesome_print"
module XmlParsing
require "ox"
class Reader < ::Ox::Sax
def initialize file_path, target, target_handler
@target_handler = target_handler
@target = target
@file_path = file_path
# USAGE: Hash.from_xml:(YOUR_XML_STRING)
require 'nokogiri'
# modified from http://stackoverflow.com/questions/1230741/convert-a-nokogiri-document-to-a-ruby-hash/1231297#1231297
class Hash
class << self
def from_xml(xml_io)
begin
result = Nokogiri::XML(xml_io)
return { result.root.name.to_sym => xml_node_to_hash(result.root)}
# Tested in Ruby 1.8.7
class ParentClass
def call_private_good
# Private methods can only be called without an explicit receiver
private_test
end
def call_private_bad
# Calling a private method with an explicit receiver (self) will fail

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

Google Speech To Text API

Base URL: https://www.google.com/speech-api/v1/recognize
It accepts POST requests with voice file encoded in FLAC format, and query parameters for control.

Query Parameters

client
The client's name you're connecting from. For spoofing purposes, let's use chromium

lang
Speech language, for example, ar-QA for Qatari Arabic, or en-US for U.S. English

import base64
import struct
from io import BytesIO
import wave
import numpy as np
from IPython.core.display import DisplayObject
class Sound(DisplayObject):
"""Create a WAV object given raw data.