Skip to content

Instantly share code, notes, and snippets.

@willwhitney
willwhitney / himawari.py
Last active November 30, 2022 17:47 — forked from celoyd/hi8-fetch.py
Fetch and untile tiled Himawari-8 images from the http://himawari8.nict.go.jp PNG endpoint, then set them as desktop background on OSX
import requests
import sys
from datetime import datetime, timedelta
import pytz
from PIL import Image
from StringIO import StringIO
import os
import logging
# python himawari.py
var visaDebitRegex = new RegExp(
"^400626|40770[4-5]|408367|40845[6-7]|40940[0-2]|41228[5-6]|41378[7-8]|418760|41917[6-9]|419772|419776|420672|42159[2-4]|" +
"421682|423769|42449[5-7]|431072|43253[4-5]|441078|444001|44400[5-6]|444008|445025|4462(0[0-9]|1[0-1])|4462(1[3-9]|[2-4][0-9]|5[0-4])|" +
"4462(5[7-9]|6[0-9]|7[0-2])|44627(7[4-9]|8[0-3])|446286|44629[1-2]|446294|447378|450875|45397[8-9]|454313|45443[2-5]|454742|" +
"45670[5-6]|4567(2[5-9]|3[0-9])|458046|459305|4593(3[8-9]|40)|459362|459364|459389|459470|459(499|500|501)|45951[1-2]|459545|" +
"45956[6-8]|459(6[0-9][0-9]|7[0-9][0-9])|459847|460024|4658(30|[4-7][0-9])|4659(01|[1-4][0-9]|50)|472628|472684|474503|474551|" +
"4751[1-5][0-9]|475183|4757[1-5][0-9]|4762[2-6][0-9]|4763[4-8][0-9]|480240|4818(76|[8-9][0-9])|481900|48191[5-7]|4821(7[4-9]|80)|" +
"48218[2-3]|482185|4821(89|9[0-3])|482871|482874|483192([0-2][2-9][0-9]|3[0-8][0-9]|39[0-3])|48319[3-4]|48320[4-6]|4
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@cowboy
cowboy / jquery.ba-seq.js
Created March 2, 2011 02:02
jQuery seq: execute code sequentially, for each selected element.
/*!
* jQuery seq - v0.1 - 03/1/2011
* http://benalman.com/
*
* Copyright (c) 2011 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($){