Skip to content

Instantly share code, notes, and snippets.

View amokan's full-sized avatar

Adam Mokan amokan

  • Grain
  • Chandler, Arizona
  • 15:26 (UTC -07:00)
View GitHub Profile
@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 / stream_test.ex
Last active February 22, 2017 19:28 — forked from refriedchicken/stream_test.ex
Streaming Size Check
defmodule StreamTest do
use GenServer
require Logger
def start_link(opts \\ []) do
GenServer.start_link(__MODULE__, :ok, opts)
end
def init(:ok) do
Process.flag :trap_exit, true

Docker Cheat Sheet

Why

Why Should I Care (For Developers)

"Docker interests me because it allows simple environment isolation and repeatability. I can create a run-time environment once, package it up, then run it again on any other machine. Furthermore, everything that runs in that environment is isolated from the underlying host (much like a virtual machine). And best of all, everything is fast and simple."

TL;DR, I just want a dev environment

#!/usr/bin/env knife exec
# A knife exec script to change chef node's name, preserving all the attributes.
#
# Usage: knife exec rename-node.rb old-name new-name
#
# Script retrieves the Node object, changes its 'name' attribute,
# creates new Node object with updated name and rest of attributes
# untouched. Then it deletes old Node and Client objects from
# database, and logs into the server to update it:
if [ -f "$rvm_path/scripts/rvm" ]; then
source "$rvm_path/scripts/rvm"
if [ -f ".rvmrc" ]; then
source ".rvmrc"
fi
if [ -f ".ruby-version" ]; then
rvm use `cat .ruby-version`
fi

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@amokan
amokan / gist:3902689
Created October 16, 2012 23:16 — forked from dgalarza/gist:3248130
update jenkins Updatecenter from CLI
$ java -jar jenkins-cli.jar -s http://localhost:9000 install-plugin findbugs
findbugs is neither a valid file, URL, nor a plugin artifact name in the update center
No update center data is retrieved yet from: http://updates.jenkins-ci.org/update-center.json
findbugs looks like a short plugin name. Did you mean 'null'?
# Specifying a full URL works!
$ java -jar jenkins-cli.jar -s http://localhost:9020 install-plugin http://updates.jenkins-ci.org/download/plugins/AdaptivePlugin/0.1/AdaptivePlugin.hpi
# Get the update center ourself
@amokan
amokan / server.js
Created March 13, 2012 23:35 — forked from kieran/server.js
basic Barista example
var Router = require('barista').Router // <-- require the router
, http = require('http')
, util = require('util')
var router = new Router // <-- create the router
// define some routes
router.get('/').to('app.index')
router.resource('products')
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl http://npmjs.org/install.sh | sh
@amokan
amokan / gist:213063
Created October 19, 2009 03:34 — forked from peterc/gist:40246
# NAME: authinabox
# VERSION: 1.01 (Dec 27, 2008)
# AUTHOR: Peter Cooper [ http://www.rubyinside.com/ github:peterc twitter:peterc ]
# DESCRIPTION: An "all in one" Sinatra library containing a User model and authentication
# system for both session-based logins OR HTTP Basic auth (for APIs, etc).
# This is an "all in one" system so you will probably need to heavily tailor
# it to your own ideas, but it will work "out of the box" as-is.
# COMPATIBILITY: - Tested on 0.3.2 AND the latest rtomayko Hoboken build! (recommended for the latter though)
# - NEEDS DataMapper!
# - Less work needed if you use initializer library -- http://gist.github.com/40238