Skip to content

Instantly share code, notes, and snippets.

View baurine's full-sized avatar

Sparkle baurine

View GitHub Profile
[Interface]
PrivateKey = x
Address = 192.168.2.5/24
ListenPort = 21841
[Peer]
PublicKey = x
Endpoint = $public_ip:51820
AllowedIPs = 192.168.2.0/24
@baurine
baurine / 0_reuse_code.js
Created April 12, 2017 02:02
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@baurine
baurine / run_app.sh
Created September 27, 2016 03:58
shell helper for run react-native app
#!/usr/bin/env sh
usage() {
echo "Usage:"
echo " run_app android"
echo " run_app ios"
}
arg=$1
if [ -z "$arg" ]; then
#!/usr/bin/env sh
usage() {
echo "Usage:"
echo " run_with_ip"
echo " run_with_ip ip"
}
arg=$1
if [ -z "$arg" ]; then
#!/usr/bin/env sh
# 将 branch 以 zip 格式打包到指定文件
branch=$1
if [ -z "$branch" ]; then
branch=$(git branch | grep '*' | awk '{print $2}')
fi
echo $branch
@baurine
baurine / redux_react_todo.html
Last active June 2, 2016 11:12
redux_react_todo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.0.4/redux.js"></script>
<script src="https://fb.me/react-0.14.7.min.js"></script>
<script src="https://fb.me/react-dom-0.14.7.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/react-redux/4.0.0/react-redux.js"></script>
@baurine
baurine / redux_todo.html
Last active June 1, 2016 14:43
redux_todo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.0.4/redux.js"></script>
<body>
<div id="root"></div>
</body>
@baurine
baurine / redux_test.html
Last active June 1, 2016 09:36
redux_test
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script type="text/javascript" src="https://wzrd.in/standalone/expect@latest"></script>
<script type="text/javascript" src="https://wzrd.in/standalone/deep-freeze@latest"></script>
</head>
<body>
@baurine
baurine / redux_counter.html
Last active June 1, 2016 08:15
Redux_Counter
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script type="text/javascript" src="https://wzrd.in/standalone/expect@latest"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.0.4/redux.js"></script>
<script src="https://fb.me/react-0.14.7.min.js"></script>
<script src="https://fb.me/react-dom-0.14.7.min.js"></script>
// https://leetcode.com/problems/isomorphic-strings/
public class Solution {
public boolean isIsomorphic(String s, String t) {
char[] source, target;
char srcChar, targetChar;
boolean isIsomorphic = true;
// init two hash table
source = new char[128];
target = new char[128];