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
if test -z $1 || test -z $2 | |
then | |
printf "Usage: clone-database heroku-app-name database-name\n" | |
exit | |
fi | |
echo "Capturing backup" | |
heroku pgbackups:capture -e -a $1 | |
echo "Pulling dump" | |
curl -o /tmp/$1-latest.dump `heroku pgbackups:url -a $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
gem 'rest-client', '~> 1.6.7' | |
gem 'nokogiri' |
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("/ws"); | |
socket.join("ship", "topic", {}, function(channel) { | |
channel.on("connect", function(message) { | |
console.log("joined") | |
}) | |
}); |
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 Pew.Ship do | |
use Phoenix.Channel | |
:timer.apply_interval(1000, __MODULE__, :gc, []) | |
def gc() do | |
IO.puts "stuff" | |
end | |
def join(socket, "join", msg) do |
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 | |
# Get the ip from boot2docker | |
boot2docker_ip=$(sudo -u $SUDO_USER boot2docker ip 2>&1 | awk '{ print $NF }' | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n//g') | |
hosts=`cat /etc/hosts | sed "s/^.*localdocker.*$//g"` | |
echo "$hosts" > /etc/hosts | |
echo "$boot2docker_ip localdocker" >> /etc/hosts | |
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
17:06:25.586 [error] #PID<0.258.0> running Spacegame.Endpoint terminated | |
Server: localhost:4000 (http) | |
Request: GET /ws | |
** (exit) an exception was raised: | |
** (ErlangError) erlang error: [reason: %Protocol.UndefinedError{description: nil, protocol: String.Chars, value: %{"thin" => "one"}}, mfa: {Phoenix.Endpoint.CowboyHandler, :websocket_handle, 3}, stacktrace: [{String.Chars, :impl_for!, 1, [file: 'lib/string/chars.ex', line: 3]}, {String.Chars, :to_string, 1, [file: 'lib/string/chars.ex', line: 17]}, {Logger, :truncate, 2, [file: 'lib/logger.ex', line: 492]}, {Logger, :log, 3, [file: 'lib/logger.ex', line: 404]}, {Spacegame.GameChannel, :event, 3, [file: 'web/channels/game.ex', line: 44]}, {Phoenix.Channel.Transport, :dispatch, 4, [file: 'lib/phoenix/channel/transport.ex', line: 102]}, {Phoenix.Channel.Transport, :dispatch, 4, [file: 'lib/phoenix/channel/transport.ex', line: 67]}, {Phoenix.Transports.WebSocket, :ws_handle, 2, [file: 'lib/phoenix/transports/websocket.ex', line: 45]}], msg: {:text, "{\"cha |
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 fs = require( 'fs' ), | |
Encoder = require( 'node-html-encoder' ).Encoder, | |
MachineGroupService = require( '../../core/services/MachineGroupService.js' ), | |
ApplicationService = require( '../../core/services/ApplicationService.js' ), | |
path = require( 'path' ), | |
walk = require('../utilities/DirectoryWalker.js'), | |
ApplicationService = require( '../../core/services/ApplicationService.js' ), | |
appService = new ApplicationService(), | |
uaParser = require('ua-parser'); |
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
setPlaylist: function( tracks, icd_id, callback ) { | |
//use track to find album and track number | |
//all tracks on album with higher track number than | |
//this should be added to `media_playlist` table | |
//( maybe clear `media_playlist` out first? ) | |
// console.log( 'AudioRepository.setPlaylist(): not yet implemented!!' ); | |
var q = squel.delete().from( 'media_playlist' ).where("ecms_id=" + icd_id); | |
this._delete( q.toString(), function( result ) { | |
var i = 0; |
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
defimpl Plug.Exception, for: Ecto.NoResultsError do | |
def status(_exception), do: 404 | |
end |
OlderNewer