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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Tournament Bracket Generator</title> | |
| <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script> | |
| <script src="http://underscorejs.org/underscore-min.js"></script> | |
| <script> | |
| $(document).on('ready', function() { | |
| var knownBrackets = [2,4,8,16,32], // brackets with "perfect" proportions (full fields, no byes) |
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 list = [9,1,7,3,4,2,8,0,5,6]; | |
| function chunk(list) { | |
| var chunks = []; | |
| for(var i=0; i<list.length; i++) { | |
| if(list.length % 2 == 1 && i+1 == list.length) { | |
| chunks.push(list[i]); | |
| } else { | |
| if(i % 2 == 0) { | |
| chunks.push(Math.max(list[i], list[i+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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Custom Street View panorama tiles</title> | |
| <meta charset="utf-8"> | |
| <style> | |
| html, body, #map-canvas { | |
| height: 100%; | |
| margin: 0px; | |
| padding: 0px |
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
| // http://apis.is/cyclecounter | |
| // particle webhook GET ice_bikes "http://apis.is/cyclecounter" | |
| // Jordans-MacBook-Pro:~ jshaw$ particle webhook GET ice_bikes "http://apis.is/cyclecounter" | |
| // Sending webhook request { uri: 'https://api.particle.io/v1/webhooks', | |
| // method: 'POST', | |
| // json: | |
| // { event: 'ice_bikes', | |
| // url: 'http://apis.is/cyclecounter', | |
| // deviceid: undefined, |
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
| int ledPin = D2; | |
| int ledPin7 = D7; | |
| int newLike = 0; | |
| int locationChange = 0; | |
| int i = 0; | |
| unsigned long previousTime; | |
| int interval = 5000; |
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 json2csv = require('json2csv'); | |
| var jsonfile = require('jsonfile'); | |
| var fs = require('fs'); | |
| var fields = ['Body', 'DateCreated', 'timestamp']; | |
| var file = './jsontest_edit.json'; | |
| var import_json = ""; | |
| jsonfile.readFile(file, function(err, obj) { | |
| console.dir(obj); | |
| import_json = obj; |
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
| // taken from https://github.com/arduino/Arduino/issues/3934 | |
| // its an alternative to: https://www.arduino.cc/en/Tutorial/Smoothing | |
| const int filterWeight = 4; // higher numbers = heavier filtering | |
| const int numReadings = 10; | |
| int average = 0; // the average | |
| void setup() { | |
| // initialize serial communication with computer: |
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 playVideoOnClick (selector) { | |
| el = document.querySelector(selector); | |
| if (el) { | |
| addListener(); | |
| } else { | |
| window.addEventListener('load', addListener); | |
| } | |
| function addListener () { |
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
| # --------------------------------------------------------------------------- | |
| # | |
| # Description: This file holds all my BASH configurations and aliases | |
| # | |
| # Sections: | |
| # 1. Environment Configuration | |
| # 2. Make Terminal Better (remapping defaults and adding functionality) | |
| # 3. File and Folder Management | |
| # 4. Searching | |
| # 5. Process Management |