View this code at http://livecoding.io/3981538
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
| #!/usr/bin/env python | |
| from distutils.core import setup | |
| setup(name='Zachs script', | |
| version='1.0', | |
| description='Zach is the man', | |
| author='Zach', | |
| author_email='zach@zach.com', | |
| packages=['mypackage'], |
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
| // Self-calling named function which takes an array of elements | |
| // calls an event on the first element in that array and passes | |
| // the rest of the array to that function recursively until the | |
| // array is empty. The recursive call is done in the callback of | |
| // the previous element's event so that it nicely waits for the | |
| // previous element to be done. | |
| (function hidenext(jq) { | |
| jq.eq(0).fadeOut("fast", function(){ |
Infernal Affairs - Hong Kong
Les émotifs anonymes - France
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
| /** | |
| * Returns a value or array of values by traversing the `object` using `path` | |
| * | |
| * @param object {Object} | |
| * @param path {String} | |
| * @returns value {String, Array} | |
| * | |
| * traverseObject({a: {b: [{c: {d: 'gotcha!'}}, {c: {d: 'yes!'}}]}}, 'a__b____c__d'); | |
| * --> ['gotcha!', 'yes!'] | |
| * traverseObject({a: {b: [{c: 'gotcha!'}, {c: 'yes!'}]}}, 'a__b____c'); |
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
| require 'octokit' | |
| require 'csv' | |
| require 'date' | |
| # Description: | |
| # Exports Github issues from one or more repos into CSV file formatted for import into JIRA | |
| # Note: By default, all Github comments will be assigned to the JIRA admin, appended with | |
| # a note indicating the Github user who added the comment (since you may not have JIRA users | |
| # created for all your Github users, especially if it is a public/open-source project: | |
| # |
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
| // We're providing some convenience functions here as well as making sure | |
| // chai tests don't fall on jshint errors by remapping true/false properties | |
| chai.Assertion.addProperty('_true', function () { | |
| this.assert( | |
| true === this.__flags.object, | |
| 'expected #{this} to be true', | |
| 'expected #{this} to be false', | |
| this.negate ? false : true | |
| ); | |
| }); |
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
| // More explicit example of | |
| // http://stackoverflow.com/questions/518000/is-javascript-a-pass-by-reference-or-pass-by-value-language | |
| // | |
| // When you change the `item` property of the object referenced by `obj1`, you are changing the value | |
| // of the `item` property that was originally set to 'unchanged'. When you assign `obj2` a value of | |
| // {item: 'changed'} you are changing the reference to a new object. This object immediately goes out | |
| // of scope when the function exits. | |
| function changeStuff(_num, _obj1, _obj2) { | |
| _num = _num * 10; |
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
| /** | |
| * Move path method // hack for getting all svg icons | |
| * working the same way | |
| */ | |
| var movePath = function (x, y) { | |
| var path = Raphael.pathToRelative(this.attrs.path), | |
| dim = Raphael.pathBBox(this.attrs.path), | |
| dx = (path[0][1] - dim.x) + (x * 100), | |
| dy = (path[0][2] - dim.y) + (y * 100); | |
| path[0][1] = dx; |
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
| na.iconCreator = function (x, y, width, height, iconName, hoverTitle, sstr) { | |
| var p = this.properties, | |
| dim = this.wrapper.getBBox(), | |
| wx = _.isFunction(x) ? x(dim) : x, wy = _.isFunction(y) ? y(dim) : y, | |
| r = this.paper.rect(wx, wy, width, height), | |
| i = this.paper.path(na.icons[iconName]); | |
| set = this.paper.set(); | |
| tstr = (sstr || 'S0.05,0.05,0,0') + 'T' + wx + ',' + wy; | |
| // This is a hack to get all icons doing the same thing |