Skip to content

Instantly share code, notes, and snippets.

sugi1119

Block or report user

Report or block sugi1119

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sugi1119
sugi1119 / 1 - intro.rb
Created Jun 22, 2018 — forked from Arkham/1 - intro.rb
Sonic PI experiments
View 1 - intro.rb
# HI! I'm Ju. You can find me online as @arkh4m
# Download Sonic PI here: http://sonic-pi.net
def p(note, s: 1)
play note, release: s, cutoff: rrand(80,110)
sleep s
end
def fra_martino
@sugi1119
sugi1119 / README.md
Created Jun 22, 2018 — forked from xavriley/README.md
Original NES Mario Theme for Sonic Pi
View README.md

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
sugi1119 / WooCommerce: Add extra fee when product total exceed certain amount
Created Jun 6, 2018
WooCommerce: Add extra fee when product total exceed certain amount
View 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'];
}
View .gitignore_global
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
View Find the frequency of a string in a sentence
def find_frequency(sentence, word)
sentence.downcase.split.count(word.downcase)
end
sentence = "hello hello the world"
word = "hello"
puts find_frequency(sentence, word)
You can’t perform that action at this time.