This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Env to help ffmpeg to convert the raw stream to desirable framerate | |
FRAMERATE=${FRAMERATE:-15} | |
# Env to route converted video to new base prefix | |
CONVERSION_PATH=${CONVERSION_PATH:-motion_videos_converted} | |
# Env param to control which output you want.. ie 'mp4' for browser baseed video | |
CONVERSION_FORMAT=${CONVERSION_FORMAT:-mkv} | |
function handler () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import sys | |
with open(sys.argv[1]) as csvfile: | |
reader = csv.reader(csvfile) | |
rows = list(reader) | |
headers = rows[0][2:] | |
answers = rows[1:] | |
for answer in answers: | |
content = answer[2:] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
browser | |
config | |
user-agent "Mozilla/5.0" | |
follow-redirects "true" | |
keep-alive "true" | |
instructions | |
[homepage] | |
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val Dollar = """\$\s*(\d+\.\d+)\s*""".r | |
import Dollar.{ findFirstMatchIn => line } | |
import io.Source.{ fromFile => open} | |
val sum = (0.00 /: open("expenses.txt").getLines)(_ + line(_).map(_.group(1).toDouble).getOrElse(0.0)) | |
println("Total is: $%.2f" format sum) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.io.Source.{fromFile => open} | |
import scala.sys.process._ | |
if (args.length < 1) { | |
println("Give me an existing .gitmodules file to copy") | |
exit(0) | |
} | |
val Submodule = """\[submodule "(.*)"\]""".r | |
val Url = """\s+url = (.*)""".r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo Removing .git directories in the submodules | |
cat .git/config | grep submodule | sed 's/\[submodule \"\(.*\)"\]/\1/' | xargs find | grep "./.git$" | xargs rm -r | |
echo Removing .git cached | |
cat .git/config | grep submodule | sed 's/\[submodule \"\(.*\)"\]/\1/' | xargs git rm --cached | |
echo Remove submodule entries from .gitmodules | |
git rm .gitmodules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (args.length < 1) { | |
println("Please provide a date, in the form of year-month. ie: 11-08") | |
} | |
import java.net.URL | |
import java.io._ | |
def read(in: InputStream, out: OutputStream) { | |
val buf = new Array[Byte](1024) | |
in read(buf) match { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sbt._ | |
import Keys._ | |
import AndroidKeys._ | |
// General object adds all modular android settings appropriately | |
object General { | |
val settings = Defaults.defaultSettings ++ Seq ( | |
version := "0.1.0", | |
organization := "my.android.project" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sbt 0.10 parent project definition | |
import sbt._ | |
imoprt Keys._ | |
object General { | |
val settings = Defaults.defaultSettings ++ Nicol.engineSettings ++ Seq ( | |
organization := "com.github.scan", | |
version := "0.1.0.1", |