Skip to content

Instantly share code, notes, and snippets.

@ono
ono / category.ex
Last active January 13, 2018 12:34
defmodule MyApp.Category do
use Ecto.Schema
alias MyApp.Category
schema "categories" do
field :name, :string
field :description, :string
field :display_order, :integer
embeds_many :children, Child, [on_replace: :delete] do

This role has been filled - Frontend Lead at Food Clubs

  • Start up: shape the build from day 1.
  • Competitive salary, options.
  • Mission: making sustainable food accessible to everyone.
  • Options + Chance of leadership role.
  • Creds: Backed by a leading VC, domain expertise.
  • Team members: Founded/worked on Farmdrop, Wonderbly, Geckoboard...

The company

Keybase proof

I hereby claim:

  • I am ono on github.
  • I am tatsuyaono (https://keybase.io/tatsuyaono) on keybase.
  • I have a public key whose fingerprint is 259B 1703 0E6F 11A9 E23B 40CD ADA9 CDDD DD74 8709

To claim this, I am signing this object:

defmodule Sample.DlxTest do
@moduledoc """
DlxTest shows a sample code of how to work with Dead Exchange Letter on RabbitMQ.
Dead Letter Exchange will let you control retry logic.
## Requirement
- [AMQP](https://hex.pm/packages/amqp)
## How to run
@ono
ono / resque.sh
Created March 1, 2012 10:23
resque.sh
#!/bin/sh
usage()
{
echo "usage: ${0} {start|stop|graceful_stop|stop_child|restart} <any_process_keyword>"
exit 1
}
start_app() {
${app_cmd} 2>&1 | logger -t resque_worker &
}

spoke

Front-end developer at Spoke

  • Website: www.spoke.law
  • Location: London Bridge, London, United Kingdom
  • Duration: ~3 month freelance contract (potential to extend)
  • Renumeration: Dependent on experience

ABOUT THE ROLE

@ono
ono / newrelic_async_sinatra.rb
Last active December 11, 2015 10:38
NewRelic instrumentation async Sinatra. But note that this doesn't instrument EM.callback etc.. You still need custom instrumentation for callbacks.
# NewRelic instrumentation for async_sinatra.
#
# The following code was reffered.
# https://github.com/newrelic/rpm/blob/51767a324046baff0ea4d347862cd4696d73374d/lib/new_relic/agent/instrumentation/sinatra.rb
require 'newrelic_rpm'
require 'new_relic/agent/instrumentation/controller_instrumentation'
module AsyncSinatraInstrumentation
def async_handle_exception_with_newrelic &blk
@ono
ono / travis-pro.markdown
Created November 1, 2012 14:38
Travis CI pro beta note

1st November, 2012

Summary

Luckily we have got a beta access to Travis CI pro which allows you to build your private repos on github. I did some research for my work and we have decided to replace our Jenkins to Travis CI pro. I leave some notes here.

Background

We have bunch of private repositories, mainly Ruby (rails and gems), on github that we want to continuously test. We currently maintain two CI servers: Buildbot for legacy project and Jenkins for recent projects. On this research, I simply ignored the legacy one and evaluated Travis CI pro as an alternative for Jenkins.

% ack ":app" bin/capify
49: "config/deploy.rb" => 'set :application, "set your application name here"
56:role :app, "your app-server here" # This may be the same as your `Web` server
70:# task :restart, :roles => :app, :except => { :no_release => true } do
lib/capistrano/configuration/actions/inspect.rb
19: # task :tail_fcgi, :roles => :app do
lib/capistrano/configuration/actions/invocation.rb
39: # session.when "in?(:app)", "/path/to/restart/mongrel"