Skip to content

Instantly share code, notes, and snippets.

View szhu's full-sized avatar

Sean Zhu szhu

  • NYC / SF
  • 18:28 (UTC -04:00)
  • X @sfzhu
View GitHub Profile
{
let clientAppState = JSON.parse($("#client-app-state").text.replace(/&q;/g, '"'))
let { HttpState } = clientAppState
let route = Object.keys(HttpState)[0]
HttpState[route].data.properties.identifier.uuid
}
#!/bin/bash
set -euo pipefail
mkdir -p tmp/overrides/webpack%3a/%2e
while true; do
while IFS= read -r -d '' override_file
do
file=$(echo "$override_file" | python -c 'import re, sys; print re.split("^tmp/overrides/webpack%3a/%2e/|%3f.*$", sys.stdin.read().strip())[1]')
cp -f "$override_file" "$file"
# Read more about gapps-config file here:
https://github.com/opengapps/opengapps/wiki/Advanced-Features-and-Options
# Prevent automatic removal
# +Browser # Stock Browser
# +CameraStock # Stock Camera
# +Email # Stock Email
# +Gallery # Stock Gallery
# +Launcher # Stock Launcher(s)
@szhu
szhu / selfcompile.m
Last active May 14, 2018 18:27 — forked from n-b/selfcompile.m
A simple self-compiling objective-c file
/* 2>/dev/null
COMPILED=${0%.*}
[[ -e "$COMPILED" ]] || clang $0 -o "$COMPILED" -framework Foundation
exec "$COMPILED" $@
*/
#import <Foundation/Foundation.h>
int main(int argc, char *argv[])
# Backwards compatibility for fish 2.0.0
not contains source (builtin -n)
and alias source .
@szhu
szhu / com.interestinglythere.sendtokindle.plist
Last active March 26, 2018 10:33
Small daemon to send documents to your Kindle and eject it every time it's connected
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.interestinglythere.sendtokindle</string>
<key>StartOnMount</key>
<true/>
<key>ProgramArguments</key>
<array>
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@szhu
szhu / 1. Unobfuscated 11717.doc.vb
Created January 14, 2017 21:46
Word macro virus in received email
Sub AutoOpen()
If (True) Then
If (True) Then
If (False) Then
Else
If (False) Then
Else
Select Case Empty
Case Empty
tyqegexl = False
#!/bin/bash
verbose() {
echo "$@"
"$@"
}
power-softrestart() {
verbose adb shell "su -c 'killall zygote'"
}