Skip to content

Instantly share code, notes, and snippets.

Avatar

Leonhard Melzer leomelzer

View GitHub Profile
@leomelzer
leomelzer / README.md
Last active Apr 4, 2017
PV/VV: NPS implementation with Wootric
View README.md

PV/VV: NPS implementation with Wootric

NPS in our App: NPS

Net Promoter or Net Promoter Score (NPS) is a management tool that can be used to gauge the loyalty of a firm's customer relationships. It serves as an alternative to traditional customer satisfaction research and claims to be correlated with revenue growth. NPS has been widely adopted with more than two thirds of Fortune 1000 companies using the metric.

https://en.wikipedia.org/wiki/Net_Promoter

How to get NPS in your (Ember) App

@leomelzer
leomelzer / suppressions.py
Created Oct 24, 2016
Process SendGrid suppressions into SparkPost compatible format. Allows diffing of email CSVs to exclude previously bounced addresses.
View suppressions.py
#!/usr/local/bin/python3
import csv
import argparse
from os import path
def combine_suppressions(outfilename='suppressions.csv'):
suppressions = set()
suppression_map = {
'suppression_blocks.csv': 2,
View count_words.py
"""Count words."""
def count_words(s, n):
"""Return the n most frequently occuring words in s."""
# TODO: Count the number of occurences of each word in s
words = s.split(" ")
# set comprehension so we only have unique values
word_frequencies = {word: words.count(word) for word in words}
word_frequency_tuples = [(word, count) for word, count in word_frequencies.items()]
@leomelzer
leomelzer / tmux_local_install.sh
Last active Nov 24, 2015 — forked from sharjeelsayed/tmux_local_install.sh
bash script for installing tmux without root access.Updated to include latest Tmux version and some other minor changes
View tmux_local_install.sh
#!/bin/bash
# Source: https://gist.github.com/ryin/3106801
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=2.1
View keybase.md

Keybase proof

I hereby claim:

  • I am leomelzer on github.
  • I am leomelzer (https://keybase.io/leomelzer) on keybase.
  • I have a public key whose fingerprint is B830 BC00 A09B EA9E 22D1 BA1F 6CA2 10A5 16B7 7B28

To claim this, I am signing this object:

@leomelzer
leomelzer / howto.md
Created Oct 24, 2012
Installing ImageMagick & Ghostscript on Ubuntu
View howto.md
  1. You have Ghostscript installed, right? Otherwise sudo apt-get install ghostscript
  2. This is important and installs the headers (iapi.h etc) which are required but don't come with the default Ghostscript package: sudo apt-get install libgs-dev
  3. I also needed sudo apt-get install gs-esp
  4. For me the pre compiled version of ImageMagick never accepted Ghostscript, so let's remove it: sudo apt-get --purge remove imagemagick
  5. Get the source of ImageMagick, untar it, cd ImageMagick-xx
  6. ./configure --with-gslib=yes [and what else you need]
  7. Confirm in the output near the bottom gslib yes yes and not gslib yes no
  8. make
  9. make install
  10. Run convert -list configure | grep DELEGATES => DELEGATES bzlib djvu freetype gs jpeg jng jp2 lcms png tiff x11 xml zlib
@leomelzer
leomelzer / howto.md
Created Oct 22, 2012
vpnc with hybrid authentication on OS X Mountain Lion
View howto.md

How To

  1. Install homebrew if you don't have it already: http://mxcl.github.com/homebrew/
  2. Run brew install vpnc --hybrid
  3. Check if you already have virtual tunnel interfaces, run ls /dev/tun*. If there are none, install "Tun Tap OSX" (see below)
  4. Go to https://www.rz.uni-konstanz.de/angebote/e-mail/usermanager/ and login, then download both the certificate (you need the .pem file) and vpn profile
  5. Run openssl x509 -in <certificateFile>.pem -noout -hash
  6. Rename <certificateFile>.pem to the output of (5) with .pem as extension
  7. Move the .pem certificate to a permanent location, e.g. /etc/ssl/certs/
  8. Open /usr/local/etc/vpnc/default.conf in your favorite text editor, delete the contents
  9. Run pcf2vpnc <pathToVpnProfile>/<profile>.pcf and paste the output to your open text editor
@leomelzer
leomelzer / gist:3192524
Created Jul 28, 2012
Skype Spam - the best
View gist:3192524

Hello Hewitt

I am sorry to contact you unannounced through this medium. My name is Mr. Jayden Mensah, Deputy General Manager-Audit & Compliance at Barclays Bank Ltd Ghana. I write you this proposal in good faith hoping that I will rely on you. In 2006, one Mr. Daniel Hewitt who has same surname as yours and your country in his file as his country of origin, made a fixed deposit for 36 calendar months, valued at $8,400,000.00 with my bank. I was his account officer before I rose to the position of the auditor general now. The maturity date for this deposit contract was 16th of January 2009. Unfortunately, while he was on a business trip, he died leaving the funds unclaimed in my bank without any beneficiary in a deadly earthquake that occurred on May 12, 2008 in Sichuan province of China which killed at least 68,000 people, wish he was among the victim.

I need your cooperation so as to make my bank send you the fund as the beneficiary and next of kin to the fund. This transaction will be of a great mutual as

@leomelzer
leomelzer / Analyse.java
Created Jul 9, 2012
Simple-stupid Sentiment analysis for 1 million tweets.
View Analyse.java
package analyse;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@leomelzer
leomelzer / readme.md
Created Jan 5, 2012
Set proper Resolution on Linux for "Unknown Display"
View readme.md

The following is for the AOC 931sn.

  • Find the Recommended Resolution for your Display (on Manufacturer Website or similar)
  • Run the following in you shell
  • Press the "Auto Adjust" Button on your Display