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
# This shows the git log in a color-coded one line format, excludes merge commits | |
# and omits (grep -v) commits that mention 'chef'. It also places line numbers | |
# in front of the commits that are listed, for squashing on HEAD~# purposes. | |
gitlog() { | |
(git log -${@-20} --pretty=format:'%C(yellow)%h%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --no-merges | grep -v 'chef') | awk '{printf("%3d %s\n", NR, $0)}' | |
} |
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
# this is like saying "I made a bunch of changes in my release branch and I want to merge them to develop | |
# so that NOTHING CHANGES IN DEVELOP and so that no futher attempts to merge release branch to develop | |
# will every try to merge them" If there's an easier way to do this, let me nkow. | |
keepOurs() { | |
echo reset files deleted by only them | |
git status --porcelain | grep ^UD | cut -c 4- | xargs git reset | |
echo reset any new files | |
git status --porcelain | grep ^A | cut -c 4- | xargs git reset |
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
feat() { | |
git checkout develop | |
git pull | |
git checkout -b feature/DEB-"${@// /-}" | |
} |
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 findNameIn(obj, searchFor, ignoreCase, findPartial, parentPath, searched) { | |
var searchedObjects; | |
if(!searched) { | |
searchedObjects = [obj]; | |
} | |
else { | |
searchedObjects = searched; | |
} |
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
netstat -aon | where-object {$_ -like '*2222*'} |
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
// requires underscore.js or lodash.js | |
function findCssPropForSelector(className, prop) { | |
var rule; | |
_.each(document.styleSheets, function(ss) { | |
_.each(ss.cssRules, function(r) { | |
if(r.cssText.indexOf(className) >= 0) { | |
console.log('%s: %s', ss.href, r.style[prop]); | |
} | |
}); |
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
storage = { }; setInterval(function() { | |
if(storage.activeElement !== document.activeElement) { | |
storage.activeElement = document.activeElement; | |
console.log('new active element: %o', document.activeElement); | |
} | |
}, 100); |
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 getImageDimensions(path,callback) { | |
var img = new Image(); | |
img.onload = function () { | |
callback({ | |
width: img.width, | |
height: img.height | |
}); | |
}; | |
img.src = path; | |
} |
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
// this shows forwarding jQuery events to native events | |
// where the target is hard-coded | |
forwardEventTo: function(e) { | |
var iframeDocument = this.$el.find('iframe')[0].contentWindow.document; | |
var target = iframeDocument.elementFromPoint(e.offsetX, e.offsetY); | |
if (target) { | |
var props = _.extend(e.originalEvent, { | |
srcElement: target, |
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 InlineWorker = | |
(function() { | |
var handleMessage = function(msg) { | |
if(this.onmessage) { | |
this.onmessage(msg); | |
} | |
} | |
InlineWorker = function(workerFunc) { | |
var code = workerFunc.toString(); |
NewerOlder