Skip to content

Instantly share code, notes, and snippets.

Avatar

Sparkle baurine

View GitHub Profile
View wg0.conf on local server
[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 Apr 12, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// 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 Sep 27, 2016
shell helper for run react-native app
View run_app.sh
#!/usr/bin/env sh
usage() {
echo "Usage:"
echo " run_app android"
echo " run_app ios"
}
arg=$1
if [ -z "$arg" ]; then
View run_rails_helper.sh
#!/usr/bin/env sh
usage() {
echo "Usage:"
echo " run_with_ip"
echo " run_with_ip ip"
}
arg=$1
if [ -z "$arg" ]; then
View git_archive.sh
#!/usr/bin/env sh
# 将 branch 以 zip 格式打包到指定文件
branch=$1
if [ -z "$branch" ]; then
branch=$(git branch | grep '*' | awk '{print $2}')
fi
echo $branch
View redux_react_todo.html
<!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>
View redux_todo.html
<!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>
View redux_test.html
<!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>
View redux_counter.html
<!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>
View isomorphic_strings.java
// 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];