Skip to content

Instantly share code, notes, and snippets.

View wmh's full-sized avatar
🎯
Focusing

Hunter Wu wmh

🎯
Focusing
  • Not available for hire.
  • Taipei 104
View GitHub Profile
@wmh
wmh / 2.js
Last active September 11, 2017 03:19
Select My Country
// https://kktix.com/users/edit
$('#user_place_id').val($('#user_place_id option:contains(臺灣)').attr('value'));
@wmh
wmh / uploadfile-partial.js
Created January 28, 2015 05:17
jquery validation & uploadfile plugin conflict
var fileInputStr = "<input type='file' class='ignore' id='" + fileUploadId + "' name='" + s.fileName + "' accept='" + s.acceptFiles + "'/>";
if(s.multiple) {
if(s.fileName.indexOf("[]") != s.fileName.length - 2) // if it does not endwith
{
s.fileName += "[]";
}
fileInputStr = "<input type='file' class='ignore' id='" + fileUploadId + "' name='" + s.fileName + "' accept='" + s.acceptFiles + "' multiple/>";
}
@wmh
wmh / dabblet.css
Created April 16, 2014 02:16 — forked from anonymous/dabblet.css
Untitled
.scroll-text {
border: 1px solid red;
width: 400px;
height: 4.5em;
overflow: hidden;
}
.scroll-text ul {
width: 800px;
height: 100px;
overflow: hidden;
@wmh
wmh / dabblet.css
Created April 16, 2014 02:00
Hello world
/**
* Hello world
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@wmh
wmh / gist:5628456
Created May 22, 2013 15:24
grb auto complete by ash
_grb()
{
local cur=${COMP_WORDS[COMP_CWORD]}
local verb=${COMP_WORDS[1]}
local position=${COMP_CWORD}
if [[ "$verb" == "explain" ]]; then
let "position = $position - 1"
fi
;-----------------------------
sub put
putStart:
set %putType DWJ ;ores
gosub putType
set %putType UWS ;perfect emerald
gosub putType
set %putType GXS ;blue diamond
gosub putType
set %putType AXS ;dark sapphire
javascript:document.body.onselectstart=function() {};document.body.ondragstart=function() {};void(0);
; Mining
initEvents
scriptStart:
move 2576 479 0
set %TX 443
set %TY 277
gosub Mining
move 2568 488 0
//-- change iframe height and width
//child: <body onload="getIframeSize()">
//for child
function getIframeSize() {
if (document.getElementById){
var t = document.getElementById("t");
try {
parent.wh("loginForm", t.offsetWidth, t.offsetHeight);
} catch (e) {
/*
* Decimal > Custom
*
* Parameters:
* $num - your decimal integer
* $base - base to which you wish to convert $num (leave it 0 if you are providing $index or omit if you're using default (62))
* $index - if you wish to use the default list of digits (0-1a-zA-Z), omit this option, otherwise provide a string (ex.: "zyxwvu")
*/
function dec2any($num, $base=62, $index=FALSE) {
if (!$base) {