Skip to content

Instantly share code, notes, and snippets.

View amokan's full-sized avatar

Adam Mokan amokan

  • Grain
  • Chandler, Arizona
  • 12:47 (UTC -07:00)
View GitHub Profile
@amokan
amokan / README.md
Created April 25, 2016 18:53
Elixir Crawling With Pools For Fun and Profit

PoolCrawler

This is a simple example in response to https://www.reddit.com/r/elixir/comments/4gcnmi/struggling_with_getting_this_worker_pool_and/ as well as a reminder for myself

I used https://github.com/midas/conqueuer to do something similar to the original poster was trying to accomplish.

Some code has been removed to make it simple to follow and just dropping this into a project will not compile. Be sure to look at the comments.

I combined and/or renamed files in this gist to group things together as well.

@amokan
amokan / grocery_cart_new.ex
Last active July 21, 2022 11:12
Comparison of GenServer state orchestration using send/2 vs the new handle_continue callback
defmodule GroceryCart do
@moduledoc """
Simple example showing the `handle_continue` callback in Erlang/OTP 21+
"""
use GenServer
# simple contrived struct for state - didn't need to be a struct at all
defstruct items: []
@amokan
amokan / gist:3881064
Created October 12, 2012 19:36
jenkins-cli commands (v1.485)
build
Builds a job, and optionally waits until its completion.
cancel-quiet-down
Cancel the effect of the "quiet-down" command.
clear-queue
Clears the build queue
connect-node
Reconnect to a node
copy-job
Copies a job.
@amokan
amokan / RequestTimingFilter.cs
Created July 15, 2011 19:37
example of IResultFilter and IActionFilter
using System.Diagnostics;
using System.Web.Mvc;
namespace YourApp.Web.Infrastructure.Filters
{
/// <summary>
/// Filter to display the execution time of both the action and result
/// </summary>
public class RequestTimingFilter : IActionFilter, IResultFilter
{
@amokan
amokan / !norns_on_mac.md
Last active June 10, 2020 22:41 — forked from mimetaur/!norns_on_mac.md
Norns Engine Development on MacOS - quick guide
  1. Pull the norns repository

  2. Make symbolic links from norns sc folders -> SuperCollider Extensions folder:

    • ln -s ~/development/github/monome/norns/sc/core ~/Library/Application\ Support/SuperCollider/Extensions/monome-norns-core
    • ln -s ~/development/github/monome/norns/sc/engines ~/Library/Application\ Support/SuperCollider/Extensions/monome-norns-engines
    • ln -s ~/development/github/monome/norns/sc/ugens ~/Library/Application\ Support/SuperCollider/Extensions/monome-norns-ugens
  3. Make symlinks to Norns community repos e.g. ln -s ~/development/github/monome/we/ ~/Library/Application\ Support/SuperCollider/Extensions/monome-we

  4. Make symlinks for custom engine development

@amokan
amokan / README.md
Last active December 9, 2019 19:11
Expert Sleepers Disting simple example of audio processing

Some really basic examples of audio processing code for the Expert Sleepers Disting eurorack module.

You can find the base repo for a blank audio passthrough project at https://github.com/expertsleepersltd/disting

You will need to have a 'PICKit 3' USB programmer and the MPLAB IDE (free Microchip dev tools) installed. I grabbed my PICKit from Mouser a while ago and it should be easy to find, wherever you are.

If you want to reflash the stock firmware, you can download that from Expert Sleepers here - http://www.expert-sleepers.co.uk/downloads/firmware/disting_firmware_1_0.zip

Note that the stock firmware is already compiled, so you'll just want to flash it using the 'mplab_ipe' tool.

@amokan
amokan / README.md
Last active March 14, 2019 18:48
Throughput Monitor

Simple and Dumb Throughput Counter

Concurrent and simple. No blocking calls or bottlenecks. Increments are atomic.

Usage

Start up the proc

Throughput.start_link()

Keybase proof

I hereby claim:

  • I am amokan on github.
  • I am adammokan (https://keybase.io/adammokan) on keybase.
  • I have a public key ASCDszyHtTcwLmTxn1kECbHYTro7_6FSJxj5V60s5IUmRQo

To claim this, I am signing this object:

@amokan
amokan / .irbrc
Created April 18, 2013 00:28
my .irbrc file
# Info/code for this file were borrowed from the following places:
# http://bit.ly/174dkWL
# https://gist.github.com/adamcrown/932231
# https://gist.github.com/patmcnally/893833
begin
# ansi colors
ANSI = {}
ANSI[:RESET] = "\e[0m"
### Keybase proof
I hereby claim:
* I am amokan on github.
* I am adammokan (https://keybase.io/adammokan) on keybase.
* I have a public key ASB_7ehK1iFhL1_xk7Z3P1gKUnSfUUTLuwjszBoD2fdczgo
To claim this, I am signing this object: