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
| [mergetool] | |
| prompt = false | |
| keepBackup = false | |
| keepTemporaries = false | |
| [merge] | |
| tool = winmerge | |
| [mergetool "winmerge"] | |
| name = WinMerge |
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
| // see blog post: http://www.hiddentao.com/archives/2013/07/08/generate-overridable-getters-and-setters-in-javascript/ | |
| Function.prototype.generateProperty = function(name, options) { | |
| // internal member variable name | |
| var privateName = '__' + name; | |
| options = options || {}; | |
| options.get = ('undefined' === typeof options.get ? true : options.get ); | |
| options.set = ('undefined' === typeof options.set ? true : options.set ); | |
| // pre-initialise the internal variable? |
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 safeJSONStringify (input, maxDepth) | |
| { | |
| var output, | |
| refs = [], | |
| refsPaths = []; | |
| maxDepth = maxDepth || 5; | |
| function recursion (input, path, depth) |
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
| mat4 rotationMatrix(vec3 axis, float angle) | |
| { | |
| axis = normalize(axis); | |
| float s = sin(angle); | |
| float c = cos(angle); | |
| float oc = 1.0 - c; | |
| return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0, | |
| oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0, | |
| oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0, |
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
| // Just do this : (and include backbone.js) | |
| var Kind = function() { | |
| this.initialize && this.initialize.apply(this, arguments); | |
| }; | |
| Kind.extend = Backbone.Model.extend | |
| //Simpler | |
| var Thing = function() {}; | |
| Thing.extend = Backbone.Model.extend |
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
| /** | |
| * Cubic Bezier CSS3 transitions emulator | |
| * | |
| * See this post for more details | |
| * http://st-on-it.blogspot.com/2011/05/calculating-cubic-bezier-function.html | |
| * | |
| * Copyright (C) 2011 Nikolay Nemshilov | |
| */ | |
| function Bezier(p1,p2,p3,p4) { | |
| // defining the bezier functions in the polynomial form |
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
| ci::Vec3f mRight, mUp; | |
| _mayaCam.getCamera().getBillboardVectors(&mRight, &mUp); | |
| ci::gl::drawBillboard( ci::Vec3f::zero(), ci::Vec2f(100.0f, 100.0f), 0.0f, mRight, mUp); |
NewerOlder