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
| // Regular Expression of Special Characters | |
| isSpecialCharRegex = /[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi; |
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 bline(x0, y0, x1, y1) { | |
| var dx = Math.abs(x1 - x0), sx = x0 < x1 ? 1 : -1; | |
| var dy = Math.abs(y1 - y0), sy = y0 < y1 ? 1 : -1; | |
| var err = (dx>dy ? dx : -dy)/2; | |
| while (true) { | |
| setPixel(x0,y0); | |
| if (x0 === x1 && y0 === y1) break; | |
| var e2 = err; |
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/python | |
| #======================================================================= | |
| # Author: Amruthaluri Kiran Kumar ([email protected]) | |
| # Title: Linear Search implementation | |
| #======================================================================= | |
| def linearSearch(list, item): | |
| for j in list: | |
| if item == j: |
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
| { | |
| "name": "flare", | |
| "children": [ | |
| { | |
| "name": "analytics", | |
| "children": [ | |
| { | |
| "name": "cluster", | |
| "children": [ | |
| {"name": "AgglomerativeCluster", "size": 3938}, |
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
| window.AudioContext = window.AudioContext || | |
| window.webkitAudioContext; | |
| var context = new AudioContext(); | |
| navigator.getUserMedia({audio: true}, function(stream) { | |
| var microphone = context.createMediaStreamSource(stream); | |
| var filter = context.createBiquadFilter(); | |
| // microphone -> filter -> destination. |
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 onVideoFail(e) { | |
| console.log('webcam fail!', e); | |
| }; | |
| function hasGetUserMedia() { | |
| // Note: Opera is unprefixed. | |
| return !!(navigator.getUserMedia || navigator.webkitGetUserMedia || | |
| navigator.mozGetUserMedia || navigator.msGetUserMedia); | |
| } |
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 http = require('http'), | |
| fs = require('fs'), | |
| util = require('util'); | |
| http.createServer(function (req, res) { | |
| var path = 'video.mp4'; | |
| var stat = fs.statSync(path); | |
| var total = stat.size; | |
| if (req.headers['range']) { | |
| var range = req.headers.range; |
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
| /* | |
| * Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js | |
| */ | |
| var http = require('http'), | |
| fs = require('fs'), | |
| util = require('util'); | |
| http.createServer(function (req, res) { | |
| var path = 'video.mp4'; |
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>BASE 64 Data</title></head> | |
| <body> | |
| <canvas width="500" height="200"></canvas> | |
| <script> | |
| window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || | |
| window.MozBlobBuilder || window.MSBlobBuilder; | |
| window.URL = window.URL || window.webkitURL; | |
| window.onload = 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>D3 Symbols</title> | |
| </head> | |
| <body> | |
| <div id="wrapper"> | |
| </div> | |
| <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> | |
| <script> |