Skip to content

Instantly share code, notes, and snippets.

View stormwy's full-sized avatar

Stormwy stormwy

  • Guangzhou,China
View GitHub Profile
@stormwy
stormwy / soap-curl-shell
Created September 9, 2019 05:56 — forked from gustavohenrique/soap-curl-shell
SOAP request using curl
# request.xml
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wst="http://sensedia.com/repository/wstoolkit">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-1">
<wsse:Username>system</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">manager</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">DWk64SMfJ6RxHAKgPRGtPA==</wsse:Nonce>
<wsu:Created>2013-04-17T18:36:54.013Z</wsu:Created>
</wsse:UsernameToken>
@stormwy
stormwy / Instructions.md
Created August 22, 2019 08:23 — forked from pgilad/Instructions.md
Git commit-msg hook to validate for jira issue or the word merge

Instructions

  • copy the file commit-msg to .git/hooks/commit-msg
  • make sure your delete the sample file .git/hooks/commit-msg.sample
  • Make commit msg executable. chmod +x .git/hooks/commit-msg
  • Edit commit-msg to better fit your development branch, commit regex and error message
  • Profit $$

Shell example

@stormwy
stormwy / startBrowser.go
Last active September 5, 2019 13:10
[go] open a browser to visit the specify url
package main
import(
"os/exec"
"runtime"
)
func startBrowser(url string) bool {
// try to start the browser
var args []string
@stormwy
stormwy / TestAviator.java
Last active August 9, 2019 07:11
[java] aviator example
import com.googlecode.aviator.AviatorEvaluator;
import com.googlecode.aviator.Expression;
import java.util.HashMap;
import java.util.Map;
public class TestAviator {
public static void main(String[] args) {
Expression compiledExp = AviatorEvaluator.compile("100<a && a<200",true);
Map<String,Object> factorMap = new HashMap<>();
@stormwy
stormwy / bcrypt-nodejs-practice.js
Created July 12, 2018 03:36
[nodejs] use bcrypt-nodejs to encrypt password with salt, and validate.
const bcrypt = require('bcrypt-nodejs');
let salt = bcrypt.genSaltSync();
console.log(`salt value: ${salt} length is ${salt.length}`);
let password = '123456aa';
let encryptPassword = bcrypt.hashSync(password,salt);
console.log(`encryptPassword: ${encryptPassword}`);
let compareResult = bcrypt.compareSync(password,encryptPassword);