This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import time | |
import random | |
print(f"hello from {sys.argv[0]}") | |
out = 0 | |
err = 0 | |
while out < 10 and err < 10: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git | |
alias ga='git add' | |
alias gb='git branch' | |
alias gclone='git clone' | |
alias gco='git checkout' | |
alias gc='git commit' | |
alias gcmt='git commit' | |
alias gs='git status' | |
alias gl='git log' | |
alias gdiff='git diff' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/groovy | |
/******************************************************************* | |
* | |
* My first groovy script which is used to determine if a file is | |
* started with JAVA comments, i.e. // or /*. | |
* | |
*******************************************************************/ | |
// The file list is piped to the script (i.e. stdin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SRC: http://mirrors.163.com/.help/debian.html | |
deb http://mirrors.163.com/debian/ stretch main non-free contrib | |
deb http://mirrors.163.com/debian/ stretch-updates main non-free contrib | |
deb http://mirrors.163.com/debian/ stretch-backports main non-free contrib | |
deb-src http://mirrors.163.com/debian/ stretch main non-free contrib | |
deb-src http://mirrors.163.com/debian/ stretch-updates main non-free contrib | |
deb-src http://mirrors.163.com/debian/ stretch-backports main non-free contrib | |
deb http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib | |
deb-src http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Sends a POST request to target URL by forking curl. | |
* Returns the response content on success; Otherwise returns null. | |
* | |
*/ | |
private static String sendPostWithCurl (String url) { | |
String [] cmdOptions = new String[] {"/usr/bin/curl", "-k", "-H \"Content-Length: 0\"", "-X", "POST", url}; | |
StringBuilder builder = new StringBuilder(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Client ignoreSSLClient() throws Exception { | |
SSLContext sslcontext = SSLContext.getInstance("TLS"); | |
sslcontext.init(null, new TrustManager[]{new X509TrustManager() { | |
public void checkClientTrusted(X509Certificate[] arg0, String arg1) throws CertificateException {} | |
public void checkServerTrusted(X509Certificate[] arg0, String arg1) throws CertificateException {} | |
public X509Certificate[] getAcceptedIssuers() { return new X509Certificate[0]; } | |
}}, new java.security.SecureRandom()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// register global shortcuts | |
var { globalShortcut } = require('electron'); | |
var ret = globalShortcut.register('CommandOrControl+Down', function () { | |
console.log ('Key down is pressed with globalShortcut'); | |
}); | |
if (!ret) { | |
console.log ('failed to register shortcut'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "Feature", | |
"geometry": { | |
"type": "Polygon", | |
"coordinates": [ | |
[ | |
[ | |
121.55539512634279, | |
31.224876067583286 | |
], |