First add your twitter username and password. Then server.rb and once it's started open websocket.html in your browser. You should see some tweets appear. If not take a look at the javascript console.
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
raise ClientError(operation_name='InvalidKeyPair.Duplicate', error_response={ | |
'Error': { | |
'Code': 'Duplicate', | |
'Message': 'This is a custom message' | |
} | |
} | |
) |
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
# Change these variables as necessary. | |
MAIN_PACKAGE_PATH := ./cmd/example | |
BINARY_NAME := example | |
# ==================================================================================== # | |
# HELPERS | |
# ==================================================================================== # | |
## help: print this help message | |
.PHONY: help |
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
// Interval time to check if runtime is disconnected | |
interval = 1000 * 60; | |
// Busy/Reconnect button top-right | |
reloadButton = document.querySelector('#connect > paper-button > span') | |
setInterval(() => { | |
if (reloadButton.innerText == 'Reconnect') { | |
reloadButton.click(); | |
console.log('Restarting'); |
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
require 'singleton' | |
class SimpleLogger | |
include Singleton | |
attr_accessor :level | |
ERROR=1 | |
WARNING=2 | |
INFO=3 |
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
# https://github.com/eproxus/meck | |
# add meck as a dependency in mix.exs | |
defmodule GithubIssuesTest do | |
use ExUnit.Case | |
import :meck | |
setup_all do | |
new(Issues.GithubIssues) | |
on_exit fn -> unload 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
daemon off; | |
# Heroku dynos have at least 4 cores. | |
worker_processes <%= ENV['NGINX_WORKERS'] || 4 %>; | |
events { | |
use epoll; | |
accept_mutex on; | |
worker_connections 1024; | |
} |
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
// http://stackoverflow.com/questions/3291712/is-it-possible-to-open-a-popup-with-javascript-and-then-detect-when-the-user-clo | |
// The window.opener property refers to the page that spawned this popup. | |
// For example, if I wrote a function named callingPageFunction on my original page, I would call it from the popup like this: | |
$(window).unload(function() { | |
window.opener.callingPageFunction() | |
}); | |
var wnd = window.open("file.html", "youruniqueid", "width=400, height=300"); |
To add a value to a secret we need to ensure it is base64 encoded without whitespace
E.g.
echo -n 'true' | base64 -w0
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
# example multistage process docker build script from https://blog.phusion.nl/2016/08/31/efficiently-and-conveniently-building-ruby-and-node-js-application-docker-containers-for-production-2 | |
set -e | |
export IMAGE_NAME=tinco/express-example | |
export RUN_BUILD="docker run -it --rm -v $PWD:/usr/src/app -w /usr/src/app node:6" | |
export TEST_COMMAND="./node_modules/mocha/bin/mocha" | |
function run_image() { |
NewerOlder