Skip to content

Instantly share code, notes, and snippets.

View lackneets's full-sized avatar
🤗
Sorry I am super busy. I may respond in weeks or months

Lackneets Chang (小耀博士) lackneets

🤗
Sorry I am super busy. I may respond in weeks or months
  • TAROBO Investment Advisors Ltd.
  • Taipei, Taiwan
View GitHub Profile
@lackneets
lackneets / insertScripts.js
Last active August 29, 2015 14:02
insertScripts in console
(function insertScripts(src) {
if (src instanceof Array && src.length) {
insertScripts(src.shift())
return insertScripts(src);
}
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = src;
document.head.appendChild(script);
})([
setInterval(function () {
// 取得網頁上所有連結
var a = document.getElementsByTagName('a');
// 針對每個連結跑一次
for (var i in a) {
// 檢查是不是真的是連結
if (a.hasOwnProperty(i)) {
// 檢查是不是讚的連結
if (a[i].className == "UFILikeLink") {
// 檢查是不是還沒按過讚
function MyArray() {
var parent = { // Remember the Origional-methods
push: this.push
}
this.push = function (element) { // Override
// Do my actions
return parent.push.apply(this, arguments);
}
// Batch Big5-URLDecoder
// go visit http://www.mytju.com/classcode/tools/urldecode_big5.asp
(function insertScripts(src) {
if (src instanceof Array && src.length) {
insertScripts(src.shift())
return insertScripts(src);
}
var script = document.createElement('script');
script.type = 'text/javascript';
@lackneets
lackneets / swipedirection.js
Created August 5, 2014 02:12
Detect left/right-swipe on touch-devices, but allow up/down-scrolling
// a modification from http://goo.gl/tLbLXr
var attachEvent = function(element, event, fn) {
if (element.addEventListener)
element.addEventListener(event, fn, false);
else if (element.attachEvent) // if IE
element.attachEvent('on' + event, fn);
}
var onReady = function(func) {
@lackneets
lackneets / sansSerif.less
Last active August 29, 2015 14:05
Sans-Serif fonts for Mac and Windows
@sansSerifBold: Helvetica, Arial, "LiHei Pro", "AdobeFanHeitiStd-Bold","Microsoft JhengHei", "新細明體"; // 適合粗體標題使用
@sansSerif: Helvetica, Arial, "LiHei Pro", "Microsoft JhengHei", "新細明體"; // 一般內文適用
body, input, select, button {
font-family: @sansSerif !important;
}
h1,h2,h3,h4,h5,h6{
font-family: @sansSerifBold;
}
@lackneets
lackneets / bootstrap.wrap.css
Last active August 29, 2015 14:20
Bootstrap Wrapped Version
html.bs-wrap {
font-family: sans-serif;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
body.bs-wrap {
margin: 0;
}
.bs-wrap article,
.bs-wrap aside,
@lackneets
lackneets / by-receiver-bookmarklet.js
Last active August 29, 2015 14:24
Download Gmail in Group save by Receiver
javascript: function gmailRawURL(t){return"//mail.google.com/mail/"+String(location).match(/(u\/\d*\/)/)+"?ik="+GLOBALS[9]+"&view=om&th="+t}function downloadURL(t,a){var o=document.createElement("a");o.setAttribute("href",a),o.setAttribute("download",t),o.click(),console.log("Download",a,"as",t)}function download(t,a){var o=document.createElement("a");o.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(a)),o.setAttribute("download",t),o.click()}Array.prototype.forEach.call($$(".kQ"),function(t){t.click()}),Array.prototype.forEach.call($$(".kv .adf"),function(t){t.click()}),Array.prototype.forEach.call($$(".h7 .hb .g2.ac2"),function(t){console.log(t.getAttribute("email"))});var mails=$$(".adP.adO"),recieverEmails=Array.prototype.map.call($$(".h7 .hb .g2.ac2"),function(t){return t.getAttribute("email")}),mailUrls=[];for(var i in mails)id=String(mails[i].className).match(/m([\d\w]+)/),id&&mailUrls.push(gmailRawURL(id[1]));mailUrls.forEach(function(t,a){downloadURL(recieverEmails[a]+".eml",t
@lackneets
lackneets / .htaccess
Created October 16, 2015 23:08
Hide html extension .htaccess
RewriteEngine On
# To externally redirect /dir/foo.html to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.html [NC]
RewriteRule ^ %1 [R,L,NC]
## To internally redirect /dir/foo to /dir/foo.html
RewriteCond %{REQUEST_FILENAME}.html -f [NC]
RewriteRule ^ %{REQUEST_URI}.html [L]
@lackneets
lackneets / backup.php
Last active December 17, 2015 14:52 — forked from menzerath/backup.php
PHP: Recursively Backup Files & Folders to ZIP-File
<?php
/*
* PHP: Recursively Backup Files & Folders to ZIP-File
* (c) 2012-2014: Marvin Menzerath - http://menzerath.eu
*/
// Make sure the script can handle large folders/files
ini_set('max_execution_time', 600);
ini_set('memory_limit','1024M');