Skip to content

Instantly share code, notes, and snippets.

View dmpeters's full-sized avatar
👨‍🔧

David Peters dmpeters

👨‍🔧
View GitHub Profile
@dmpeters
dmpeters / librets_install.txt
Created July 15, 2014 21:56
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
<script type="text/javascript">
$(document).ready(function() {
var n = $("tbody>tr").length;
console.log(n);
$("#cts").text(n);
$(".filter").change(function () {
var r = $('tbody>tr:visible').length;
console.log(r);
})
@dmpeters
dmpeters / librets_ubuntu_recipe.txt
Last active October 15, 2018 01:11
librets ubuntu recipe
spin up vagrant precise64
sudo apt-get update && sudo apt-get install build-essential
### librets
sudo apt-get install libexpat1-dev libcurl3-dev libboost-dev libboost-filesystem-dev antlr antlr3 libantlr-dev swig libboost-program-options-dev python-dev
wget http://www.crt.realtors.org/projects/rets/librets/files/librets-1.5.3.tar.gz

Keybase proof

I hereby claim:

  • I am dmpeters on github.
  • I am dmpeters63 (https://keybase.io/dmpeters63) on keybase.
  • I have a public key ASAnsztVeuUCPoBehuG5qth7wvALLo79Gp5S8zgZI9Y7kQo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am dmpeters on github.
  • I am doxdpeters (https://keybase.io/doxdpeters) on keybase.
  • I have a public key ASCoOsiomE0jJQloGlC0o1hANU9bOq78zsqGvsS53xkReAo

To claim this, I am signing this object:

@dmpeters
dmpeters / thing.py
Last active January 1, 2016 15:49
thing
def formater_a(city):
pos1 = city.find('(') - 1 # finds the position of the first parenthese and substracts 1
pos2 = city.find(')') - 2 # finds the position of the second parenthese and substracts 2 (assumes the the final 3 characters are a state abbreviation with a closing parenthese)
return '{0}, {1}'.format(city[:pos1], city[pos2:-1]) # returns a formated string of the city by slicing
def formater_b(city):
return city.replace(',', '').replace(' ', '-').lower() # returns a formated string of the city by removing any commas and replacing any empty spaces with dashes
z = ['Del Mar (San Diego, CA)', 'Alamo, CA']
@dmpeters
dmpeters / url_ex.py
Created September 6, 2013 18:12
url example list script
import requests
url_list = ['url1', 'url2', 'etc']
bad_urls = []
good_urls = []
for url in url_list:
r = requests.get(url)
if r.status_code == 404:
bad_urls.append(url)
sudo apt-get update
sudo apt-get install openjdk-6-jdk
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.8.deb
sudo dpkg -i elasticsearch-0.19.8.deb
# be sure you add "action.disable_delete_all_indices" : true to the config!!
# if you want to remove it:
sudo dpkg -r elasticsearch
VERSION=0.20.6
sudo apt-get update
sudo apt-get install openjdk-6-jdk
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$VERSION.deb
sudo dpkg -i elasticsearch-$VERSION.deb
# be sure you add "action.disable_delete_all_indices" : true to the config!!
@dmpeters
dmpeters / private_gist_to_public_gist.md
Last active December 17, 2015 20:59
How to move a private gist to public gist in 6 easy steps

How to move a private gist to public gist in 6 easy steps

  1. git clone git@gist.github.com:/[PRIVATE GIST UNIQUE ID].git private_gist_temp
  2. cd private_gist_temp
  3. create public temp gist
  4. git remote set-url origin git@gist.github.com:/[PUBLIC GIST UNIQUE ID].git
  5. git push -f
  6. refresh public gist