Skip to content

Instantly share code, notes, and snippets.

View willwade's full-sized avatar
🌏
Working on dasher and a lot of Ace hardware projects

will wade willwade

🌏
Working on dasher and a lot of Ace hardware projects
View GitHub Profile
@9re
9re / clean_mac_files_from_zip.sh
Created November 17, 2011 11:47
remove __MACOSX and .DS_Store files from zip files
#!/bin/bash
# remove __MACOSX foldr and .DS_Store files
# from *_original.zip file
# zip again and place under fixed/*
for x in $*
do
unzip $x
@jseabold
jseabold / translate.py
Created December 13, 2011 18:58
Use Google Translate API from Python
# -*- coding: utf-8 -*-
"""
You need to fill in your API key from google below. Note that querying
supported languages is not implemented.
Language Code
-------- ----
Afrikaans af
Albanian sq
Arabic ar
@commadelimited
commadelimited / 2011-01-17-01.js
Created January 19, 2012 20:56
Morse Code Generator
var morse = {
a: '.-', b: '-...', c: '-.-.', d: '-..',
e: '.', f: '..-.', g: '--.', h: '....',
i: '..', j: '.---', k: '-.-', l: '.-..',
m: '--', n: '-.', o: '---', p: '.--.',
q: '--.-', r: '.-.', s: '...', t: '-',
u: '..-', v: '...-', w: '.--', x: '-..-',
y: '-.--', z: '--..', 0: '-----', 1: '.----',
2: '..---', 3: '...--', 4: '....-', 5: '.....',
6: '-....', 7: '--...', 8: '---..', 9: '----.'
@x-Code-x
x-Code-x / readme_install_node
Created April 30, 2012 20:52
Install npm node.js on Debian Squeeze / Wheezy / Linux Mint Debian Edition
#Quick cp from http://sekati.com/etc/install-nodejs-on-debian-squeeze
#
#Needed to install TileMill from MapBox
#
#Installs node.js which has npm bundled
#
#Build Dependencies
sudo apt-get update && apt-get install git-core curl build-essential openssl libssl-dev
@lukaslundgren
lukaslundgren / python27_on_debian.sh
Created May 11, 2012 12:58
How to install python 2.7 on debian
sudo apt-get install build-essential libsqlite3-dev zlib1g-dev libncurses5-dev libgdbm-dev libbz2-dev libreadline5-dev libssl-dev libdb-dev
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar -xzf Python-2.7.3.tgz
cd Python-2.7.3
./configure --prefix=/usr --enable-shared
make
sudo make install
cd ..
@dpapathanasiou
dpapathanasiou / text_grabber.py
Created October 27, 2012 15:18
How to extract just the text from html page articles
"""
A series of functions to extract just the text from html page articles
"""
from lxml import etree
default_encoding = "utf-8"
def newyorker_fp (html_text, page_encoding=default_encoding):
"""For the articles found on the 'Financial Page' section of the New Yorker's website
@willwade
willwade / citeusync.py
Last active April 7, 2019 01:48
inspired by the perl version - but not quite the same. Simply use to download your bibtex file and attachments on a regular basis. NB: Only downloads the PDF if not already present so technically only 2 calls at a minimum to CUL (Login and download of bibtex. Obviously a lot more if downloading the PDFs). If more than one attachment - will only …
#!/usr/bin/env python
# Contact: Will Wade willwa.de
# Date: April 2013
# Needs mechanize and pybtex
#
# NB: Little error checking going on in this script
# TO-DO: Check last-download-date of bibtex file later than last-modified date on CUL. ? possible
#
# With thanks to https://pypi.python.org/pypi/citeulike_api/0.1.3dev for the login part
import mechanize
@postrational
postrational / gunicorn_start.bash
Last active April 4, 2024 12:48
Example of how to set up Django on Nginx with Gunicorn and supervisordhttp://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
#!/bin/bash
NAME="hello_app" # Name of the application
DJANGODIR=/webapps/hello_django/hello # Django project directory
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket
USER=hello # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name
@t-paul
t-paul / 00info.txt
Last active March 3, 2019 01:51
openscad
Image link:
![My Image](https://gist.github.com/t-paul/7171783#file-openscad-freetype-4-png)
@mattzuba
mattzuba / 03_s3fs.config
Created November 24, 2014 16:23
s3fs-fuse on AWS Elastic Beanstalk
packages:
yum:
gcc: []
libstdc++-devel: []
gcc-c++: []
fuse: []
fuse-devel: []
libcurl-devel: []
libxml2-devel: []
openssl-devel: []