Skip to content

Instantly share code, notes, and snippets.

View mat's full-sized avatar

Matthias Lüdtke mat

View GitHub Profile
@mat
mat / Readme.markdown
Last active February 19, 2024 07:46
apple-app-site-association —with examples

“apple-app-site-association” file

One file for each domain, both www.example.com and example.com need separate files:

{
    "applinks": {
        "apps": [],
        "details": {
 "9JA89QQLNQ.com.apple.wwdc": {
@mat
mat / rlikestats
Created July 18, 2011 21:29
R like stats, command line style
#!/usr/bin/env ruby
#
# Now living in https://github.com/mat/dotfiles
#
class Rlikestats
attr_accessor :values, :count, :mean, :stdev, :lines
def initialize
@mat
mat / msci-world-performance.csv
Created November 21, 2017 12:47
MSCI World Performance
Year MSCI World Inflation Germany Net Growth
1970 -1.98% 3.1% -5.08%
1971 19.56% 4.7% 14.86%
1972 23.55% 4.6% 18.95%
1973 -14.51% 6.6% -21.11%
1974 -24.48% 7.2% -31.68%
1975 34.50% 5.4% 29.10%
1976 14.71% 3.2% 11.51%
1977 5.00% 3.9% 1.10%
1978 18.22% 2.4% 15.82%
@mat
mat / hey.txt
Created July 27, 2017 10:56
hey load testing
# https://github.com/rakyll/hey
./hey https://google.com
Summary:
Total: 0.8679 secs
Slowest: 0.5881 secs
Fastest: 0.0710 secs
Average: 0.1778 secs
Requests/sec: 230.4501
@mat
mat / typhoeus_to_curl.rb
Created July 18, 2014 16:46
Typhoeus request to curl command string.
#
# Generate curl command from a Typhoeus request.
#
# Example:
#
# > request = Typhoeus::Request.post("http://example.com", {body: "fine stuff"}).request
# > TyphoeusToCurl.new.to_curl(request)
#
# => "curl 'http://example.com' -X POST -H \"User-Agent: Typhoeus" -d 'fine stuff' --compressed"
#
@mat
mat / mozjpeg_mac_os_x.markdown
Created December 8, 2015 18:20
Building mozjpeg 3.1 on Mac OS X
@mat
mat / artifacts.py
Last active January 19, 2016 13:00
Pillow PNG artifacts
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This script reproduces the issue with artifacts when
# handling (semi)transparent PNG files:
# https://github.com/python-pillow/Pillow/issues/1449
# Version used:
#
@mat
mat / poor_time_machine.txt
Created December 3, 2015 14:36
Poor Man's TimeMachine Backup
TimeMachine using cron and rsync ;-)
Backs up in two intervals: 10 and 60 minutes
$ crontab -l
*/10 * * * * rsync -a -q --delete ~/projects/ ~/Desktop/projects10/
0 * * * * rsync -a -q --delete ~/projects/ ~/Desktop/projects60/
@mat
mat / HowFastIsMax.java
Created October 5, 2011 21:25
How fast is it: Picking the max out of 1 Mio ints
import java.util.*;
public class HowFastIsMax {
private static final int INTEGERS_IN_LIST = 1000000;
private static final int TEST_RUNS = 10;
public static void main(String[] args) {
List<Integer> list = fillRandomIntList();
for (int i = 0; i < TEST_RUNS; i++) {
@mat
mat / ruby-prof-irb.rb
Created August 31, 2011 11:27
ruby-prof irb helper
# ~/.irbrc
# $ gem install ruby-prof
# $ irb
# >> profile2file { 500_000.times{345345 ** 15} }
# Find profile results in /Users/mat/profile-1314789858.[txt|html]
# => 500000
module Kernel
def profile2file(filename = "profile-#{Time.now.to_i}")