Skip to content

Instantly share code, notes, and snippets.

View stanwu's full-sized avatar

Stan Wu stanwu

View GitHub Profile
@stanwu
stanwu / pub_screenshot.md
Last active December 17, 2023 23:54
Public Screenshot

image

image

<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<o:Security xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
s:mustUnderstand="1">
<o:UsernameToken xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
Id="909c1b23-c100-4a66-beb7-3fb6400c8e89">
<o:Username>2preklamcilTR</o:Username>
<o:Password>K^0zE#3vI!6v</o:Password>
const req = {
ClientDetail: {
},
RequestedShipment: {
DropOffType: 'REQUEST_COURIER',
Ship: {
Shipper: {
StreetLines: '1-16-24, Minami-gyotoku',
City: 'Ichikawa-shi, Chiba',
PostalCode: '272-0138',
@stanwu
stanwu / wsdlRequest.js
Created October 31, 2022 06:34
wsdlRequest.js
async function wsdlRequest(wsdlUrl, method, auth, req) {
return new Promise((resolve, reject) => {
const res = {};
soap.createClient(wsdlUrl, function(err, client) {
if (auth.username === undefined) {
reject('No username specified');
}
if (auth.password === undefined) {
reject('No password specified');
<script>
$('.scrollleft').click(function () {
console.log('ok')
$('#scrollbar').animate({
scrollLeft: '-=153'
}, 1000, 'easeOutQuad');
});
$('.scrollright').click(function () {
console.log('ok')
$('#scrollbar').animate({
@stanwu
stanwu / MAs for risk managememt.py
Created November 21, 2020 12:32
MAs for risk managememt
//@version=1
study(title="注意空頭", overlay=true)
short = sma(close, 5)
long = sma(close, 250) * 0.975
enter_period = sma(sign(short-long)*0.1-0.1, 22)*22
enter_indicator = enter_period<0?1:0
@stanwu
stanwu / delf0.ps1
Last active November 1, 2020 03:40
Find zero byte files then delete
Get-Childitem -Recurse | foreach-object {
if(!$_.PSIsContainer -and $_.length -eq 0) {
write-host (“{0} -> {1}” -f $_.FullName, $_.Length)
remove-item -path $_.FullName
}
}
#!/bin/bash
echo "Before:"
du -h -d 0 .gradle
find ~/.gradle -type f -atime +30 -delete
find ~/.gradle -type d -mindepth 1 -empty -delete
echo "Now:"
du -h -d 0 .gradle
@stanwu
stanwu / .htaccess
Created October 16, 2020 07:16
Bluehost force SSL
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
@stanwu
stanwu / imap_body_decoding.php
Created October 1, 2020 03:41
PHP IMAP decoding messages
<?php
$hostname = '{********:993/imap/ssl}INBOX';
$username = '*********';
$password = '******';
$inbox = imap_open($hostname,$username,$password) or die('Cannot connect to server: ' . imap_last_error());
$emails = imap_search($inbox,'ALL');
if($emails) {