Skip to content

Instantly share code, notes, and snippets.

View flooie's full-sized avatar

William Palin flooie

  • Free Law Project
  • Cambridge, MA
View GitHub Profile
@dongyuwei
dongyuwei / MagickWand-sucks.md
Last active February 15, 2024 12:46
ImportError: MagickWand shared library not found. You probably had not installed ImageMagick library.

Wand==0.3.7, Python 3.4.3, OSX EI Capitan 10.11

when run from wand.image import Image it throw errors:

ImportError: MagickWand shared library not found. You probably had not installed ImageMagick library. Try to install: brew install freetype imagemagick

ok, first I try this:

@arnesund
arnesund / get_tweets.py
Last active January 30, 2017 23:41
Fetch tweets from Twitter using Python module Tweepy
# Get details about own user
me = api.me()
friends = api.friends_ids(me.id)
# Initialize data structure
tweets = {}
# Fetch lists recent tweets for each of the user IDs in the list 'friends'
for user in friends:
# Only query Twitter for data not already cached
@john-guerra
john-guerra / README.md
Last active January 28, 2024 19:19 — forked from kristw/index.html
GeoJson map of Colombia

Geo Json map of Colombia

Based on the Map of Thailand by Master Krist Wongsuphasawat, a simple map of Colombia using GeoJSON and D3.js

As in Krist example:

  • Each province is color-coded by the length of its name in English.
  • Hover each province to see text effects.
  • New font is chosen randomly every time you change the province.
@dlebech
dlebech / uwsgi-emperor
Created February 2, 2015 16:09
uWSGI start/stop script that can be added to /etc/init.d on Ubuntu Linux and used with "sudo service uwsgi-emperor start"
#!/usr/bin/env bash
### BEGIN INIT INFO
# Provides: uwsgi-emperor
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the uwsgi emperor app server
# Description: starts uwsgi emperor app server using start-stop-daemon
@drorata
drorata / gist:146ce50807d16fd4a6aa
Last active June 3, 2024 06:00
Minimal Working example of Elasticsearch scrolling using Python client
# Initialize the scroll
page = es.search(
index = 'yourIndex',
doc_type = 'yourType',
scroll = '2m',
search_type = 'scan',
size = 1000,
body = {
# Your query's body
})
@whacked
whacked / celerypolling.py
Created August 29, 2014 06:34
minimal runnable example of Flask + celery worker + jquery progress polling
'''
testing celery progress reporting/polling
* start server
python tempserver.py
* start worker
celery -A tempserver worker -c 1 --loglevel=DEBUG
@six519
six519 / convert_test.py
Created August 20, 2014 07:44
Convert file to another file format using LibreOffice API in Python
#!/usr/bin/env python3
"""
VIEW COMPLETE CODE AT
=====================
* https://github.com/six519/libreoffice_convert
THANKS
======
@soheilhy
soheilhy / nginxproxy.md
Last active May 16, 2024 08:59
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@dalelane
dalelane / generateswimics.py
Created January 19, 2014 22:55
Create an iCalendar file with the swimming sessions available at Fleming Park Leisure Centre by scraping the timetable on their site
#
# Create an ICS calendar with the sessions available at a DC Leisure Centre
# using the info found by scraping the timetable website
#
# http://dalelane.co.uk/blog/?p=3017
#
# Dale Lane
# dale.lane@gmail.com
#
@jefffriesen
jefffriesen / README.md
Last active May 2, 2024 15:11
US Zip Codes

This is a d3.js visualization of US zip codes.

Original zip code dataset from Geocommons.

5MB shapefile with properties such as zipcode, state, name, population, area, more.

http://geocommons.com/overlays/54893 (Thank you Bill Greer)

This converts it nicely: