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
async function main () { | |
try { | |
const res = await fetch('https://api.github.com/orgs/facebook'); | |
const json = await res.json(); | |
console.log(json); | |
} catch (e) { | |
// handle error | |
} | |
} |
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
Server listening on :: port 33333. | |
debug3: fd 5 is not O_NONBLOCK | |
debug1: Server will not fork when running in debugging mode. | |
debug3: send_rexec_state: entering fd = 8 config len 760 | |
debug3: ssh_msg_send: type 0 | |
debug3: send_rexec_state: done | |
debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8 | |
debug1: inetd sockets after dupping: 3, 3 | |
Connection from 99.254.XXX.XXX port 56834 on 158.69.75.XXX port 33333 | |
debug1: Client protocol version 2.0; client software version Go |
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
$ git push dokku@mydokku.com:phoenix master | |
Warning: Permanently added the ECDSA host key for IP address '8.8.8.8' to the list of known hosts. | |
+ case "$(lsb_release -si)" in | |
++ lsb_release -si | |
+ export DOKKU_DISTRO=ubuntu | |
+ DOKKU_DISTRO=ubuntu | |
+ export DOKKU_IMAGE=gliderlabs/herokuish | |
+ DOKKU_IMAGE=gliderlabs/herokuish | |
+ export DOKKU_LIB_ROOT=/var/lib/dokku |
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
source "https://supermarket.chef.io" | |
cookbook 'apt', '~> 2.7.0' | |
cookbook 'build-essential', '~> 2.2.3' | |
cookbook 'git', '~> 4.3.3' | |
cookbook 'heroku-toolbelt', '~> 0.1.0' | |
cookbook 'imagemagick', '~> 0.2.3' | |
cookbook 'nginx', '~> 2.7.6' | |
cookbook 'nodejs', '~> 2.4.0' | |
cookbook 'postgresql', '~> 3.4.20' |
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
input { | |
tcp { port => 3333 type => "json" } | |
stdin { | |
type => "stdin-type" | |
} | |
file { | |
type => "syslog" | |
path => [ "/var/log/*.log", "/var/log/messages", "/var/log/syslog" ] |
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
input { | |
tcp { port => 3333 type => "json event" codec => json_lines {} } | |
stdin { | |
type => "stdin-type" | |
} | |
file { | |
type => "syslog" | |
path => [ "/var/log/*.log", "/var/log/messages", "/var/log/syslog" ] |
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
#!/bin/sh | |
# init.d script for basexserver http://basex.org/ | |
# (c) 2012 Andy Bunce <bunce.andy@gmail.com>, BSD | |
# (c) 2015 Ashley Connor <ashconnor@me.com>, LICENSE AS ABOVE | |
### BEGIN INIT INFO | |
# Provides: basex-server | |
# Required-Start: $syslog | |
# Required-Stop: $syslog |
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
defmodule SocketPlayground do | |
def listen(port) do | |
listen(port, &handler/1) | |
end | |
def listen(port, handler) do | |
IO.puts "listen" | |
Socket.TCP.listen!(port, packet: :line) | |
|> accept(handler) | |
end |
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
#!/usr/bin/python | |
# Equivalent of "tail -f" as a webpage using websocket | |
# Usage: webtail.py PORT FILENAME | |
# Tested with tornado 2.1 | |
# Thanks to Thomas Pelletier for it's great introduction to tornado+websocket | |
# http://thomas.pelletier.im/2010/08/websocket-tornado-redis/ | |
import tornado.httpserver |
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
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |