Skip to content

Instantly share code, notes, and snippets.

@xavriley
xavriley / dont_drop_the_bass.rb
Created Jul 8, 2017
Don't Drop the Bass - Source code with comments - Brighton Ruby 2017
View dont_drop_the_bass.rb
# ❤️ Brighton Ruby
# This code uses some features from the pre-release of Sonic Pi,
# due out later this month (touch wood!).
# If you just can't wait for the release but want to try it yourself
# you can either build the Sonic Pi master branch from source (pros: free, cons: hard)
# or share some love and contribute to the Patreon page to support Sonic Pi's development
# https://www.patreon.com/samaaron
# That will give to access to the latest pre-release versions
@xavriley
xavriley / live_sample.rb
Created Jul 8, 2017
live_sample definition for Sonic Pi v2.13 and above
View live_sample.rb
# place in ~/.sonic-pi/init.rb to autoload
def live_sample(name=nil, *args)
raise ArgumentError, "live_sample needs to have a unique name. For example: live_sample :foo" unless name
raise ArgumentError, "live_sample's name needs to be a string or symbol, got: #{name.inspect}. Example usage: live_sample :foo" unless (name.is_a?(Symbol) || name.is_a?(String))
ls_name = "live_sample_#{name}".to_sym
args_h = resolve_synth_opts_hash_or_array(args)
click = args_h[:click] || 4
dur = args_h[:dur]
@swarminglogic
swarminglogic / watchfile.sh
Last active Jun 4, 2020
watchfile - monitor file(s) and execute a command when files are changed
View watchfile.sh
#!/bin/bash
version=1.0.1
versionDate="2014-02-14"
function showHelp() {
echo "watchfile - monitor file(s)/command and perform action when changed
Possible ways of usage
----------------------------------------
@malarkey
malarkey / Contract Killer 3.md
Last active Aug 9, 2020
The latest version of my ‘killer contract’ for web designers and developers
View Contract Killer 3.md

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

You can’t perform that action at this time.