Skip to content

Instantly share code, notes, and snippets.

View chitacan's full-sized avatar

Bret Kim chitacan

View GitHub Profile
@chitacan
chitacan / domain-socket.js
Last active August 29, 2015 14:01
short script to request android chrome's tab info via adb.
// Before run this script, you should connect your android device on your machine.
var net = require('net');
var cmds = [
{
cmd : 'host:transport-any',
expect : function(res) {
return 'OKAY' === res;
}
},
{
@chitacan
chitacan / README.md
Last active August 29, 2015 14:03
activity stack visualizer.

Visualize adb shell dumpsys activity activities result with D3's tree layout. Based on activitykit. You can see preview here

This example demonstrates how to compute the height h of a circular segment given the fraction k of the circle’s area that should be covered by the segment. For example, for values of k 0, 0.5 and 1, the value of h is k. For other values, h is computed numerically via Newton’s method; I am unaware of an analytical solution to this problem.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
svg {
font: 10px sans-serif;
}
@chitacan
chitacan / diagonal.css
Created July 2, 2014 08:24
simple diagonal background with css
span {
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAKElEQVQIW2NkQAOvX7/+z4gsBhIQFRVlhAvCBECKwILIAmBBdAGQIAACIhPGO7psSwAAAABJRU5ErkJggg==');
border: 1px solid #eee;
box-sizing: border-box;
display: inline-block;
height: 150px;
margin: 5px;
width: 150px;
}
@chitacan
chitacan / README.md
Last active February 22, 2016 07:08
create a electron project like speed of ⚡

How to use

$ git clone https://gist.github.com/427fe11ad6beb8b276fb.git <APP_NAME>
$ cd <APP_NAME>
$ npm install -g electron-prebuilt
$ electron .

want more ⚡er way? create zsh alias !!

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Tree Example</title>
<style>
.node {
@chitacan
chitacan / README.md
Last active September 19, 2017 08:19
How Android Inspect Battery

How Android Inspect Battery

최종 업데이트 : 2014-07-14 15:44:18

기본 정보 확인하기

Intent.ACTION_BATTERY_CHANGEDBroadcast receiver에 등록해 변경사항이 있을때마다, 정보를 수신할 수 있음

아니면, dumpsys 를 통해 바로 확인할 수 있음

Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 4.4.2 (https://www.mediafire.com/?qbbt4lhyu9q10ix)
Google Apps for Android 4.3 (http://goo.im/gapps/gapps-jb-20130813-signed.zip)
Google Apps for Android 4.2 (http://goo.im/gapps/gapps-jb-20130812-signed.zip)
Google Apps for Android 4.1 (http://goo.im/gapps/gapps-jb-20121011-signed.zip)
@chitacan
chitacan / AdbExtender.java
Last active August 29, 2015 14:04
extend your adbd connection to somewhere else.
public class MyActivity extends Activity {
private Thread mWorker = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my);
}