Skip to content

Instantly share code, notes, and snippets.

@dpiers
dpiers / pack_evs.py
Last active September 4, 2025 17:40
import requests
import pandas as pd
# Define the rates DataFrame outside the function if it's constant
rates = pd.DataFrame([
['Iconic', 'Holofoil', 0.104],
['Enchanted', 'Holofoil', 1.04],
['Epic', 'Holofoil', 6.25],
['Legendary', 'Normal', 16.02],
['Legendary', 'Cold Foil', 2.73],
lol: .asciz "doing it right?"
.globl _main
_main:
sub $8, %rsp
lea lol(%rip), %rdi
call _printf
add $8, %rsp
ret
### Keybase proof
I hereby claim:
* I am dpiers on github.
* I am dp (https://keybase.io/dp) on keybase.
* I have a public key whose fingerprint is D132 1907 8FC3 15F9 DB31 E3FF 1393 9BFF C36E F0C4
To claim this, I am signing this object:
@dpiers
dpiers / gist:2027336
Created March 13, 2012 06:56
Convert monochromatic input .bmp to a static Game of Life state (requires ^2 square input img)
import Image
imgFile = Image.open("input.bmp")
img = imgFile.load()
imgY = imgFile.size[0]
imgX = imgFile.size[1]
outFile = Image.new('L',(imgX,imgY))
outImg = outFile.load()
@dpiers
dpiers / pythag_trip1k.py
Created February 12, 2012 22:43
Finding a pythagorean triple where a+b+c = 1000
m = 2
n = 1
num_sum = 0
while num_sum != 1000:
a = m**2 - n**2
b = 2 * m * n
c = m**2 + n**2
@dpiers
dpiers / factorial.py
Created February 11, 2012 17:28
Embed.ly application puzzles
import math
idx = 0
total = 0
while(total != 8001):
total = 0
factNum = math.factorial(idx+1)
for i in range(int(math.log10(factNum)) + 1):