Skip to content

Instantly share code, notes, and snippets.

View justinvw's full-sized avatar

Justin van Wees justinvw

View GitHub Profile
@justinvw
justinvw / keybase.md
Created October 30, 2016 18:23
Keybase

Keybase proof

I hereby claim:

  • I am justinvw on github.
  • I am justinvw (https://keybase.io/justinvw) on keybase.
  • I have a public key ASDhpRx3E06Ox24RwYcm1Gj4relON8te0CSr-HOroZJAjQo

To claim this, I am signing this object:

@justinvw
justinvw / megatron.log
Created January 23, 2015 11:28
Megatron v1.1.0 "--import-contacts" fail log
2015-01-23 11:23:56.409 INFO - Megatron 1.1.0 (2015-01-22 15:14:22) started.
2015-01-23 11:23:57.927 ERROR - No import filename provided
2015-01-23 11:23:57.928 INFO - Reading system data from file: /home/vagrant/megatron-source/megatron-java/dist/megatron-java/conf/dev/systemdata.txt
2015-01-23 11:23:57.928 DEBUG - Processing line: # This file contains test data which can be used to populate a dev-db.
2015-01-23 11:23:57.929 DEBUG - Line is comment
2015-01-23 11:23:57.929 DEBUG - Processing line: # Run Megatron with the switch --import-contacts to import this file.
2015-01-23 11:23:57.930 DEBUG - Line is comment
2015-01-23 11:23:57.930 DEBUG - Processing line:
2015-01-23 11:23:57.930 DEBUG - Processing line: # Priorities
2015-01-23 11:23:57.931 DEBUG - Line is comment
@justinvw
justinvw / hipchat_send.py
Last active December 26, 2015 04:19
Function that can be used to send a notification message to a HipChat room
import json
import requests
def send_message(auth_token, room, message, html=True, color='yellow',
notify=False):
"""Sends a notification message to a HipChat room.
For more information see HipChat's API V2 documentation:
https://www.hipchat.com/docs/apiv2/method/send_room_notification
"""
Dead simple classes to consume the Twitter Streaming API
Last updated: 2013-06-12
:copyright: (c) 2013 by Justin van Wees
"""
import requests
import json
@justinvw
justinvw / es_simple_autocomplete_example_config.sh
Last active January 26, 2021 17:15
Simple ElasticSearch autocomplete example configuration. The 'autocomplete' functionality is accomplished by lowercasing, character folding and n-gram tokenization of a specific indexed field (in this case "city").
# Delete the possibly existing autocomplete test index
curl -X DELETE localhost:9200/autocomplete_test
# Put the config of the autocomplete index
curl -X PUT localhost:9200/autocomplete_test -d '
{
"settings" : {
"index" : {
"analysis" : {
"analyzer" : {
@justinvw
justinvw / updatedyet.py
Created September 16, 2012 09:37
Quick-and-dirty script that notifies you by mail when a webpage of interest changes
import cPickle
import urllib2
import hashlib
from datetime import datetime
import smtplib
from email.mime.text import MIMEText
PICKLE_FILE = '/home/justin/tools/updatedyet.pkl'
MAIL_ON_CHANGE = ['justin@vwees.net']
MAIL_FROM = 'justin@vwees.net'
@justinvw
justinvw / transcode.py
Created May 20, 2012 11:33
Transcode FLAC audio files into MP4/AAC files
#!/usr/bin/env python
# Requirements:
# - beets (https://github.com/sampsyo/beets)
# - flac (http://flac.sourceforge.net/)
# - faac (http://www.audiocoding.com/faac.html)
# TODOS:
# - Use multiple threads (multiprocessing)
# - Replaygain data is copied from src to dest file, but is this fair?
@justinvw
justinvw / csv2xml.py
Created April 19, 2011 09:10
Simple script to convert a CSV file to XML
#!/usr/bin/env python
# encoding: utf-8
"""
csv2xml.py
Created by Justin van Wees on 2011-04-18.
"""
import sys
import os
import string