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
| eval $(ssh-agent) | |
| ssh-add | |
| #you want to save for ever? run this one | |
| ssh-add -k |
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
| git branch --merged | egrep -v "(^\*|master|development|beta)" | xargs git branch -d |
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
| const getLocalTime = (date, offset) => { | |
| const utc = date.getTime() - (date.getTimezoneOffset() * 60000); | |
| const corrected = new Date(utc + (3600000 * offset)); | |
| return { | |
| hours: corrected.getHours(), | |
| minutes: corrected.getMinutes(), | |
| }; | |
| }; | |
| // Tehran Local Time |
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
| //put a debugger where ajax_delete_sms_message calls del and type this in console | |
| //del = function () {}; | |
| //this fuction is supper heavy and we are trying to bypass it | |
| //one of the messages will be removed now inpect yes button again in next msg delete modal | |
| //and type this snippet | |
| //i is the id of first msg and j is a simple counter | |
| var i = '1366'; | |
| var j = '0'; | |
| var timer = setInterval(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
| curl -I http://pathtosite.com | |
| #this should contain Access-Control-Allow-Origin: header |
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 makeRandom (min, max) { | |
| return Math.floor( Math.random() * (max - min + 1) + min ) | |
| } |
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 factory() { | |
| var highlander = { | |
| name: 'MacLeod' | |
| }; | |
| return { | |
| get: function get() { | |
| return highlander; | |
| } | |
| }; |
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
| convertObjectToArray = function (obj, mergedPropName) { | |
| var arr = []; | |
| for (prop in obj) { | |
| if (!obj.hasOwnProperty(prop)) | |
| continue; | |
| var newObj = obj[prop]; | |
| newObj[mergedPropName] = prop; | |
| arr.push(newObj); | |
| } |
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
| QUnit.pending = function() { | |
| QUnit.test('(Pending...) ' + arguments[0], function() { | |
| QUnit.expect(0);//dont expect any tests | |
| var li = document.getElementById(QUnit.config.current.id); | |
| QUnit.done(function() { | |
| li.style.background = '#FFFF99'; | |
| }); | |
| }); | |
| }; | |
| pending = QUnit.pending; |
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
| //Originally by Ryan Lynch | |
| function extend(){ | |
| for(var i=1; i<arguments.length; i++) | |
| for(var key in arguments[i]) | |
| if(arguments[i].hasOwnProperty(key)) | |
| arguments[0][key] = arguments[i][key]; | |
| return arguments[0]; | |
| } |