Skip to content

Instantly share code, notes, and snippets.

@vmx
vmx / frameio_download.sh
Last active November 20, 2023 21:53
Download videos from Frame.io
#!/bin/sh
if [ "${#}" -eq 0 ]; then
echo "Usage: $(basename "${0}") frame.io-URL"
exit 1
fi
PAGE_URL=${1}
CURL_COMMAND=$(echo "${PAGE_URL}"|tr '/' ' '|awk '{ print "curl --silent -H x-review-link-id:" $4 " https://api.frame.io/v2/assets/" $5 }')
METADATA=$(${CURL_COMMAND})
@moocowmoo
moocowmoo / dashrpc.py
Last active October 9, 2018 23:53
calculate your masternode queue position
import io
import os
from bitcoinrpc.authproxy import AuthServiceProxy
def ParseConfig(fileBuffer):
assert type(fileBuffer) is type(b'')
f = io.StringIO(fileBuffer.decode('ascii', errors='ignore'), newline=None)
result = {}
for line in f:
@seanmckaybeck
seanmckaybeck / remote_servo.ino
Last active June 7, 2018 07:45
Remote control servo with Particle Photon. Apache License, copyright 2015 Sean Beck
Servo serv;
int pos = 0;
void setup() {
serv.attach(D0);
Spark.function("setpos", setPos);
Spark.variable("getpos", &pos, INT);
}
void loop() {
@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite