Skip to content

Instantly share code, notes, and snippets.

@danreedy
danreedy / gist:a0f0aa1ec2eb275c55a2
Created April 16, 2015 14:39
Frozen - Let it Go - Sonic Pi
# Let it Go - Pi Version
use_bpm 34
use_synth :pretty_bell
quaver = 0.125 #Eight note
crotchet = 0.25 #Quarter note
minim = 0.5 #Half note
semibreve = 1 #Whole note
in_thread(name: :rh) {rightHand}
@jonathanstark
jonathanstark / verify-google-recaptcha-with-php
Last active July 16, 2024 17:06
Verify Google reCAPTCHA with PHP
#
# Verify captcha
$post_data = http_build_query(
array(
'secret' => CAPTCHA_SECRET,
'response' => $_POST['g-recaptcha-response'],
'remoteip' => $_SERVER['REMOTE_ADDR']
)
);
$opts = array('http' =>
@FiloSottile
FiloSottile / 32.asm
Last active January 31, 2025 03:22
NASM Hello World for x86 and x86_64 Intel Mac OS X (get yourself an updated nasm with brew)
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32
global start
section .text
start:
push dword msg.len
push dword msg
push dword 1
mov eax, 4
@csaez
csaez / ricerocks.py
Created June 15, 2013 10:10
Interactive Programming in Python - Mini-project #8 - "RiceRocks" (Asteroids)
# Mini-project #8 - "RiceRocks" (Asteroids)
#
# 'Introduction to Interactive Programming in Python' Course
# RICE University - coursera.org
# by Joe Warren, John Greiner, Stephen Wong, Scott Rixner
import simplegui
import math
import random
@csaez
csaez / spaceship.py
Last active June 8, 2025 19:32
Interactive Programming in Python - Mini-project #7 - "Spaceship"
# Mini-project # 7 - Spaceship
#
# 'Introduction to Interactive Programming in Python' Course
# RICE University - coursera.org
# by Joe Warren, John Greiner, Stephen Wong, Scott Rixner
import simplegui
import math
import random
@csaez
csaez / blackjack.py
Created June 1, 2013 11:54
Interactive Programming in Python - Mini-project #6 - "Blackjack"
# Mini-project #6 - Blackjack
#
# 'Introduction to Interactive Programming in Python' Course
# RICE University - coursera.org
# by Joe Warren, John Greiner, Stephen Wong, Scott Rixner
import simplegui
import random
# load background sprite
@csaez
csaez / memory.py
Last active December 17, 2015 18:39
Interactive Programming in Python - Mini-project #5 - "Memory"
# Mini-project #5 - implementation of card game - "Memory"
#
# 'Introduction to Interactive Programming in Python' Course
# RICE University - coursera.org
# by Joe Warren, John Greiner, Stephen Wong, Scott Rixner
import simplegui
import random
@csaez
csaez / pong.py
Last active December 17, 2015 10:58
Interactive Programming in Python - Mini-project #4 - "Pong"
# Mini-project #4 - "Pong"
#
# 'Introduction to Interactive Programming in Python' Course
# RICE University - coursera.org
# by Joe Warren, John Greiner, Stephen Wong, Scott Rixner
import simplegui
import random
import math
@csaez
csaez / stopwatch.py
Last active December 17, 2015 04:49
Interactive Programming in Python - Mini-project #3 - "Stopwatch: The Game"
# Mini-project #3 - "Stopwatch: The Game"
#
# 'Introduction to Interactive Programming in Python' Course
# RICE University - coursera.org
# by Joe Warren, John Greiner, Stephen Wong, Scott Rixner
import simplegui
# define global variables
@csaez
csaez / guess_the_number.py
Last active December 17, 2015 04:49
Interactive Programming in Python - Mini-project #2: "Guess the number" game
# Mini-project #2 - "Guess the number"
#
# 'Introduction to Interactive Programming in Python' Course
# RICE University - coursera.org
# by Joe Warren, John Greiner, Stephen Wong, Scott Rixner
import simplegui
import random
# initialize global variables used in your code