Skip to content

Instantly share code, notes, and snippets.

#required libraries
import urllib
import scipy.io.wavfile
import pydub
#a temp folder for downloads
temp_folder="/Users/home/Desktop/"
#spotify mp3 sample file
@raymondpittman
raymondpittman / letters-to-100.py
Created September 9, 2020 21:38 — forked from peterjmag/letters-to-100.py
Find English words whose letter values add up to 100
#!/usr/bin/env python
# encoding: utf-8
"""
letters-to-100.py
"""
import string
letter_values = dict((l, i) for i, l in enumerate(string.lowercase, start=1))
english_dict = open('/usr/share/dict/words', 'rU')
@raymondpittman
raymondpittman / problem.md
Created September 9, 2020 03:37 — forked from tomanistor/problem.md
Sum of Digits / Digital Root

In this kata, you must create a digital root function.

A digital root is the recursive sum of all the digits in a number. Given n, take the sum of the digits of n. If that value has two digits, continue reducing in this way until a single-digit number is produced. This is only applicable to the natural numbers.

Here's how it works (Ruby example given):

digital_root(16)
=> 1 + 6
=> 7
@raymondpittman
raymondpittman / words.py
Created September 8, 2020 03:38 — forked from piratus/words.py
Word value calculator
# coding: utf-8
"""Word value calculator.
Calculates word value as per http://9gag.com/gag/2506371
"""
from string import lowercase
LETTER_VALUES = {letter: index for index, letter in enumerate(lowercase, 1)}
def word_value(word):
@raymondpittman
raymondpittman / gist:d2321fd20544b6a94e2c73e0acf525ac
Created April 21, 2019 00:50 — forked from totherik/gist:3a4432f26eea1224ceeb
v8 --allow-natives-syntax Runtime Functions
Per https://code.google.com/p/v8/codesearch#v8/trunk/src/runtime.cc
%CreateSymbol
%CreatePrivateSymbol
%CreateGlobalPrivateSymbol
%NewSymbolWrapper
%SymbolDescription
%SymbolRegistry
%SymbolIsPrivate