Skip to content

Instantly share code, notes, and snippets.

View sixthgear's full-sized avatar

Joshua Cender sixthgear

View GitHub Profile
@sixthgear
sixthgear / librets_install.txt
Created October 21, 2015 06:59 — forked from dmpeters/librets_install.txt
librets installations with python bindings only
# Debian 7 x64, Ubuntu 14.04 x64, Ubuntu 12.04.4 x64
*NOTE (tested on Digital Ocean VM's w/ > 512MB of RAM - gcc runs out of memory on VM's <= 512 MB)
apt-get update
aptitude safe-upgrade
apt-get install build-essential libboost-all-dev libcurl4-gnutls-dev autoconf antlr swig python-dev
*NOTE (for python 3 support add 'python3-dev' to the end of line 5)
cd /tmp
wget https://github.com/NationalAssociationOfRealtors/libRETS/archive/1.6.1.tar.gz
@sixthgear
sixthgear / emperor.sh
Last active August 29, 2015 14:06 — forked from mariuz/emperor.sh
#!/usr/bin/env bash
### BEGIN INIT INFO
# Provides: 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
@sixthgear
sixthgear / gunicorn
Created August 22, 2014 20:36 — forked from xspager/gunicorn
#!/bin/sh
### BEGIN INIT INFO
# Provides: gunicorn
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the gunicorn server
# Description: starts gunicorn using start-stop-daemon
"""A simple implementation of a greedy transition-based parser. Released under BSD license."""
from os import path
import os
import sys
from collections import defaultdict
import random
import time
import pickle
SHIFT = 0; RIGHT = 1; LEFT = 2;
#sixthgear, one-up me willya
map = lambda s,f: __builtins__.map(f,s)
# kaptin, safe from desg
def map(source, func):
return __builtins__.map(func, source)
# sixthgear
def mop(source, func):
return map(func, source)
//The sum of the squares of the first ten natural numbers is,
//12 + 22 + ... + 102 = 385
//The square of the sum of the first ten natural numbers is,
//(1 + 2 + ... + 10)2 = 552 = 3025
/*Hence the difference between the sum of the squares of the first ten
natural numbers and the square of the sum is 3025 − 385 = 2640.*/
/*Find the difference between the sum of the squares of the first one
@sixthgear
sixthgear / file.js
Created August 10, 2011 03:16 — forked from anonymous/file.js
/*Using JQuery to pull files from italy.xml*/
$(document).ready(function() {
$.ajax({
type: "GET",
url: "xml/italy.xml",
dataType: "xml",
success: handleResponse
});
}); //end ready
#include <stdio.h>
int main(int l, char **a) {
for(int i = 0; i < l/2; a[++i] = (((int)a[i]+(int)a[l-i])-(int)(a[l-i]=a[i])) );
for(int i = 1; i < l; ++i)
printf("%s ", a[i]);
return 0;
}
<script type="text/javascript">
function getData() {
$.getJSON("script.php", function(data) {
$.each(data, function(index) {
$("#high").html(data[index].high + "<br />" + Math.floor(Math.random()*111));
});
});
}
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."