Skip to content

Instantly share code, notes, and snippets.

View PaoJiao's full-sized avatar

Paul George PaoJiao

View GitHub Profile
@PaoJiao
PaoJiao / opene.sh
Created May 14, 2024 02:46 — forked from beakr/opene.sh
Open Windows file explorer on a directory with Cygwin.
#!/bin/bash.exe
# This script opens a given directory up in the Windows file explorer. I did
# this to make it easy when opening directories in the Cygwin system using
# the explorer.
#
# To install:
#
# $ touch /usr/bin/opene
# $ vim /usr/bin/opene
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@PaoJiao
PaoJiao / android-backup-apk-and-datas.md
Created June 25, 2021 05:20 — forked from AnatomicJC/android-backup-apk-and-datas.md
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Fetch application APK

To get the list of your installed applications:

@PaoJiao
PaoJiao / install_cygwin_sshd.txt
Created April 28, 2021 04:09 — forked from roxlu/install_cygwin_sshd.txt
Installing CYGWIN + SSHD for remote access through SSH on windows
Installing CYGWIN with SSH
1) Download cygwin setup.exe from http://www.cygwin.com
- Execute setup.exe
- Install from internet
- Root directory: `c:\cygwin` + all users
- Local package directory: use default value
- Select a mirror to download files from
- Select these packages:
- editors > xemacs 21.4.22-1
- net > openssh 6.1-p
# Speed up scrolling for all programs and pass unchanged for zoom
".*"
None, Up, Button4, 3
None, Down, Button5, 3
Shift_L, Up, Shift_L|Button4, 3
Shift_L, Down, Shift_L|Button5, 3
Control_L, Up, Control_L|Button4
Control_L, Down, Control_L|Button5
@PaoJiao
PaoJiao / tmux-cheatsheet.markdown
Created May 2, 2019 02:58 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@PaoJiao
PaoJiao / gitlab.conf
Created August 3, 2018 03:35 — forked from sameersbn/gitlab.conf
Nginx reverse proxy configuration for GitLab
upstream gitlab {
server 172.17.42.1:10080 fail_timeout=0;
}
# let gitlab deal with the redirection
server {
listen 80;
server_name git.example.com;
server_tokens off;
root /dev/null;
@PaoJiao
PaoJiao / pac.py
Created July 31, 2018 01:13 — forked from abbradar/pac.py
PAC implementation with QJSEngine
import sys
import ipaddress
import socket
import fnmatch
import traceback
import itertools
from datetime import datetime
import functools
from urllib.parse import urlparse
from PyQt5.QtCore import QObject, QVariant, QMetaType, pyqtSlot
@PaoJiao
PaoJiao / android-captive.sh
Created April 5, 2018 01:41 — forked from tonyseek/android-captive.sh
Overrides the captive portal settings of Android in China
#!/usr/bin/env sh
adb shell settings put global captive_portal_fallback_url http://g.cn/generate_204
adb shell settings put global captive_portal_http_url http://www.google.cn/generate_204
adb shell settings put global captive_portal_https_url https://www.google.cn/generate_204
adb shell settings put global captive_portal_other_fallback_urls http://www.qualcomm.cn/generate_204
@PaoJiao
PaoJiao / coordinating-async-react.md
Created December 26, 2017 13:25 — forked from acdlite/coordinating-async-react.md
Demo: Coordinating async React with non-React views

Demo: Coordinating async React with non-React views

tl;dr I built a demo illustrating what it might look like to add async rendering to Facebook's commenting interface, while ensuring it appears on the screen simultaneous to the server-rendered story.

A key benefit of async rendering is that large updates don't block the main thread; instead, the work is spread out and performed during idle periods using cooperative scheduling.

But once you make something async, you introduce the possibility that things may appear on the screen at separate times. Especially when you're dealing with multiple UI frameworks, as is often the case at Facebook.

How do we solve this with React?