Skip to content

Instantly share code, notes, and snippets.

View leomelzer's full-sized avatar

Leonhard Melzer leomelzer

View GitHub Profile
@leomelzer
leomelzer / main.workflow
Created January 8, 2019 09:29
The textual representation of the workflow, `main.workflow`.
workflow "Deploy to Now" {
on = "push"
resolves = [
"Alias",
"Filter out master branch",
]
}
action "Deploy" {
uses = "actions/zeit-now@master"
@leomelzer
leomelzer / package.json
Created January 8, 2019 09:28
Simplified package.json with the added now-build script.
{
"name": "jetztein",
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"now-build": "npm run build && mv build dist"
}
}
@leomelzer
leomelzer / now.json
Created January 8, 2019 09:27
now.json file with routing rules for a Create-React-App.
{
"version": 2,
"name": "jetztein",
"alias": "jetztein.de",
"builds": [{ "src": "package.json", "use": "@now/static-build" }],
"regions": ["bru"],
"routes": [
{ "src": "^/static/(.*)", "dest": "/static/$1" },
{ "src": "^/favicon.ico", "dest": "/favicon.ico" },
{ "src": "^/asset-manifest.json", "dest": "/asset-manifest.json" },
@leomelzer
leomelzer / readme.md
Created January 5, 2012 05:36
Set proper Resolution on Linux for "Unknown Display"

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
var t = require('../test-lib/test.js');
var assert = require('assert');
var _ = require('@sailshq/lodash');
var apos;
describe('Express', function() {
this.timeout(t.timeout);
it('express should exist on the apos object', function(done) {
@leomelzer
leomelzer / index.js
Created June 19, 2018 12:13
metatag-diff: Compare (diff) metatags of prod and stage host version given an article slug.
const fetch = require("node-fetch");
const cheerio = require("cheerio");
const diff = require("diff");
const colors = require("colors");
const inputSlug = process.argv[2];
const notImplemented = [
"[rel=amphtml]",
"[property='og:image']",
@leomelzer
leomelzer / Analyse.java
Created July 9, 2012 09:02
Simple-stupid Sentiment analysis for 1 million tweets.
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
Last active April 4, 2017 15:53
PV/VV: NPS implementation with Wootric

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 October 24, 2016 22:55
Process SendGrid suppressions into SparkPost compatible format. Allows diffing of email CSVs to exclude previously bounced addresses.
#!/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,
@leomelzer
leomelzer / tmux_local_install.sh
Last active November 24, 2015 14:32 — 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
#!/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