Skip to content

Instantly share code, notes, and snippets.

/
├── ios/
│ └── .gitignore
├── android/
│ └── .gitignore
├── js/
│ ├── App.js // react-native-router-flux 路由
│ ├── actions/
│ ├── assets/ // 素材内容
│ ├── components/ // Pure Components
@evianzhow
evianzhow / index.js
Last active March 26, 2018 07:04
jpush-react-native with lodash throttle
const registerJPush = (alias, tags) => {
if (!JPushConnected) {
return throttledRegister(alias, tags);
}
if (alias) {
JPushModule.setAlias(alias, ({ errorCode = 0 }) => {
if (errorCode) {
throttledRegister(alias, null);
}
});
@evianzhow
evianzhow / gist:3f0e3a1b41237f386addf60f61dd5294
Created March 14, 2018 14:43
FBPortForwarding Flow Map
|
iOS Device | Mac
|
+----------------+ +----------------+
|Peertalk Server | connect |Peertalk Client |
| <------------+ |
| | | |
| Port 8025| | |
+----+-----------+ +---------^------+
@evianzhow
evianzhow / Vagrantfile
Created August 5, 2016 13:52
Cross-compile Vagrant box for EdgeRouter
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
end
config.vm.provision "shell", inline: <<-SHELL
Number Start End Size File system Name Flags
34s 2047s 2014s Free Space
1 2048s 4982527s 4980480s ext4 Linux RAID raid
2 4982528s 9176831s 4194304s linux-swap(v1) Linux RAID raid
9176832s 9453279s 276448s Free Space
5 9453280s 3221007391s 3211554112s Linux RAID raid
3221007392s 6442450910s 3221443519s Free Space
@evianzhow
evianzhow / README.md
Last active April 25, 2017 02:34
iPod battery percentage enabler
default 16:24:50.953454 +0800 Home activate generator <_UIFeedbackStatesBehavior: 0x17413c3e0: prepared=1> with style: Prewarm; activationCount: 1 -> 0; styleActivationCount: 1 -> 0
default 16:24:50.954154 +0800 Home feedback engine <_UIFeedbackHapticEngine: 0x1742c8340: state=0, numberOfClients=0, prewarmCount=1, _isSuspended=0> state changed: Inactive -> Prewarming
default 16:24:50.956076 +0800 Home 384: clientID: 0x1000194
default 16:24:50.993726 +0800 mediaserverd 317: Calling startPrewarm on synth
default 16:24:51.000852 +0800 mediaserverd 678: Client request to start IO proc ID 0x0 on VAD 173.
default 16:24:51.013337 +0800 mediaserverd 560: Starting IO type 1 on AggregateDevice 146.
default 16:24:51.015553 +0800 mediaserverd HALS_IOContext.cpp:766:StartIOProcID: HALS_IOContext::StartIOProcID: 150 Speaker (VAD [vdef] AggDev 1):
default 16:24:51.016062 +0800 mediaserverd HALS_IOContext.cpp:772:StartIOProcID: starting ProcID 0x0 state: Prewarm: 0 Play: 0 State: Stopped IOProc 0x21: no
default 16:24:5
default 15:58:44.577574 +0800 Home subsystem: com.apple.avfaudio, category: avas, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 2, enable_private_data: 0
default 15:58:44.614805 +0800 Home subsystem: com.apple.coreaudio, category: as, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 2, enable_private_data: 0
default 15:58:44.623043 +0800 mediaserverd 3817: created session sid:0x1e63f, Home(404), 'prim' for PID: 404 and port: 181107
default 15:58:44.637573 +0800 Home subsystem: com.apple.UIKit, category: FeedbackActivation, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
default 15:58:44.640189 +0800 Home activate generator <_UIFeedbackStatesBehavior: 0x17413c3e0: prepared=1> with style: Prewarm; activationCount: 1 -> 0;
@evianzhow
evianzhow / remove_deploy_keys.rb
Created November 15, 2016 05:57
Remove all GitLab deploy keys like a boss
require 'net/http'
require 'json'
HOST = 'enter_your_own_domain_here'
def login username, password
uri = URI("http://#{HOST}/api/v3/session?login=#{username}&password=#{password}")
# Create client
http = Net::HTTP.new(uri.host, uri.port)
# Create Request
tell application "System Events"
repeat while exists (processes where name is "SecurityAgent")
tell process "SecurityAgent"
set value of text field 1 of window 1 to "password"
click button "OK" of window 1
end tell
delay 0.2
end repeat
end tell