Note: Don't do this on a production evniroment!
Get the heroku database name:
heroku pg:infoName can be found in the reponse from the command above. For example: Add-on: soaring-newly-1337.
| defmodule MyApp.Redix do | |
| @pool_size 5 | |
| # How long, in seconds, to keep messages in the backlog | |
| @max_backlog_age 604800 | |
| # How many messages may be kept in the global backlog | |
| @max_global_backlog_size 2000 | |
| # How many messages may be kep in the per-channel backlog | |
| @max_backlog_size 1000 | |
Note: Don't do this on a production evniroment!
Get the heroku database name:
heroku pg:infoName can be found in the reponse from the command above. For example: Add-on: soaring-newly-1337.
| # Using the erlang mechanism of tuple modules it is possible to create a "stateful module". | |
| # This concept of a stateful module is discussed in "Programming erlang" Second edition. | |
| defmodule User do | |
| defstruct name: nil, admin: false, internal: "kinda private" | |
| def new(name, options \\ []) do | |
| dependencies = struct(%__MODULE__{name: name}, options) | |
| {__MODULE__, dependencies} |
| config :my_app, :twitter_api, | |
| client: Twitter.SandboxClient |
| defmodule MyApp do | |
| use Application | |
| def start(_type, _args) do | |
| import Supervisor.Spec, warn: false | |
| children = [ | |
| Plug.Adapters.Cowboy.child_spec(:http, MyApp.Router, [], [ | |
| dispatch: dispatch | |
| ]) |
| function makeStyle(defaults, tagName) { | |
| tagName = tagName || 'div'; | |
| var Style = React.createClass({ | |
| getDefaultProps: function() { | |
| return assign({}, defaults); | |
| }, | |
| render: function() { | |
| var style = assign({}, this.props); | |
| delete style.children; |
| var Style = React.createClass({ | |
| render: function() { | |
| var style = assign({}, this.props); | |
| delete style.children; | |
| return React.createElement( | |
| 'div', | |
| {style: style, children: this.props.children} | |
| ); | |
| } |
| #!/usr/bin/env ruby -wKU | |
| # | |
| # by Kelan Champagne | |
| # http://yeahrightkeller.com | |
| # | |
| # A script to generate a personal podcast feed, hosted on Dropbox | |
| # | |
| # Inspired by http://hints.macworld.com/article.php?story=20100421153627718 | |
| # | |
| # Simply put this, and some .mp3 or .m4a files in a sub-dir under your Dropbox |
| #!/bin/sh | |
| tm() { | |
| if [ -z $1 ]; then | |
| tmux switch-client -l | |
| else | |
| if [ -z "$TMUX" ]; then | |
| tmux new-session -As $1 | |
| else | |
| if ! tmux has-session -t $1 2>/dev/null; then | |
| TMUX= tmux new-session -ds $1 |