Skip to content

Instantly share code, notes, and snippets.

View exavolt's full-sized avatar

Rezal exavolt

View GitHub Profile
@exavolt
exavolt / amazon_sender.py
Created January 21, 2012 02:17 — forked from amix/amazon_sender.py
Amazon SES helper script using boto
# -*- coding: utf-8 -*-
"""
amazon_sender.py
~~~~~~~~
Python helper class that can send emails using Amazon SES and boto.
The biggest feature of this class is that encodings are handled properly.
It can send both text and html emails.
This implementation is using Python's standard library (which opens up for a lot more options).
@exavolt
exavolt / urlify.py
Created January 19, 2011 16:37
The name says...
#!/usr/bin/env python
import cgi
import re
import elml
def _urlify_re_proc(match):
#TODO: Truncate the display text for long URLs. e.g.:
@exavolt
exavolt / mentionify.py
Created January 19, 2011 16:30
Simple Twitter like mention with RegEx
import re
_user_re = re.compile(r"""\B@([0-9a-zA-Z_]+)""")
def mentionify(text)
return _user_re.sub(r'@<a href="/user/\1">\1</a>', text)
@exavolt
exavolt / lagrangepolynomial.js
Created December 27, 2010 23:31
A class to perform Lagrange polynomial interpolation from a set of points
var LagrangePolynomial = (function(points){
var cc = {};
cc.points = points;
cc.calc = (function(x){
var n = this.points.length;
var y = 0.0;
var j = 0;
var k = 0;
var Lx = 1.0;