Skip to content

Instantly share code, notes, and snippets.

View jiegec's full-sized avatar
💯

Chen jiegec

💯
View GitHub Profile
@jiegec
jiegec / versions.gradle
Last active August 29, 2015 14:00
A simple gradle script for choosing correct version of ForgeGradle
minecraftVersion = '1.6.4'
forgeVersion = '9.11.1.964'
def versions = forgeVersion.split('\\.')
def fourth = Integer.valueOf(versions[3])
if(fourth >= 1048) {
forgeGradleVersion = '1.2-SNAPSHOT'
}else if(fourth >= 967) {
forgeGradleVersion = '1.1-SNAPSHOT'
}else if(fourth == 965 || fourth < 960){
@jiegec
jiegec / numpy.diff
Created August 18, 2015 11:51
numpy build fix in Mac OS X
diff --git a/numpy/distutils/command/build_ext.py b/numpy/distutils/command/build_ext.py
index b48e422..4311758 100644
--- a/numpy/distutils/command/build_ext.py
+++ b/numpy/distutils/command/build_ext.py
@@ -46,10 +46,14 @@ class build_ext (old_build_ext):
self.fcompiler = None
def finalize_options(self):
- incl_dirs = self.include_dirs
+ if isinstance(self.include_dirs, str):
(import hy)
(def py-eval (get __builtins__ "eval"))
(defn stringify [form &optional debug]
"Convert a FORM to a string."
(when debug (print (.format "{0}: {1}" form (type form))))
(cond
[(isinstance form hy.models.expression.HyExpression)
(+ "(" (.join " " (list-comp (stringify x debug) [x form])) ")")]
@jiegec
jiegec / keybase.md
Created November 30, 2017 04:09
Prove that I am jiegec on github and keybase.

Keybase proof

I hereby claim:

  • I am jiegec on github.
  • I am jiegec (https://keybase.io/jiegec) on keybase.
  • I have a public key ASDSHq7bWCl7yCwLjKKga4dR-yY6o5G8pmINPXvRiBmQpgo

To claim this, I am signing this object:

@jiegec
jiegec / perf-on-Android.md
Created October 12, 2024 08:16
Use perf counters on Android

There are different ways to access perf counters on Android:

  1. On root-ed device, you can access PMU via root user
  2. Execute programs that calls perf_event_open syscall in adb shell

You need to copy executables to Android using adb push. But beware that some partitions are mounted as noexec in some devices e.g. /storage/emulated/0/.

If you find it hard to find a target directory for adb push, you can:

  1. Run sshd in Termux to launch a SSH server