Skip to content

Instantly share code, notes, and snippets.

sugi1119 / 1 - intro.rb
Created June 22, 2018 01:16 — forked from Arkham/1 - intro.rb
Sonic PI experiments
# HI! I'm Ju. You can find me online as @arkh4m
# Download Sonic PI here:
def p(note, s: 1)
play note, release: s, cutoff: rrand(80,110)
sleep s
def fra_martino
sugi1119 /
Created June 22, 2018 01:10 — forked from xavriley/
Original NES Mario Theme for Sonic Pi

Making Chiptune Music using Sonic Pi v2.0

Warning: this might not work on a RaspberryPi yet

I was curious about making retro gaming sounds using Sonic Pi. A couple of months and a lot of Googling later, here's the original Mario Bros theme as it was heard on the NES console.

I'm (just about) old enough to remember rushing home from school to play this game at Philip Boucher's house, sitting cross-legged in front of the TV till my feet got pins and needles. Working out how to recreate it for Sonic Pi was a lot of fun!

Getting the sounds of the NES chip

sugi1119 / WooCommerce: Add extra fee when product total exceed certain amount
Created June 6, 2018 04:17
WooCommerce: Add extra fee when product total exceed certain amount
add_action( 'woocommerce_cart_calculate_fees', 'loc_woo_charge_additional_fee_for_nr_of_products' );
function loc_woo_charge_additional_fee_for_nr_of_products(){
global $woocommerce;
$cart_content = $woocommerce->cart->get_cart();
$qty = 0;
foreach($cart_content as $key => $value){
$qty += $value['quantity'];
# Compiled source #
# Packages #
def find_frequency(sentence, word)
sentence = "hello hello the world"
word = "hello"
puts find_frequency(sentence, word)