Skip to content

Instantly share code, notes, and snippets.

View dsnipe's full-sized avatar

Dmitry Tymchuk dsnipe

View GitHub Profile
@dsnipe
dsnipe / polyTakt.ino
Created October 24, 2018 10:13
Poly for Digitakt using Arduino
/*******************************************************************************
* Requires:
* Arduino MIDI library
* http://playground.arduino.cc/Main/MIDILibrary
*
*
* Note:
* If you want use with Leonardo, you must choose Arduino MIDI library v4.0 or higher.
*******************************************************************************
* This program is free software; you can redistribute it and/or modify
# in your app supervisor
:phx_dyn_dispatch = :ets.new(:phx_dyn_dispatch, [:named_table, :bag, :public])
defmodule DynamicDispatch do
def register(group, plug, opts) do
true = :ets.insert(:phx_dyn_dispatch, {group, plug, opts})
end
def unregister(group, plug) do
# On the phoenix node
# if production mode
MIX_ENV=prod PORT=4001 elixir --name phoenix@127.0.0.1 --cookie 123 --erl "-kernel inet_dist_listen_min 9001 inet_dist_listen_m 9001" -pa _build/prod/consolidated -S mix phoenix.server
# if debug mode
elixir --name phoenix@127.0.0.1 --cookie 123 --erl "-kernel inet_dist_listen_min 9001 inet_dist_listen_m 9001" -S mix phoenix.server
# On the observing node
# Terminal 1, start SSH tunnel
ssh -N -L 9001:localhost:9001 -L 4369:localhost:4369 pi@192.168.1.31
function et -d 'Start an Emacs client in the terminal,
starting the server as necessary.'
emacsclient -cnw -a "" $argv
end
function ec -d 'Start an Emacs client in the Cocoa GUI,
starting the server as necessary.'
emacsclient -cna "" $argv
end
@dsnipe
dsnipe / keybase.md
Created June 22, 2016 19:40
Keybase Sign

Keybase proof

I hereby claim:

  • I am dsnipe on github.
  • I am dmtym (https://keybase.io/dmtym) on keybase.
  • I have a public key ASBNlrISF2Ms1HwJ2o_iUcgGLRQ4ybSZCjKgoUiJXfR82Qo

To claim this, I am signing this object:

@dsnipe
dsnipe / Instrument Anything in Rails 3.md
Created April 21, 2016 12:36 — forked from mnutt/Instrument Anything in Rails 3.md
How to use Rails 3.0's new notification system to inject custom log events

Instrument Anything in Rails 3

With Rails 3.0 released a few weeks ago I've migrated a few apps and I'm constantly finding useful new improvements. One such improvement is the ability to log anything in the same way that Rails internally logs ActiveRecord and ActionView. By default Rails 3 logs look slightly spiffier than those produced by Rails 2.3: (notice the second line has been cleaned up)

Started GET "/" for 127.0.0.1 at Mon Sep 06 01:07:11 -0400 2010
  Processing by HomeController#index as HTML
  User Load (0.2ms)  SELECT `users`.* FROM `users` WHERE (`users`.`id` = 3) LIMIT 1
  CACHE (0.0ms)  SELECT `users`.* FROM `users` WHERE (`users`.`id` = 3) LIMIT 1

Rendered layouts/_nav.html.erb (363.4ms)

@dsnipe
dsnipe / org-mode-reference-in.org
Created October 20, 2015 09:49 — forked from drj42/org-mode-reference-in.org
This is a cheat sheet for Emacs org-mode... in org-mode format!
@dsnipe
dsnipe / tmux_conf
Last active October 20, 2016 21:09
Tmux settings
# Act like Vim
set-window-option -g mode-keys vi
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# Look good
set-option -g default-terminal "screen-256color"