Skip to content

Instantly share code, notes, and snippets.

@irvifa
irvifa / 30-ipforward.conf
Created January 4, 2016 16:32
Arch linux arm conf
#/etc/sysctl.d/30-ipforward.conf
net.ipv4.ip_forward=1
net.ipv6.conf.default.forwarding=1
net.ipv6.conf.all.forwarding=1
@irvifa
irvifa / hervesine_with_midpoint.go
Last active December 27, 2015 00:28
Calculate previous known location into midpoint and calculate the hervesine distance of the midpoint and current location
package main
import (
"fmt"
"math"
)
const rEarth = 6372.8 // km
type Location struct {
@irvifa
irvifa / xrange-lua.lua
Last active December 27, 2015 00:31
xrange-lua
function xrange(from, to, step)
step = step or 1
return function(_, last)
local next = last + step
if step > 0 and next < to or step < 0 and next > to or step == 0 then
return next
end
end, nil, from - step
end
#!/bin/bash
sudo apt-get update
wget "https://rvaserver2.appspot.com/player/download?os=lnx" -O rvpiplayer.sh
sudo chmod +x rvpiplayer.sh
./rvpiplayer.sh
#clean
rm rvpiplayer.sh
#installing additional components
@irvifa
irvifa / gist:93f89605f322eee89b42
Created August 27, 2015 17:42
iconv in simple-qrcode
<?xml version="1.0" encoding="UTF-8"?> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="33px" height="33px"><defs><rect id="r0" width="1" height="1" fill="#000000"/></defs><rect x="0" y="0" width="33" height="33" fill="#fefefe"/><use x="4" y="4" xlink:href="#r0"/><use x="5" y="4" xlink:href="#r0"/><use x="6" y="4" xlink:href="#r0"/><use x="7" y="4" xlink:href="#r0"/><use x="8" y="4" xlink:href="#r0"/><use x="9" y="4" xlink:href="#r0"/><use x="10" y="4" xlink:href="#r0"/><use x="12" y="4" xlink:href="#r0"/><use x="13" y="4" xlink:href="#r0"/><use x="19" y="4" xlink:href="#r0"/><use x="20" y="4" xlink:href="#r0"/><use x="22" y="4" xlink:href="#r0"/><use x="23" y="4" xlink:href="#r0"/><use x="24" y="4" xlink:href="#r0"/><use x="25" y="4" xlink:href="#r0"/><use x="26" y="4" xlink:href="#r0"/><use x="27" y="4" xlink:href="#r0"/><use x="28" y="4" xlink:href="#r0"/><use x="4" y="5" xlink:href="#r0"/><use x="10" y="5" xlink:href="#r0"/><use x="17" y="5" xlink:hre
package weden.jason.dbaseFuncTests
import org.testng.annotations.Test
import org.scalatest.testng.TestNGSuite
import org.apache.log4j.{Logger, LogManager}
import org.squeryl.adapters.PostgreSqlAdapter
import java.util.Date
import org.squeryl.{Schema, Session}
class ScalaFunctionalTests extends TestNGSuite {

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