This file contains 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
//events - a super-basic Javascript (publish subscribe) pattern | |
var events = { | |
events: {}, | |
on: function (eventName, fn) { | |
this.events[eventName] = this.events[eventName] || []; | |
this.events[eventName].push(fn); | |
}, | |
off: function(eventName, fn) { | |
if (this.events[eventName]) { |
This file contains 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
const request = require('request') | |
const requestStream = require('request-stream'); | |
const EventEmitter = require('events'); | |
const intervalManager = require('./intervals-manager') | |
var speed = 100; | |
var loop = 100; | |
class Rodi extends EventEmitter { | |
constructor( url ) { |
This file contains 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
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import './index.css'; | |
function Square( props ) { | |
return ( | |
<button className="square" onClick={props.onClick}> | |
{props.value} | |
</button> | |
); |
This file contains 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 context; | |
var url = 'http://localhost:5000/intro.mp3' | |
function init() { | |
try { | |
window.AudioContext = window.AudioContext || window.webkitAudioContext; | |
context = new AudioContext(); | |
} | |
catch(e) { | |
alert("Web Audio API is not supported") |
This file contains 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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
var fTicket = "20:48:15" | |
var interval = 5 |
This file contains 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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"time" | |
) | |
func main() { | |
dog := Dog{1, "bowser", "husky", time.Now()} |
This file contains 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 isThisActuallyANumberDontLie( data ){ | |
return ( typeof data === "number" && !isNaN(data) ); | |
} | |
function checkValidZip(input) { | |
console.log("input number", input); | |
var entry = input; | |
var userZip = parseInt(entry); | |
try { |
This file contains 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 SpeedTest = function(testImplement,testParams,repetitions) { | |
this.testImplement = testImplement; | |
this.testParams = testParams; | |
this.repetitions = repetitions || 10000; | |
this.average = 0; | |
}; | |
SpeedTest.prototype = { | |
startTest: function() { | |
if (this.testImplement(this.testParams) === false) { |
This file contains 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
import React from 'react'; | |
export default class CommentBox extends React.Component { | |
constructor() { | |
super(); | |
this.state = { | |
showComments: false | |
}; | |
} |
This file contains 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
import React from 'react'; | |
export default class CommentBox extends React.Component { | |
render() { | |
const comments = this._getComments(); | |
return( | |
<div className="comment-box"> | |
<h3>Comments</h3> | |
<h4 className="comment-count">{this._getCommentsTitle( comments.length )}</h4> | |
<div className="comment-list"> |