Skip to content

Instantly share code, notes, and snippets.

View sweinberg's full-sized avatar

swein sweinberg

View GitHub Profile
body{
background: #282c36;
color: #ffffff}
td{
background: #282c36}
div{
background: #282c36;
color: #ffffff}
Verifying that +samw is my Bitcoin username. You can send me #bitcoin here: https://onename.io/samw
@sweinberg
sweinberg / Articles.py
Created March 8, 2014 23:12
Open Wikipedia pages in Articles. Requires Pythonista.
import clipboard
import string
import sys
import webbrowser
try:
article = sys.argv[1]
except IndexError:
article = clipboard.get()

Keybase proof

I hereby claim:

  • I am sweinberg on github.
  • I am samw (https://keybase.io/samw) on keybase.
  • I have a public key whose fingerprint is 9FB2 1888 8BDA CF7B 2A50 3391 6568 97E9 60C3 D6A7

To claim this, I am signing this object:

# Play a short melody
import sound
import time
notes = 'E3', 'E3', 'F3', 'G3', 'G3', 'F3', 'E3', 'D3', 'C3', 'C3', 'D3', 'E3', 'E3', 'D3', 'D3', 'E3', 'E3', 'F3', 'G3', 'G3', 'F3', 'E3', 'D3', 'C3', 'C3', 'D3', 'E3', 'D3', 'C3', 'C3'
for note in notes:
sound.play_effect('Piano_' + note)
time.sleep(0.5)
@sweinberg
sweinberg / submit_address.html
Created January 19, 2014 11:47
Address submit form
<!DOCTYPE html>
<html>
<head>
<title>BitCash</title>
</head>
<body>
<style>
@sweinberg
sweinberg / RSOD
Created August 28, 2013 00:21
Reduced Sum of Digits
#Reduced Sum of Digits
Take a whole number and add up its digits. If the result has more than one digit, add all of the digits again and keep doing this until you have one digit. Call the result the **RSOD**, the *Reduced Sum Of Digits*.
For example to get the RSOD of `32987` add `3+2+9+8+7` to get `29`. Now add `2+9` to get `11`. Now add `1+1` to get `2`. So the RSOD is `2`.
Here's why this is useful. If you add two numbers, the RSOD of the result is the RSOD of the sums of the RSODs. This means you can check any addition by checking single digit RSODs. For example consider this calculation
`132+991 = 1223`
@sweinberg
sweinberg / Geometry Notes Second Semester
Created June 26, 2013 17:27
My second semester Geometry notes and final exam study guide.
#Geometry Notes Second Semester
***
##Area, Surface Area and Volume
###Circumference
* Circumference is the linear distance around the outside of a circular object.
* C = π • d or π • 2r.
@sweinberg
sweinberg / Bitcoin Donate Button
Created May 2, 2013 05:35
A simple 'Donate' button that displays a dialog box with a copy-n-pasteable Bitcoin address, for easy sending from a wallet.
<!DOCTYPE html>
<html>
<head>
<style>
.text {
color:#333333;
font-family:arial;
font-size:35px;