A web UI, maybe a phoenix app, or something simpler.
Toniq.failed_jobs
Toniq.retry(job)
Toniq.delete(job)
#!/bin/sh | |
UNICORN_CONF="/data/<%= @app_name %>/shared/config/unicorn.rb" | |
UNICORN_EXEC="bundle exec unicorn" | |
UNICORN_PID="/var/run/<%= @app_name %>/unicorn.pid" | |
UNICORN_MAX_RELOAD_WAIT_TIME=60000 # 60 seconds | |
RAILS_ENV="<%= @rails_env %>"; export RAILS_ENV | |
RACK_ENV="<%= @rails_env %>"; export RACK_ENV | |
APP_ROOT=/data/<%= @app_name %>/current |
# Installer script for the Android development environment on MacOSX. | |
# This code is Public Domain. Have fun. | |
# Made by @joakimk. | |
DOWNLOAD_DIR = "~/Downloads/android" | |
INSTALL_DIR = "/usr/local/android" | |
system "mkdir -p #{DOWNLOAD_DIR}" | |
def check(part) | |
print part.gsub(/_/, ' ').capitalize + " y/n: "; STDOUT.flush |
defmodule BroadcastChannel do | |
use Phoenix.Channel | |
def join(channel, auth_message, socket) do | |
socket = assign(socket, :client_version, auth_message["client_version"]) | |
ClientStats.join(channel, socket.assigns[:client_version]) | |
broadcast_stats | |
{:ok, socket} | |
end | |
Sections of text from The Little Redis Book
Alternatively (or in addition to snapshotting), Redis can run in append mode. Any time a key changes, an append-only file is updated on disk. In some cases it's acceptable to lose 60 seconds worth of data, in exchange for performance, should there be some hardware or software failure. In some cases such a loss is not acceptable. Redis gives you the option. In chapter 5 we'll see a third option, which is offloading persistence to a slave.
id = redis.hget('users:lookup:email', 'leto@dune.gov')
user = redis.get("users:#{id}")
# Written for this gist, but inspired by production code (I haven't run this code). | |
# Imperative shell | |
class Timer | |
def initialize(record) | |
@record = record | |
end | |
def start | |
save_changes clock.start |
# Copy and paste this into a terminal: | |
gem install minimapper | |
gem install activemodel # required for Minimapper::Entity[::Rails] (you can use Minimapper::Entity::Core without it) | |
curl https://gist.github.com/joakimk/3904952/raw/56b592e6eaa5a0206bf9207b0ee53aa0114a53eb/minimapper_example.rb > minimapper_example.rb | |
ruby minimapper_example.rb |
#!/usr/bin/env rake | |
# If the code below fails, uncomment this. There are no known issues now, but we had one. | |
#require File.expand_path('../config/application', __FILE__) | |
#Auctionet::Application.load_tasks | |
#require File.expand_path('../lib/tasks/no_rails', __FILE__) | |
#__END__ | |
# Load all non-rails tasks. | |
path = File.expand_path('../lib/tasks/no_rails', __FILE__) |
# Very simple CPU test. Not ideal. | |
# Setup (where possible): | |
# Ubuntu 11.04 | |
# apt-get install ruby # 1.8.7 | |
# ci:jocke $ ruby -v | |
# ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux] | |
ruby -e 't=Time.now;100000000.times { 22%5 };puts Time.now-t' |