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 python | |
import sys | |
""" | |
Got the idea from https://learn.lytics.com/understanding/product-docs/lytics-javascript-tag/testing-and-verification#testing-audiences | |
Given an input of "test", makes: | |
t.e.s.t.@gmail.com | |
t.e.s.t@gmail.com | |
t.e.st.@gmail.com |
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
package main | |
/* | |
Got the idea from https://learn.lytics.com/understanding/product-docs/lytics-javascript-tag/testing-and-verification#testing-audiences | |
Given an input of "test", makes: | |
t.e.s.t.@gmail.com | |
t.e.s.t@gmail.com | |
t.e.st.@gmail.com |
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
// Exercise 1.4 from 'The Go Programming Language', by A Donovan and | |
// B Kernigham | |
// | |
// Zach Young | |
// 27 May, 2019 | |
// | |
//Dup2 prints the count and text of lines that appear more than once | |
//in the input. It reads from stdin or from a list of named files. | |
package main |
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
# Inspired by: | |
# 'How many digits of pi do we really need?' | |
# (https://www.jpl.nasa.gov/edu/news/2016/3/16/how-many-decimals-of-pi-do-we-really-need/) | |
# | |
# I wanted to see for myself that the difference between 15 digits and 16 | |
# digits amounted to only half of an inch at the scale of Voyager 1's | |
# distance of ~12.5 billion miles | |
from decimal import Decimal, getcontext |
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 permute(n, chars='01', limit=128, start=0): | |
appended = 0 | |
counter = 0 | |
def f(s, a): | |
nonlocal appended | |
nonlocal counter | |
if appended == limit: | |
return a | |
if len(s) == n: |
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
#!/bin/bash | |
bin/godoc -http "localhost:6060" -index -index_files bin/idx -v > godoc.log 2>&1 & | |
open "http://localhost:6060/" | |
bin/tour > tour.log 2>&1 & | |
docPid=$(ps | grep godoc | grep -v grep | awk '{print $1}') | |
tourPid=$(ps | grep tour | grep -v grep | awk '{print $1}') | |
echo "#!/bin/bash" > kill-learn.sh |
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
""" | |
I got really interested in how many edits 'Once Upon a Time in Hollywood' got after | |
reading about the contentious issue of whether or not the Plot section should include | |
information deemed to be a spoiler, and the kinda-heated debate on the Talk page. | |
This gist also serves as my own documentation for using the WikiMedia query/revisions API. | |
""" | |
import json | |
import pickle | |
import pprint |
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 python | |
""" | |
Permute the characters of an encoding space. | |
""" | |
import math | |
import sys | |
def permute_arbitrary(chars, _len, arr, s): | |
"""Permutes an arbitrary encoding space, each permutation being a string of chars of length _len""" |
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
"#!/bin/zsh", | |
"BASE_URL=https://pivotaltracker.com", | |
(. [] | | |
.id as $sid | ( | |
"\nmkdir \($sid)", | |
( | |
.comments[].file_attachments[] | | |
"curl --location -s -H \"X-TrackerToken: $TOKEN\" \"$BASE_URL\(.download_url)\" > \($sid)/\(.id)_\(.filename)" | |
) | |
) |
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
// | |
// ContentView.swift | |
// Dice2 | |
// | |
// Created by Zach Young on 8/17/20. | |
// Copyright © 2020 Zach Young. All rights reserved. | |
// | |
import SwiftUI |
OlderNewer