This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import subprocess | |
import tempfile | |
import click | |
DOWNLOAD_DIR = "{}/Downloads".format(os.environ['HOME']) | |
VEEKUN_CRY_URL = "https://veekun.com/dex/media/pokemon/cries/{}.ogg" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def words_from_int(int_or_string): | |
""" | |
Given a positive integer (or a string that looks like one), returns a | |
string that represents the spoken American English (short scale) form of | |
the given number. | |
""" | |
# Numbers' names | |
ones_place = [None, "one", "two", "three", "four", | |
"five", "six", "seven", "eight", "nine"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os.path | |
import re | |
import sqlite3 | |
from sqlalchemy import create_engine | |
def create_sqlite_engine(sqlite_path, | |
read_only=None, create_db=None, **kwargs): | |
""" | |
Open SQLite with appropriate use of connection flags. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 1: Open Script Editor, make a new script, and paste this whole file in. | |
-- 2: Save the script as an app. | |
-- 3: Open the app's Contents/Info.plist | |
-- 4: Add the following to the top-level <dict> of the plist: | |
-- <key>CFBundleURLTypes</key> | |
-- <array> | |
-- <dict> | |
-- <key>CFBundleURLName</key> | |
-- <string>Web site URL</string> | |
-- <key>CFBundleURLSchemes</key> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
"""Generates an abitrary number of valid .vcf vCard contacts based on the | |
parameters set at the beginning of the file. See also: | |
http://softwareas.com/vcard-for-developers | |
http://en.wikipedia.org/wiki/VCard | |
""" | |
import random, sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'cgi' | |
require 'json' | |
require 'net/http' | |
require 'uri' | |
module Jekyll | |
class MusicLink < Liquid::Tag | |
def initialize(tag_name, contents, tokens) | |
super |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns my-project.core | |
(:require [clojure.java.io :as io]) | |
(:import [java.io PushbackReader])) | |
(with-open | |
[r (io/reader (io/resource "bar.conf"))] | |
(read (PushbackReader. r))) |