Skip to content

Instantly share code, notes, and snippets.

View kremalicious's full-sized avatar

Matthias Kretschmann kremalicious

View GitHub Profile
@kremalicious
kremalicious / PageLayout.php
Created March 26, 2012 12:09
Stud.IP Einbindung Touch Icons
<?
public static function initialize()
{
// set touch icons and favicon
self::addHeadElement('link', array('rel' => 'apple-touch-icon-precomposed', 'href' => Assets::image_path('apple-touch-icon-144x144-precomposed.png'), 'sizes' => '144x144'));
self::addHeadElement('link', array('rel' => 'apple-touch-icon-precomposed', 'href' => Assets::image_path('apple-touch-icon-114x114-precomposed.png'), 'sizes' => '114x114'));
self::addHeadElement('link', array('rel' => 'apple-touch-icon-precomposed', 'href' => Assets::image_path('apple-touch-icon-72x72-precomposed.png'), 'sizes' => '72x72'));
self::addHeadElement('link', array('rel' => 'apple-touch-icon-precomposed', 'href' => Assets::image_path('apple-touch-icon-precomposed.png') ));
self::addHeadElement('link', array('rel' => 'shortcut icon', 'href' => Assets::image_path('favicon.ico') ));
@kremalicious
kremalicious / remove-bitly-links.php
Created June 19, 2012 16:11
WordPress plugin to remove all bit.ly links from post content, keeping the anchor text

Keybase proof

I hereby claim:

  • I am kremalicious on github.
  • I am kremalicious (https://keybase.io/kremalicious) on keybase.
  • I have a public key whose fingerprint is 9AC0 F790 EED7 64A0 1838 C829 BD3C 1F3E DD78 31FC

To claim this, I am signing this object:

@kremalicious
kremalicious / tor.sh
Last active August 18, 2019 18:24
Start Tor and switch the system-wide proxy settings in OS X
#!/usr/bin/env bash
#
# ######################################################################
# Start Tor and switch the system-wide proxy settings in OS X
# ----------------------------------------------------------------------
# Usage:
# just run tor.sh in Terminal, kill with ctrl + c
# ----------------------------------------------------------------------
# more info:
# https://kremalicious.com/simple-tor-setup-on-mac-os-x/
@kremalicious
kremalicious / aws-iam-ssl.sh
Created August 1, 2015 00:24
Upload custom SSL certificate to AWS
# http://docs.aws.amazon.com/IAM/latest/UserGuide/ManagingServerCerts.html
aws iam upload-server-certificate \
--server-certificate-name certificate_object_name \
--certificate-body file://public_key_certificate_file.pem \
--private-key file://privatekey.key \
--certificate-chain file://certificate_chain_file.pem \
--path /cloudfront/
@kremalicious
kremalicious / dnt.js
Last active November 27, 2015 21:00
Check for user's DNT browser setting
//
// check for user's DNT browser setting
//
(function (dnt) {
var DNT = 'no';
if (dnt !== "yes" && dnt !== "1") {
DNT = 'yes';
}
}(navigator.doNotTrack || navigator.msDoNotTrack || window.doNotTrack || window.msDoNotTrack || null));
@kremalicious
kremalicious / offline-site.sh
Last active February 23, 2018 23:35
Download complete website for offline viewing with wget
wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains website.org \
www.website.org
brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aacc
ffmpeg -i input-file.mp4 -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis output-file.webm
@kremalicious
kremalicious / web-server-setup.sh
Last active December 4, 2019 12:17
Web Server Setup with LEMP stack (Ubuntu 14.04 LTS)
# Ubuntu 14.04 LTS
######################################
# INITIAL SETUP
######################################
ssh root@1.2.3.4
##
# set hostname
@kremalicious
kremalicious / default.conf
Last active December 4, 2019 12:16
nginx default site config
##
# /etc/nginx/conf.d/default.conf
##
server {
listen 80;
server_name localhost 1.2.3.4;
location / {
root /var/www/default/html;