Skip to content

Instantly share code, notes, and snippets.

View jaymzcd's full-sized avatar
🍜
Maybe cooking some pad thai

jaymz campbell jaymzcd

🍜
Maybe cooking some pad thai
View GitHub Profile
======================================================
Setting up Django using Apache/mod_wsgi on Ubuntu 8.10
======================================================
This article will cover setting up Django using Apache/mod_wsgi on Ubuntu
8.10. The article is targeted at a production environment, but keep in mind
this is a more generalized environment. You may have different requirements,
but this article should at least provide the stepping stones.
The article will use distribution packages where nesscary. As of 8.10 the
@endolith
endolith / Has weird right-to-left characters.txt
Last active June 1, 2024 10:58
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
#!/bin/bash
android create project --target 1 --name "$1" --path ${1,,} --activity $1 --package eu.jaymz.${1,,}
@jaymzcd
jaymzcd / geocode.py
Created October 20, 2010 16:03
Reads in some data from a database and then makes requests for the Lat/Long via googles maps API
#!/usr/bin/python2.6
# -*- coding: utf-8 -*-
from xml.dom import minidom
import MySQLdb
import urllib
import time
# Conf for the script follows
PK = 0
CREATE USER 'whatever'@'localhost' IDENTIFIED BY 'laPass';
GRANT ALL ON thedb.* TO 'whatever'@'localhost';
FLUSH PRIVILEGES;
@jaymzcd
jaymzcd / settings.py
Created January 24, 2011 12:03
A base for my django settings file
# Django settings for geoipredirect project.
import os
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('jaymz', 'jaymz@u-dox.com'),
)
@mikesusz
mikesusz / pre-commit.sh
Created February 1, 2011 16:52
a git pre-commit hook for compass compiling of sass to css
#!/bin/sh
#
# this pre-commit script uses compass to compile and compress stylesheet partials
compass compile wp-content/themes/mytheme/ -s compact --force --no-line-comments
wait $!
git add wp-content/themes/mytheme/style.css
@jaymzcd
jaymzcd / gist:842535
Created February 24, 2011 17:46
Override console.log to avoid exceptions in browsers that don't support it or where it's not enabled
if (typeof console == "undefined" || typeof console.log == "undefined") var console = { log: function() {} };
@alexbowe
alexbowe / nltk-intro.py
Created March 21, 2011 12:59
Demonstration of extracting key phrases with NLTK in Python
import nltk
text = """The Buddha, the Godhead, resides quite as comfortably in the circuits of a digital
computer or the gears of a cycle transmission as he does at the top of a mountain
or in the petals of a flower. To think otherwise is to demean the Buddha...which is
to demean oneself."""
# Used when tokenizing words
sentence_re = r'''(?x) # set flag to allow verbose regexps
([A-Z])(\.[A-Z])+\.? # abbreviations, e.g. U.S.A.
@zefer
zefer / copy-s3-bucket.rb
Created April 4, 2011 11:24
Copy contents of an S3 bucket to a another bucket using an EC2 instance and a simple Ruby script. Useful for transferring large amounts of data and will work across geographic regions.
require 'rubygems'
require 'right_aws'
aws_access_key_id = 'your-access-key'
aws_secret_access_key = 'your-secret-key'
target_bucket = 'your-source-bucket'
destination_bucket = 'your-destination-bucket'
s3 = RightAws::S3Interface.new(aws_access_key_id, aws_secret_access_key)