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 clone(param) { | |
| function cloneArray(arr) { | |
| var clonedArr = []; | |
| for(var el in arr) { | |
| clonedArr.push(clone(arr[el])); | |
| } | |
| return clonedArr; | |
| } |
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
| var Company = function() { | |
| for(var m in this) { | |
| if(typeof(this[m]) !== "function") { | |
| this[m] = $.extend(true, {}, this[m]) | |
| } | |
| } | |
| } | |
| Company.prototype.office = { | |
| address: { | |
| 'street': 'A' |
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
| var explore = function(root) { | |
| for(var v in root._subviews) { | |
| var view = root._subviews[v]; | |
| var data = { | |
| name: view.className, | |
| element: view.el, | |
| view: view | |
| } | |
| console.log(data) | |
| explore(view) |
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
| body { | |
| margin: 0; | |
| padding: 0; | |
| background-color: #ccc; | |
| } | |
| section { | |
| background-color: #FFF; | |
| min-width: 1056px; | |
| } | |
| ol { |
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
| // only webkit, please | |
| var DoFreq = 261; | |
| var SiFreq = 494; | |
| var rangeFreq = DoFreq - SiFreq; | |
| var context = new webkitAudioContext(); | |
| var sineWave = context.createOscillator(); | |
| sineWave.connect(context.destination); | |
| sineWave.noteOn(1); | |
| window.addEventListener('mousemove', function(ev) { | |
| var totalSize = window.document.width; |
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
| // only webkit, please | |
| var Instrument = function() { | |
| var self = this; | |
| this.context = new webkitAudioContext(); | |
| this.sineWave = this.context.createOscillator(); | |
| this.sineWave.connect(this.context.destination); | |
| this.play = function() { | |
| self.sineWave.noteOn(1); | |
| }; | |
| this.stop = 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
| // only webkit, please | |
| // bookmarklet: | |
| // javascript:(function(){var context = new webkitAudioContext(); var sineWave = context.createOscillator(); sineWave.connect(context.destination); sineWave.noteOn(1); var text = document.body.innerHTML.split(''); var read = function(text, sineWave) { var char = text.pop(); var value = char.charCodeAt(0); sineWave.frequency.value = value * 10; setTimeout(function() { read(text, sineWave); }.bind(this), 50); }; read(text, sineWave);})() | |
| var context = new webkitAudioContext(); | |
| var sineWave = context.createOscillator(); | |
| sineWave.connect(context.destination); | |
| sineWave.noteOn(1); |
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 reverseColors(colors) { | |
| var reversed = {} | |
| for(var color in colors) { | |
| reversed['inverted_' + color] = {}; | |
| for(var i in colors[color]) { | |
| reversed['inverted_' + color][i] = colors[color][i].reverse(); | |
| } | |
| } | |
| return reversed; | |
| } |
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
| //FightCode can only understand your robot | |
| //if its class is called Robot | |
| var Robot = function(robot) { | |
| }; | |
| Robot.prototype.seed = 1; | |
| Robot.prototype.detected = false; | |
| Robot.prototype.heading = false; | |
| Robot.prototype.onIdle = function(ev) { |
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
| DATABASES = { | |
| 'default': { | |
| 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. | |
| 'NAME': 'vinyl', # Or path to database file if using sqlite3. | |
| 'USER': 'root', # Not used with sqlite3. | |
| 'PASSWORD': '', # Not used with sqlite3. | |
| 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. | |
| 'PORT': '', # Set to empty string for default. Not used with sqlite3. | |
| } | |
| } |
OlderNewer