Skip to content

Instantly share code, notes, and snippets.

@kamawanu
kamawanu / __opt.py
Last active February 9, 2022 00:23
z80 instruction set implements by python3, experimental, planning,
from z80 import z80, _decode_0
import reg
import inspect
from typing import Optional
def unref(data) -> Optional[str]:
return z80.what(data)
// ci0.c 2013.10.03 Hatada
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//----------------------------------------------------------------------------//
// 字句解析 //
//----------------------------------------------------------------------------//
#define SIZETOKEN 1000 // トークン配列のサイズ
#define OPERATOR2 "== != <= >= |= += -= *= /= >> << ++ -- && || -> "
<?php
#print_r(phpversion());
#print_r($_SERVER["HTTP_USER_AGENT"]);
print_r(get_browser());

Principles of Adult Behavior

  1. Be patient. No matter what.
  2. Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn’t say to him.
  3. Never assume the motives of others are, to them, less noble than yours are to you.
  4. Expand your sense of the possible.
  5. Don’t trouble yourself with matters you truly cannot change.
  6. Expect no more of anyone than you can deliver yourself.
  7. Tolerate ambiguity.
  8. Laugh at yourself frequently.
@kamawanu
kamawanu / android.headless.sh
Created January 11, 2018 14:17 — forked from francisdb/android.headless.sh
Android headless sdk update
./android list sdk --all
./android update sdk --no-ui --all --filter 87,81,1,2,3,82,tool,platform-tool
set -e
set -x
V=fe022ce2f8d59cc80de8c6ebbf6e42f254a70ec7
if [ \! -d FFmpeg-$V ]
then
if [ \! -f $V.zip ]
then
wget -N https://github.com/FFmpeg/FFmpeg/archive/$V.zip
fi
unzip -q $V.zip
@kamawanu
kamawanu / enc_dec_test.py
Created November 19, 2017 17:32 — forked from justinfx/enc_dec_test.py
Speed test of common serializers on python 2.7.2 (pickle, cPickle, ujson, cjson, simplejson, json, yajl, msgpack)
"""
Dependencies:
pip install tabulate simplejson python-cjson ujson yajl msgpack-python
"""
from timeit import timeit
from tabulate import tabulate
@kamawanu
kamawanu / disable-rotation.sh
Created August 15, 2017 15:49
android adb tips
# https://stackoverflow.com/a/25864485
adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:0
# https://stackoverflow.com/a/41455424
#!/bin/bash
#set +x
set +x -e
which jq || {
echo jq not found ; exit 9
}
which curl || {
echo curl not found ; exit 9
}
@kamawanu
kamawanu / ariblib-ubuntu.sh
Last active April 29, 2018 15:18 — forked from youzaka/captiondumper.py
字幕ダンプ
sudo apt install python3-pip
sudo pip3 install ariblib