Skip to content

Instantly share code, notes, and snippets.

Thomas Parslow almost

Block or report user

Report or block almost

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@almost
almost / gifextract.py
Last active Jun 17, 2019 — forked from BigglesZX/gifextract.py
Extract frames from an animated GIF and return them from a generator, correctly handling palettes and frame update modes
View gifextract.py
import os
from PIL import Image
# Based on https://gist.github.com/BigglesZX/4016539 (but adapted to be a
# generator that yields frames instead of a function that saves out frames)
'''
I searched high and low for solutions to the "extract animated GIF frames in Python"
problem, and after much trial and error came up with the following solution based
on several partial examples around the web (mostly Stack Overflow).
@almost
almost / notebook.sh
Last active Apr 16, 2018 — forked from yangj1e/notebook.sh
Deploy Jupyter Notebook server
View notebook.sh
#!/usr/bin/env bash
cd ~
wget http://repo.continuum.io/archive/Anaconda3-4.1.0-Linux-x86_64.sh
bash Anaconda3-4.1.0-Linux-x86_64.sh -b
echo 'PATH="/home/ubuntu/anaconda2/bin:$PATH"' >> .bashrc
. .bashrc
jupyter notebook --generate-config
@almost
almost / countries.json
Last active Oct 22, 2018 — forked from keeguon/countries.json
A list of countries along 2 letter ISO codes in JSON format (the gist I forked from was valid JS but not valid JSON)
View countries.json
[
{"name": "Afghanistan", "code": "AF"},
{"name": "Åland Islands", "code": "AX"},
{"name": "Albania", "code": "AL"},
{"name": "Algeria", "code": "DZ"},
{"name": "American Samoa", "code": "AS"},
{"name": "AndorrA", "code": "AD"},
{"name": "Angola", "code": "AO"},
{"name": "Anguilla", "code": "AI"},
{"name": "Antarctica", "code": "AQ"},
@almost
almost / agggh
Created Feb 13, 2012 — forked from alexanderhosford/agggh
Browser detection?
View agggh
<script type="text/javascript">
if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ //test for Firefox/x.x or Firefox x.x (ignoring remaining digits);
var ffversion=new Number(RegExp.$1) // capture x.x portion and store as a number
if (ffversion>=5)
document.write(" FF 5.x or above")
else if (ffversion>=4)
document.write(" FF 4.x or above")
else if (ffversion>=3)
document.write(" FF 3.x or above")
You can’t perform that action at this time.