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
| (function(){ //add SVG Support for jquery add/remove class | |
| var _addClass = $.fn.addClass, _removeClass = $.fn.removeClass; | |
| $.fn.addClass = function(className) { | |
| this.filter('svg').attr('class', function(index, existingClassNames) { | |
| var list = existingClassNames.split(' '); | |
| for(var i = 0, n = list.length; i < n; ++i){ | |
| if(list[i] == className) return existingClassNames; | |
| } | |
| return existingClassNames + ' ' + className; | |
| }); |
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
| "{{ Copy/Move Code Block | |
| vnoremap <A-Up> :m '<-2<CR>gv=gv | |
| vnoremap <A-Down> :m '>+1<CR>gv=gv | |
| vnoremap <S-A-Up> :t '><CR>gv=gv | |
| vnoremap <S-A-Down> :t '<-1<CR>gv=gv | |
| ""}} |
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
| var file_put_contents = function (file_name, obj) { | |
| var blob = new Blob(["\ufeff", JSON.stringify(obj)], {type: "text/plain;charset=utf-8"}) | |
| var url = window.URL.createObjectURL(blob); | |
| var a = document.createElement('a'); | |
| a.href = url; | |
| a.download = file_name; | |
| a.style.visibility = 'hidden'; | |
| document.body.appendChild(a); | |
| a.click(); | |
| setTimeout(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
| var file_put_contents = function (file_name, data) { | |
| var a = document.createElement('a'); | |
| a.href = 'data:attachment/txt,%EF%BB%BF' + data; | |
| a.target = '_blank'; | |
| a.download = 'FacebookFriendsData.txt'; | |
| a.style.visibility = 'hidden'; | |
| document.body.appendChild(a); | |
| a.click(); | |
| setTimeout(function () { | |
| document.body.removeChild(a); |
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
| var range = new Array(1300); //準備1300個計數器 | |
| //計數器歸零 | |
| for(var i = 0, n = range.length; i < n; ++i){ | |
| range[i] = 0; | |
| } | |
| //連抽 130000 , 13000000, 13000000 次亂數 | |
| for(var i = 0, n = 13000000; i < n; ++i){ | |
| var now_result = (Math.random()*1300)^0; //取出 0~1299 間的亂數整數 |
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: gClipboard(function(r){ | |
| loadScript('http://img.xuite.net/_v_1.0.74/xui/combo/p/md5,cookie,swfupload,jeditable,json,colorpicker,userconfig/w/marquee,ad,dialog,locator,chosen,msgbridge,photoselector2,uploader,pinnedsite,tooltip,tripselector,mediaselector2,topshortcut,footer,articleselector,notice,fileselector'); | |
| var url = r.match(/curl ('[^']+')/)[1]; | |
| var data = r.match(/\-data ('[^']+')/)[1]; | |
| var tpl = function(){ | |
| $.ajax({ | |
| type: 'post', | |
| url: '__URL__', | |
| data: '__DATA__', | |
| beforeSend: function(xhr) { |
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
| //include('async_for') | |
| //include('jquery') | |
| var map = {}; | |
| async_for( | |
| {i:20}, | |
| function(_){ | |
| return _.i <=200; | |
| }, | |
| function(_){ | |
| _.i++; //也能寫成 this.i++; |
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
| var d = $.Deferred(); | |
| d.resolve(); | |
| var promise = d.promise(); | |
| promise.then(function(){ | |
| alert(123); | |
| promise.then(function(){ | |
| alert(456); | |
| }); | |
| alert(789); | |
| }); |
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
| var d = $.Deferred(); | |
| d.resolve(); | |
| var promise = d.promise(); | |
| promise.then(function(){ | |
| alert(123); | |
| promise.then(function(){ | |
| alert(456); | |
| }); | |
| alert(789); | |
| }); |
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
| 從 myfun4u 論壇產生 torrents RSS list | |
| URL: http://grassboy.tw/rss/myfun4u.php | |
| $_GET: { | |
| thread: [文章頁檔名 ex: thread-18904-1-1.html], | |
| selector: [能 select 到該頁面所有種子連結的 selector string], | |
| start_date: [顯示 torrent 清單時,最舊的種子要顯示的日期], | |
| step_day: [種子與種子間的日期間格] | |
| } |