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
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
<?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
<!-- 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
# 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
<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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Example of Currency</title> | |
<!-- Javascripts here --> | |
<script src="https://code.jquery.com/jquery-1.12.3.min.js"></script> | |
<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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_URI}::$1 ^(.*?/)(.*)::\2$ | |
RewriteRule ^(.*)$ - [E=BASE:%1] | |
RewriteRule ^(.*\.less)$ %{ENV:BASE}/$1.css [QSA,L] | |
RewriteRule ^(.*\.less)\.css$ %{ENV:BASE}/lessc.php [QSA,L] | |
</IfModule> |
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
// The Basic | |
.grids{ | |
letter-spacing: -.31em; | |
> * { | |
display: inline-block; | |
letter-spacing: 0.01em; | |
} | |
} | |
// Options |
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
window.ready=function(e){"loading"!=document.readyState?e():document.addEventListener?document.addEventListener("DOMContentLoaded",e):document.attachEvent("onreadystatechange",function(){"loading"!=document.readyState&&e()})}; | |
/* Fallback for lazysizes on IE8 */ | |
window.ready(function(){ | |
if (document.documentMode == 8) { | |
var elms = document.querySelectorAll('.lazyload'); | |
for(var i=0; i<elms.length; i++){ | |
elms[i].setAttribute('class', String(elms[i].getAttribute('class')).replace(/\s*lazyload\s*/g, ' lazyloaded ')); | |
if(elms[i].getAttribute('data-src')){ | |
elms[i].setAttribute('src', elms[i].getAttribute('data-src')); |