Skip to content

Instantly share code, notes, and snippets.

View capnfabs's full-sized avatar

Fabian Tamp capnfabs

View GitHub Profile
@nvgoldin
nvgoldin / Dockerfile-python:2.7.14-alpine-h5py
Last active January 3, 2021 15:31
Installing tables, h5py in Alpine Docker(python:2.7.14-alpine)
FROM python:2.7.14-alpine
RUN apk add --no-cache \
--allow-untrusted \
--repository \
http://dl-3.alpinelinux.org/alpine/edge/testing \
hdf5 \
hdf5-dev && \
apk add --no-cache \
build-base
RUN pip install --no-cache-dir --no-binary :all: tables h5py
@rockwotj
rockwotj / download_anonymous_icons_from_drive.rb
Last active December 13, 2023 03:30
Downloads all of the icons of anonymous animals from Google Drive
#!/usr/bin/env ruby
icon_list = "alligator, anteater, armadillo, auroch, axolotl, badger, bat, beaver, buffalo, camel, chameleon, cheetah, chipmunk, chinchilla, chupacabra, cormorant, coyote, crow, dingo, dinosaur, dolphin, duck, dragon, elephant, ferret, fox, frog, giraffe, gopher, grizzly, hedgehog, hippo, hyena, jackal, ibex, ifrit, iguana, koala, kraken, lemur, leopard, liger, llama, manatee, mink, monkey, narwhal, nyan cat, orangutan, otter, panda, penguin, platypus, python, pumpkin, quagga, rabbit, raccoon, rhino, sheep, shrew, skunk, slow loris, squirrel, turtle, walrus, wolf, wolverine, wombat"
for icon in icon_list.split ', ' do
element = icon.sub ' ', ''
`curl https://ssl.gstatic.com/docs/common/profile/#{element}_lg.png -o icons/#{element}.png`
end
@willurd
willurd / web-servers.md
Last active May 21, 2024 09:23
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@briangriffey
briangriffey / NinePatchBitmapFactory.java
Last active April 25, 2023 03:06
Create 9-patches simlar to - (UIImage *)resizableImageWithCapInsets:(UIEdgeInsets)capInsets
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.NinePatch;
import android.graphics.Rect;
import android.graphics.drawable.NinePatchDrawable;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
/**