Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am code2k on github.
  • I am code2klabs (https://keybase.io/code2klabs) on keybase.
  • I have a public key ASCOEyqVvC5kvNwCaK_oRxsZXs25L2K1jtV24Ym_VvCC2wo

To claim this, I am signing this object:

@code2k
code2k / twitter-cleanup.sh
Created January 7, 2015 20:15
This script will cleanup your following list on Twitter. https://sferik.github.io/t/ needs to be installed.
#!/usr/bin/env bash
#
set -o nounset
set -o errexit
KEEPFILE=`mktemp /tmp/$(basename $0).XXXXXX`
KEEPLIST='Reading'
# create list with people who should not be removed in any case:
t list members $KEEPLIST | sed 's/ /\n/g' | sort -f > $KEEPFILE
@code2k
code2k / convertOM2OSXTags.sh
Created October 23, 2013 18:48
This script converts OpenMeta to OS X Mavericks tags.
#!/bin/bash
#
# This script converts OpenMeta to OS X Mavericks tags.
#
# http://code2k.net
#
# Copyright © 2013 CODE2K:LABS. All Rights Reserved.
mdfind "kMDItemOMUserTags == *" | while IFS= read -r file; do
echo "$file"
@code2k
code2k / gist:2895434
Created June 8, 2012 12:48
logcat video camera GT-I9001 cm 7.2
/ActivityManager( 201): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.camera/.Camera bnds=[125,416][235,534] } from pid 1794
I/ActivityManager( 201): Start proc com.android.camera for activity com.android.camera/.Camera: pid=13472 uid=10032 gids={1006, 1015}
I/WindowManager( 201): Setting rotation to 1, animFlags=1
I/ActivityManager( 201): Config changed: { scale=1.0 imsi=262/3 loc=en_US touch=3 keys=1/1/2 nav=1/1 orien=2 layout=34 uiMode=17 seq=35 themeResource=null}
I/ActivityManager( 201): Starting: Intent { act=android.media.action.VIDEO_CAMERA flg=0x6000000 cmp=com.android.camera/.VideoCamera } from pid 13472
I/ActivityManager( 201): Starting: Intent { act=android.media.action.STILL_IMAGE_CAMERA flg=0x6000000 cmp=com.android.camera/.Camera } from pid 13472
E/AndroidRuntime(13472): FATAL EXCEPTION: Thread-17
E/AndroidRuntime(13472): java.lang.NullPointerException
E/AndroidRuntime(13472): at com.android.camera.CameraSettings.s
@code2k
code2k / deps.rb
Created June 2, 2012 15:16
Print dependency graph for libcamera.so
#!/usr/bin/env ruby
def get_dependencies(library, indent)
if !library.match(/^\w.*\.so$/) || library.match(/^libstdc\+\+.so$/) ||
library.match(/^libc.so$/) || library.match(/^libdl.so$/) || indent == 4
return
end
for i in 0..indent-1
print(" ")
end