Skip to content

Instantly share code, notes, and snippets.

@emanonwzy
emanonwzy / Makefile
Created March 14, 2016 17:02 — forked from cstratton/Makefile
A Makefile for building adb outside of a full AOSP tools build, motivated by a need to get a security-enabled ADB onto the Raspberry Pi
#ADB tool for the Raspberry Pi and similar environments not supported by the Android SDK.
#based on https://gist.github.com/splhack/958335
#This is a very simple hack for building adb on its own, using a lot of stock Linux libraries (libssl, libcrypt)
#in place of the versions shipped with AOSP, in order to avoid having to pull down a lot of code.
#git clone https://android.googlesource.com/platform/system/core system/core
#The method below does not work with the most recent version (you will see const char* conversion errors
#as a C file has been changed to a CPP one where that is more strict). However, it _can_ be made to work
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This script helps removing Git branches.
# Run it from a git repo dir. It will open the Git branches list
# in your favorite editor. Delete some branches from the list.
# Save and close the file. The script applies the changes to the repo.
from subprocess import call, Popen, PIPE
from os import getenv
@emanonwzy
emanonwzy / sumup.py
Created August 23, 2014 05:53 — forked from iwinux/sumup.py
#!/usr/bin/env python
# coding: utf-8
'''
中国联不通每月通话时间统计
用法:
1. 去 http://iservice.10010.com/ 下载通话详单(Excel 格式),导出为 CSV
2. ./sumup.py *.csv
'''
///////////////////////////////////////////////////////
// Talk is cheap. Show me the code. - Linus Torvalds
///////////////////////////////////////////////////////
public abstract class CalculatorBase : IDisposable {
protected void StartCore() {
// ...
}
import java.io.*;
import java.nio.file.*;
import java.security.*;
import java.security.cert.*;
import javax.net.ssl.*;
import org.bouncycastle.jce.provider.*;
import org.bouncycastle.openssl.*;
public class SslUtil
@emanonwzy
emanonwzy / ffr.c
Created December 20, 2013 07:43 — forked from cloudwu/ffr.c
#include <stdint.h>
#include <stdlib.h>
// assert(RAND_MAX >= 0x7fff)
float
random_0_to_1() {
union {
uint32_t d;
float f;
} u;
@emanonwzy
emanonwzy / Output
Created November 6, 2012 05:43 — forked from caoxudong/Output
ZZ. @老赵 生成一段Typoglycemia文本.Typoglycemia是个新词,描述的是人们识别一段文本时的一个有趣的现象:只要每个单词的首尾字母正确,中间的字母顺序完全打乱也没有关系,照样可以正常理解。
Original String:
I couldn't believe that I could actually understand what I was reading:
the phenomenal power of the human mind. According to a research team at Cambridge University,
it doesn't matter in what order the letters in a word are, the only important thing is that the
first and last letter be in the right place. The rest can be a total mess and you can still read
it without a problem. This is because the human mind does not read every letter by itself, but the
word as a whole. Such a condition is appropriately called Typoglycemia. Amazing, huh? Yeah and you
always thought spelling was important.
Converted String: