Skip to content

Instantly share code, notes, and snippets.

View KonradIT's full-sized avatar

Konrad Iturbe KonradIT

View GitHub Profile
@rbochet
rbochet / UnixPipeActivity.java
Created May 18, 2011 03:45
How to write in pipes for Android
package fr.stackr.android.upt;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
@defunkt
defunkt / gitio
Created September 11, 2011 08:11
Turn a github.com URL into a git.io URL.
#!/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.
url = ARGV[0]
code = ARGV[1]
@shurizzle
shurizzle / gist:1223923
Created September 17, 2011 13:14
Turn a github.com URL into a git.io URL.
#!/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'
@douglas
douglas / update_git_repos.sh
Created October 14, 2011 15:04
Update all git repositories under a base directory
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n"
# Find all git repositories and update it to the master latest revision
for i in $(find . -name ".git" | cut -c 3-); do
@qihnus
qihnus / RecorderService.java
Created February 25, 2012 17:23
a minimalist example of Android accessibility service
import android.accessibilityservice.AccessibilityService;
import android.accessibilityservice.AccessibilityServiceInfo;
import android.util.Log;
import android.view.accessibility.AccessibilityEvent;
public class RecorderService extends AccessibilityService {
static final String TAG = "RecorderService";
private String getEventType(AccessibilityEvent event) {
@nezza
nezza / gist:2394361
Created April 15, 2012 19:07
Extractor for GoPro camera firmwares.
/* This tool extracts the sections of a supplied GoPro
* firmware image.
*
* It creates the following files in the current directory:
* bst.bin, bld.bin, pri.bin, rom.bin, dsp.bin
*
* It also shows the expected CRC32 checksum of the section and shows
* where it will be written on the device, you can use this address as
* ROM address and load address in IDA Pro.
*
@Knio
Knio / encode.sh
Created September 27, 2012 05:13
Resize GOPRO images
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
@markusfisch
markusfisch / tweet.sh
Last active March 25, 2016 10:54
Shell script to tweet from the command line. Breaks longer messages into multiple tweets. Requires curl.
#!/usr/bin/env bash
# Post a tweet
#
# @param ... - tweet
tweet()
{
# Make a SSL request
#
# @param ... - request arguments
@shreeshga
shreeshga / Utilities.java
Last active July 8, 2018 11:32
Android setSringSet() / getStringSet() with compatibility
public static void setPersistentObjectSet(Context context, String key, String o) {
if (initStore(context)) {
synchronized (_store) {
SharedPreferences.Editor editor = _store.edit();
if (o == null) {
editor.remove(key);
} else {
Set<String> vals = null;
if (VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
vals = _store.getStringSet(key, null);
@thearn
thearn / opencv-python-ipcam.py
Last active January 12, 2023 17:01
python-opencv ip camera example
import base64
import time
import urllib2
import cv2
import numpy as np
"""
Examples of objects for image frame aquisition from both IP and