Skip to content

Instantly share code, notes, and snippets.

View tabjy's full-sized avatar

Kangcheng Xu tabjy

  • Toronto, ON
  • 23:04 (UTC -04:00)
View GitHub Profile
@tabjy
tabjy / java_11.txt
Last active November 20, 2019 15:33
pre java 11 bridge method for nested access
Classfile /home/kxu/Documents/github.com/tabjy/java-snippets/target/classes/com/tabjy/snippets/asm/path_syntax_evaluation/Pojo.class
Last modified Nov 20, 2019; size 800 bytes
MD5 checksum ce2027f5c28d4f1634e8c67ef84efd97
Compiled from "Pojo.java"
public class com.tabjy.snippets.asm.path_syntax_evaluation.Pojo
minor version: 0
major version: 55
flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: #9 // com/tabjy/snippets/asm/path_syntax_evaluation/Pojo
super_class: #10 // java/lang/Object
import the_package.MyObject;
import the_package.OtherObject;
import the_package.SubMyObject;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Objects;
@tabjy
tabjy / 163-uwp.json
Created September 5, 2019 16:50
Dockerfile for Netease music reverse proxy
{"code":200,"uwp":1}
from pyspark import SparkConf, SparkContext
import sys
assert sys.version_info >= (3, 5) # make sure we have Python 3.5+
# add more functions as necessary
def toTupples(line):
frags = line.split(" ")
return (frags[0], (frags[1], frags[2], frags[3], frags[4]))
@tabjy
tabjy / exercise.go
Last active September 14, 2017 08:06
Go tour exercise solutions
// exercise-loops-and-functions.go --------------------------------
package main
import (
"fmt"
"math"
)
func newton(x float64) float64 {
// base case
@tabjy
tabjy / fs.proc.cmdline.c
Last active June 15, 2017 23:32
bypass safetynet
/** modified by tabjy
* accroding to https://github.com/sultanxda/android_kernel_oneplus_msm8996/commit/abc05b16bbd33521c2fffaf491c5657a94bfcfc5
* and https://github.com/sultanxda/android_kernel_oneplus_msm8996/commit/3a450b89a44c5e2eb357ff797298c6201c78e3b3
* to bypass SafetyNet
*/
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <asm/setup.h>
@tabjy
tabjy / conky_size_arch.lua
Created May 13, 2017 04:08
a simple conky theme for Archlinux
conky.config = {
alignment = 'top_right',
background = false,
border_width = 0,
draw_graph_borders = false,
color0 = '#2A558C',
color1 = '#6698D9',
color2 = '#2E4159',
color3 = '#B3CFF2',
@tabjy
tabjy / get_leaking_ip.js
Created January 1, 2017 05:02
Get real IP behind proxy using WebRTC
function getPeerConnection() {
var RTCPeerConnection = window.RTCPeerConnection ||
window.mozRTCPeerConnection ||
window.webkitRTCPeerConnection;
//bypass naive webrtc blocking
if (!RTCPeerConnection) {
var iframe = document.createElement('iframe');
iframe.style.display = 'none';
document.body.appendChild(iframe);
@tabjy
tabjy / fish_shell_local_install.sh
Created October 19, 2016 18:57 — forked from masih/fish_shell_local_install.sh
Installs Fish Shell without root access
#!/bin/bash
# Script for installing Fish Shell on systems without root access.
# Fish Shell will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
FHISH_SHELL_VERSION=2.3.1
@tabjy
tabjy / say.sh
Created January 12, 2016 10:17 — forked from zshbleaker/say.sh
say command in OS X
say --voice="Agnes" Isn't it nice to have a computer that will talk to you?
say --voice="Albert" I have a frog in my throat. No, I mean a real frog!
say --voice="Alex" Most people recognize me by my voice.
say --voice="Alice" Salve, mi chiamo Alice e sono una voce italiana.
say --voice="Alva" Hej, jag heter Alva. Jag är en svensk röst.
say --voice="Amelie" Bonjour, je m ’ appelle Amelie. Je suis une voix canadienne.
say --voice="Anna" Hallo, ich heiße Anna und ich bin eine deutsche Stimme.
say --voice="Bad News" The light you see at the end of the tunnel is the headlamp of a fast approaching train.
say --voice="Bahh" Do not pull the wool over my eyes.
say --voice="Bells" Time flies when you are having fun.