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"; "math") | |
type Circle struct { | |
x, y, r float64 | |
} | |
type Rectangle struct { | |
x1, y1, x2, y2 float64 |
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"; "math") | |
type Circle struct { | |
x, y, r float64 | |
} | |
type Rectangle struct { | |
x1, y1, x2, y2 float64 |
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 regex( str ) { | |
console.log(/EXISTS/.test(str)) | |
} | |
regex( process.argv[2] ); |
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 http = require('http'); | |
var url = process.argv[2]; | |
// ej: http://www.html5rocks.com/en/tutorials/es6/promises/story.json | |
function get(url) { | |
return new Promise(function(resolve, reject){ | |
http.get(url, function (res) { | |
if (res.statusCode === 200) { | |
res.setEncoding('utf8'); |
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 iterate (num) { | |
console.log(num); | |
return ++num; | |
}; | |
function alwaysThrows () { | |
throw new Error("OH NO!!!"); | |
}; | |
Promise.resolve(iterate(1)) |
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
<!doctype html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<div> | |
<p>score 1:</p> | |
<iframe id="soundslice-score" src="https://www.soundslice.com/scores/12802/embed/?api=1" width="100%" height="500" frameborder="0" allowfullscreen=""></iframe> | |
<script type="text/javascript"> |
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
// Array#map() for async! | |
function counter (limit, callback) { | |
var count = 0; | |
return function () { | |
count++; | |
if (count === limit) | |
callback(); | |
} | |
} |
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 countdownTimer(target, timeLeft, options = {}) { | |
let defaults = { | |
container: ".timer-display", | |
timeUnit: "seconds", | |
clonedDataAttribute: "cloned", | |
timeoutClass: ".is-timeout", | |
timeoutSoonClass: ".is-timeout-soon", | |
timeoutSoonTime: 10 | |
}; |
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"> |
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 | |
}; | |
} |
OlderNewer