This file contains 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
$($0 || 'body').find('input[type=text], input[type=text], textarea,input[type=password]').filter(':visible').each(function(){ | |
if( $(this).attr('type')==='password' ) | |
return $(this).val('12345678'); | |
if( $(this).attr('id')==='email' || $(this).attr('name')==='email' ) | |
return $(this).val('[email protected]'); | |
if( $(this).attr('name') == 'cvv2' ) | |
return $(this).val('123'); | |
This file contains 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 @dir /O:G %* > ls.bat | |
copy /A ls.bat ll.bat | |
echo C:\wamp\bin\php\php5.3.13\php.exe %* > php.bat | |
echo php "C:\wamp\bin\php\php5.3.13\composer.phar" %* > composer.bat | |
echo ipconfig | find "Adres IPv4" > myip.bat | |
echo @for %%e in (%PATHEXT%) do @for %%i in (%1%%e) do @if NOT "%%~$PATH:i"=="" echo %%~$PATH:i > whereis.bat |
This file contains 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
jQuery.fn.loadSerializedData = function(data) | |
{ | |
var dataObj = {}, | |
keyValPair; | |
data = data.split('&'); | |
for (var i = 0, length = data.length; i < length; i++) { | |
keyValPair = data[i].split('='); | |
dataObj[decodeURIComponent(keyValPair[0])] = decodeURIComponent(keyValPair[1]); | |
} | |
This file contains 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(field, scope) { | |
var id, | |
allIds = {}, | |
elementsWithId = scope.querySelectorAll('[' + field + ']'); | |
Array.prototype.forEach.call(elementsWithId, function(elem) { | |
if(field.substr(0,5) === 'data-') { | |
id = elem.dataset[field.substr('5')]; | |
} else { | |
id = elem[field]; |
This file contains 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
$('body').find('a').each(function(){ | |
var dis = $(this); | |
$.ajax( dis.attr('href'), { | |
method:'GET', | |
beforeSend: function(){}, | |
crossDomain: true //remove X-Requested-With | |
}) | |
.complete(function(xhr){ | |
if(xhr.status < 200 || xhr.status >= 400) | |
console.log('link error', dis, xhr) |
This file contains 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 testReplies = 10000, | |
use$ = false, | |
testCode = function() { | |
/* code to test */ | |
//when use$ is enabled, $(this) is #actionBox, use it as your container | |
//#actionBox will be removed after test | |
}, | |
actionBoxConfigure = function(){ | |
/* put elements into actionBox here */ |
This file contains 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() { | |
var makeWebsiteCreazy = function() { | |
var toanim = document.querySelectorAll('h1,h2,h3,h4,h5,img,input'); //,div:last-child | |
window.onscroll = function() { | |
[].forEach.call(toanim, function(el) { | |
var pickOne = parseInt( Math.random() * 6 ) + 1; | |
el.style.transition = 'all 2000ms ease-in-out'; | |
el.style.transform = "scale(" + (pickOne==1 ? Math.random()*1.5 : 1) + ') rotate('+( pickOne==2 ? Math.random()*90 : 0 )+'deg) translateX('+( pickOne==3 ? Math.random()*20 : 0 )+'px) translateY('+( pickOne==4 ? Math.random()*20 : 0 )+'px) skewX('+( pickOne==5 ? Math.random()*90 : 0 )+'deg) skewY('+( pickOne==6 ? Math.random()*90 : 0 )+'deg)'; | |
}); |
This file contains 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
@moved to: https://github.com/korpirkor/live-google-webfont-switcher/ |
This file contains 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
// Make it safe to do console.log() always. | |
(function (c) { | |
var method, | |
d = function() {}, | |
m = 'assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,\ | |
groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn' | |
.split(','); | |
while (method = m.pop()) { | |
c[method] || (c[method] = d); | |
} |
This file contains 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
// run test in you javascript console. | |
var info = console.log, test = (function() { | |
var result = function(code) { | |
return result.codePad(code, eval(code)); | |
}, | |
strPad = function(str, pad) { | |
var len = str.length; | |
return len >= pad ? str : Array(pad - len + 1).join(' ') + str; | |
} |
OlderNewer