This file contains hidden or 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
<div data-control="toolbar"> | |
<div class="form-group span-left"> | |
<select class="form-control custom-select pagination-select" style="width:200px"> | |
<option selected="selected" value="1">第 1 頁</option> | |
</select> | |
</div> | |
</div> | |
<script> | |
$(function(){ |
This file contains hidden or 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
# Install imagemagick | |
sudo apt-get install imagemagick | |
# Resize jpeg images under subdirectories | |
find . -name "*.jpg" -exec mogrify -resize 1600x1600\> -quality 75% -verbose -format jpg {} + | |
# Resize jpeg images only if > 1MB | |
# http://superuser.com/questions/204564/how-can-i-find-files-that-are-bigger-smaller-than-x-bytes | |
find . -name "*.jpg" -size +1M -exec mogrify -resize 1600x1600\> -quality 75% -verbose -format jpg {} + |
This file contains hidden or 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
<!-- Send Height to Parent --> | |
<script type="text/javascript"> | |
function sendHeight(){ | |
if(parent.postMessage){ | |
parent.postMessage({ | |
height: document.body.offsetHeight, | |
location: window.location.toString() | |
}, '*'); | |
} | |
} |
This file contains hidden or 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
<?php | |
/* | |
Wordpress Backdoor Cleanup | |
Put this under upload folder | |
*/ | |
ini_set('display_errors', true); | |
function clenup($path) { | |
$dir = new DirectoryIterator($path); |
This file contains hidden or 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
javascript: (function(){ | |
"use strict"; | |
var regexCJ = /[\u4e00-\u9fa5]+|[\u0800-\u4e00]+/; | |
function getTextContainerNodes(){ | |
var nodes = Array.from(document.body.getElementsByTagName("*")); | |
var leafNodes = nodes.filter(function(elem) { | |
return elem.hasChildNodes() && Array.from(elem.childNodes).filter(function(node){ | |
return node.nodeType === 3; | |
}).length > 0 |
This file contains hidden or 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
@echo off | |
set /p dirs="Where to cleanup? : " | |
echo %dirs% | |
del /s /f /a %dirs%\*.DS_STORE | |
del /s /f /a %dirs%\*._.* | |
del /s /f /a %dirs%\*Thumbs.db |
This file contains hidden or 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
(define gcd | |
(lambda (a b) | |
(cond | |
((> b a) (gcd a (- b a))) | |
(else b) | |
) | |
) | |
) | |
(gcd 5120 65536) |
This file contains hidden or 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
"use strict"; | |
function classDefine(subClass, prototype, staticMembers){ | |
return classInherit(Object, subClass, prototype, staticMembers); | |
} | |
function classInherit(superClass, subClass, prototype, staticMembers){ | |
subClass.prototype = Object.create(superClass.prototype, { | |
super: {value: superClass, enumerable: false, writable: false, configurable: true }, | |
constructor: {value: subClass, enumerable: false, writable: false, configurable: true }, | |
}); // Extend the prototype from super class |
This file contains hidden or 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
$(document).on('mouseenter touchstart', 'a[href]:not([target])', function(){ | |
if(this.getAttribute('href').match(/^(https?:)?\/\//)){ | |
this.setAttribute('target', '_blank'); | |
} | |
}); |
This file contains hidden or 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
/* Common Behaviors */ | |
.noselect { | |
-webkit-touch-callout: none; | |
-webkit-user-select: none; | |
-khtml-user-select: none; | |
-moz-user-select: none; | |
-ms-user-select: none; | |
user-select: none; | |
} |