Skip to content

Instantly share code, notes, and snippets.

View suapapa's full-sized avatar

Homin Lee suapapa

View GitHub Profile
@suapapa
suapapa / img2rawdump.py
Created March 4, 2011 18:43
img2rawdump.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
# img2rawdump.py - dump raw date from input image
#
# Copyright (C) 2011 Homin Lee <ff4500@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@suapapa
suapapa / mp4Info.py
Created March 24, 2011 10:18
script for get container infos of mp4 video file
#!/usr/bin/python
#
# m4aInfo.py - script for get container info of mp4 video file
#
# originally written by gioshe
# part of eighttrak, http://code.google.com/p/eighttrak/
#
# This work is released under the GNU GPL, version 2 or later.
#
import struct
@suapapa
suapapa / thorn_tree.puml
Created September 19, 2011 12:01
가시나무 (시인과 촌장) -자우림 노래- 인포그래픽 (PlantUML)
@startuml
title <b>가시나무 (시인과 촌장)</b>\n노래 - 자우림
(*) --> ==== S0 ====
--> "내 속엔"
"내 속엔" --> 내가
내가 --> "너무도 많아"
@suapapa
suapapa / dnw.py
Created September 27, 2011 05:33
dnw.py - python port of dnw client, smdk-usbdl
#!/usr/bin/python
# -*- coding: utf-8 -*-
# dnw.py - python port of dnw client, smdk-usbdl
#
# Copyright (C) 2011 Homin Lee <suapapa@insignal.co.kr>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@suapapa
suapapa / Makefile
Created November 5, 2011 15:13
ramdrive to swap
install: iram-swap iram-get-devname
cp iram-get-devname /usr/bin/
cp iram-swap /etc/init.d/
ln -s /etc/init.d/iram-swap /etc/rcS.d/S15iram-swap
@echo "all done"
uninstall:
rm -f /usr/bin/iram-get-devname
rm -f /etc/init.d/iram-swap
rm -f /etc/rcS.d/S15iram-swap
@suapapa
suapapa / bideTwitterScore.py
Created January 18, 2012 03:37
SNS 역량지수 산출공식 in Python
# http://news.naver.com/main/read.nhn?mode=LSD&mid=sec&sid1=100&oid=003&aid=0004297105
def bideTwitterScore(cntFollower, cntFollowing, cntTweet, cntRetweet):
import math
scoreFollow = (math.log10((cntFollower + cntFollowing) / 1000.0)) / 10 + 1
scoreTweet = 1 + cntTweet + (cntRetweet / 100)
return scoreFollow * scoreTweet
@suapapa
suapapa / pretty_make.py
Created January 27, 2012 07:06
PrettyMake for build android
#!/usr/bin/env python
#
# Make beautifier
#
# Author : Philippe Fremy <pfremy@kde.org>
# contributions from Adrian Thurston <adriant@ragel.ca>
# Version : 1.3
# License : Do whatever you want with this program!
# Warranty : None. Me and my program are not responsible for anything in the
# world and more particularly on your computer.
@suapapa
suapapa / aa2l.py
Created April 3, 2012 02:37
Android dev: call stack dump line parser
#!/usr/bin/python
# Copyright (C) 2008 The Android Open Source Project
# License at http://www.apache.org/licenses/LICENSE-2.0
# Copyright (C) 2012 Homin Lee <suapapa@insignal.co.kr>
import os
import sys
import string
@suapapa
suapapa / MediaScannerClient.puml
Created April 12, 2012 05:04
Diagrams for MediaScannerClient of Android base framework and it's test
@startuml
"startFile()" --> ===B1===
--> "addStringTag(name, value)"
if "" then
-right->[value is ASCII] "handleStringTag()"
-down-> ===B2===
else
-down-> "push name & value to mName & mValue"
-down-> ===B2===
@suapapa
suapapa / iconv_practice.cpp
Created April 13, 2012 05:38
iconv utf8 to ucs2 example
#include <stdio.h>
#include <iconv.h>
#include <string.h>
#include <errno.h>
#include <stdint.h>
int conv_utf8_to_ucs2(const char* src, size_t len)
{
iconv_t cb = iconv_open("UTF-16", "UTF-8");
if (cb == (iconv_t)(-1))