⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
# remove any bad refs | |
git remote prune origin | |
# pipe into bash and auto-delete any branches that have been merged into master! | |
git log master --pretty=format:'%d' | grep '^ (origin' | tr -d ' ()' | sed 's/origin\//git push origin :/' |
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 socket = new Phoenix.Socket(PewMiddle.config.socketPath); | |
PewMiddle.requestGame = function(username, callback) { | |
socket.join(PewMiddle.config.channel, "lobby", {username: username}, function(channel) { | |
var player = null; | |
channel.on("player:created", function(message) { | |
player = message; | |
}); | |
channel.on("game:created", function(game) { | |
callback(game.id, player); |
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/bash | |
# This script can be used in "run & hope" mode or you can use it as a recipe to | |
# do things manually - you probably want the latter if you really care about | |
# the data in your databases. | |
# Happy hacking | |
# /Eoin/ | |
# Tell bash to stop if something goes wrong | |
set -e |
$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769
Note the running on port
for epmd
itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:
$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host
I've taken the benchmarks from Matthew Rothenberg's phoenix-showdown, updated Phoenix to 0.13.1 and ran the tests on the most powerful machines available at Rackspace.
Framework | Throughput (req/s) | Latency (ms) | Consistency (σ ms) |
---|
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
// 1. Add Bootstrap as a dependency in package.json | |
{ | |
... | |
"dependencies": { | |
... | |
"bootstrap": "~3.3.6" | |
} | |
} |
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 DrainStop do | |
@moduledoc """ | |
DrainStop Attempts to gracefully shutdown an endpoint when a normal shutdown | |
occurs. It first shuts down the acceptor, ensuring that no new requests can be | |
made. It then waits for all pending requests to complete. If the timeout | |
expires before this happens, it stops waiting, allowing the supervision tree | |
to continue its shutdown order. | |
DrainStop should be installed in your supervision tree *after* the | |
EndPoint it is going to drain stop. |
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/bash | |
# installing erlang on ubuntu's | |
VERSION="R15B01" | |
sudo apt-get install build-essential libncurses5-dev openssl libssl-dev | |
sudo mkdir -p /opt/erlang/ | |
curl -O https://raw.github.com/spawngrid/kerl/master/kerl && chmod a+x kerl | |
sudo mv kerl /opt/erlang/ |
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
cat > Dockerfile <<'DOCKERFILE' | |
FROM yugabytedb/yugabyte:latest | |
ADD start.sh . | |
RUN chmod a+x start.sh | |
ENV RF=3 | |
CMD ./start.sh | |
DOCKERFILE | |
cat > start.sh <<'START' |
OlderNewer