made with esnextbin
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
worker_processes 2; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; |
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
package main | |
import ( | |
"bufio" | |
"net" | |
) | |
type Client struct { | |
incoming chan string | |
outgoing chan string |
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() { | |
'use strict'; | |
new Vue({ | |
el: '#beerApp', | |
data: { | |
botecos : [], | |
openDetails : [] | |
}, |
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
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
</head> | |
<script> | |
function checkForEC3Support() { | |
var video = document.createElement('video'); | |
return (video.canPlayType('audio/mp4;codecs="ec-3"') !== ''); | |
} |
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.prototype.partial = function() { | |
// CODE HERE | |
var fn = this, args = Array.prototype.slice.call(arguments); | |
return function() { | |
var replace = function(arr) { | |
var pos = 0; | |
return { | |
next : function() { | |
return arr[pos++]; |
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
'use strict'; | |
import Hapi from 'hapi'; | |
import Promise from 'bluebird'; | |
const server = new Hapi.Server(); | |
server.register([ | |
require('hapi-async-handler') | |
], function(error) { |
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
const moment = require('moment'); | |
function dayDiff(d1, d2) { | |
return Math.abs(moment(d2).diff(d1, 'days')); | |
} | |
const dateLen = { | |
'day' : 1, | |
'week' : 7, | |
'month': 31, |
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
/* | |
Given an array of integers, calculate which fraction of its elements are positive, which fraction of its elements are negative, and which fraction of its elements are zeroes, respectively. Print the decimal value of each fraction on a new line. | |
Note: This challenge introduces precision problems. The test cases are scaled to six decimal places, though answers with absolute error of up to 10−410−4 are acceptable. | |
Input Format | |
The first line contains an integer, NN, denoting the size of the array. | |
The second line contains NN space-separated integers describing an array of numbers (a0,a1,a2,…,an−1)(a0,a1,a2,…,an−1). |