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
#!/usr/bin/env ruby | |
# Usage: gitio URL [CODE] | |
# | |
# Turns a github.com URL | |
# into a git.io URL | |
# | |
# Copies the git.io URL to your clipboard. | |
require 'net/http' | |
require 'clipboard' |
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
dir=${1-.} | |
fps=${2-48} | |
if [ ! -s times.sub ] | |
then | |
find . -path "*/$dir/???GOPRO/GOPR????.JPG" -printf '%p\n' | sort | python `dirname $0`/subs.py > times.sub | |
fi | |
mplayer "mf://$dir/???GOPRO/GOPR????.JPG" -mf w=1920:h=1080:fps=$fps:type=jpg -ao null -benchmark -vo yuv4mpeg:file=>(x264 --demuxer y4m --crf 21 --preset fast --muxer mkv --output GOPRO.MKV -) -vf scale=1920:-3,flip,mirror,crop=1920:1080:0:0,pp=al -sub times.sub |
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
pi@raspberrypi ~/public_html/gopro $ cat take_picture_and_send.sh | |
#!/bin/bash | |
## volume 100% | |
curl "http://10.5.5.9/camera/BS?t=goprohero&p=%02" | |
sleep 1 | |
## mode to photo | |
curl "http://10.5.5.9/camera/CM?t=goprohero&p=%01" | |
sleep 1 | |
## take picture | |
curl "http://10.5.5.9/bacpac/SH?t=goprohero&p=%01" |
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
int notificationId = 001; | |
// Create a WearableExtender to add functionality for wearables | |
NotificationCompat.WearableExtender wearableExtender = | |
new NotificationCompat.WearableExtender() | |
.setBackground(bigBitmap); | |
// Build the notification | |
NotificationCompat.Builder notificationBuilder = | |
new NotificationCompat.Builder(this) |
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
# Create a directory where to move your renamed photos | |
mkdir img | |
# Rename your first G0....JPG photos in img/img000001.JPG and so on | |
x=1;for i in G0*JPG; do counter=$(printf %06d $x); ln "$i" img/img"$counter".jpg; x=$(($x+1)); done | |
# Rotate photos if needed | |
cd img | |
for file in *.jpg; do convert $file -rotate 180 rotated-$file; done |
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
#!/usr/bin/env bash | |
# Post a tweet | |
# | |
# @param ... - tweet | |
tweet() | |
{ | |
# Make a SSL request | |
# | |
# @param ... - request arguments |
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
var request = require('request'); | |
var https = require('https'); | |
var fs = require('fs'); | |
var URL = 'https://sdk.getpebble.com/v1/files/sdk-core'; | |
var OUTPUT_DIR = './sdks'; | |
if(!fs.existsSync(OUTPUT_DIR)){ | |
fs.mkdirSync(OUTPUT_DIR); | |
} |
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 java.net.Socket; | |
import java.io.BufferedReader; | |
import java.io.BufferedWriter; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.OutputStream; | |
import java.io.OutputStreamWriter; | |
void setup() { | |
thread("keepAlive"); |
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
#!/usr/bin/env python | |
import urllib | |
from urllib import urlencode | |
import urllib2 | |
from time import sleep | |
import os | |
from subprocess import Popen, PIPE | |
import Image | |
from cStringIO import StringIO | |
import signal |
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 | |
# | |
# stabilize.sh | |
# | |
fullfile=$(readlink -f $1) | |
dir_name=$(dirname $fullfile) | |
filename=$(basename $fullfile) | |
file_no_ext=${filename%.*} | |
extension="${filename##*.}" |
OlderNewer