Skip to content

Instantly share code, notes, and snippets.

View nachbarshund's full-sized avatar
🤓
Coding

Christopher Zotter nachbarshund

🤓
Coding
View GitHub Profile

Install certbot

sudo su
yum install wget -y
wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto

Install certificate

@marcusgadbem
marcusgadbem / index.js
Last active November 25, 2021 22:20
Middleware to minify HTML output for express template render engines in which supports callbacks
/* app/controllers/index.js */
module.exports.index = function(req, res) {
res.render('index.html');
};
openssl genrsa 2048 > host.key
openssl req -new -x509 -nodes -sha1 -days 3650 -key host.key > host.cert
#[enter *.localhost.dev for the Common Name]
openssl x509 -noout -fingerprint -text < host.cert > host.info
cat host.cert host.key > host.pem
Trust cert
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain host.cert
@mpneuried
mpneuried / Backbone.sub.coffee
Last active December 9, 2016 07:55
Backbone collection extension to solve sub collections.The models withtin the (sub)collection-tree will be distributed within all involved collections under consideration of each filter.
###
EXAMPLE USAGE
parentColl = new Backbone.Collection.Extended()
# by Array
subCollA = parentColl.sub( [ 1, 2, 3 ] )
# or by Object
subCollO = parentColl.sub( { name: "Foo", age: 42 } )
@mpneuried
mpneuried / middleware.coffee
Created February 14, 2013 15:05
Middleware solution to run multiple tasks
class Middleware
constructor: ->
# define a shared object witch will be routed through all called methods
shared = {}
# run the middleware method to process all defined methods
# If one method fails by calling error the queue will be stopped
@middleware shared, @simpleCall, @addSomeMethods, ( err, shared )=>
if err
@marco-martins
marco-martins / touch-tooltip-fix.js
Created June 26, 2012 10:31 — forked from slawekkolodziej/touch-tooltip-fix.js
Highcharts tracker now don't prevent default behavior (like scrolling on touch devices).
Highcharts.Chart.prototype.callbacks.push(function(chart) {
var hasTouch = hasTouch = document.documentElement.ontouchstart !== undefined,
mouseTracker = chart.tracker,
container = chart.container,
mouseMove;
mouseMove = function (e) {
// let the system handle multitouch operations like two finger scroll
// and pinching
if (e && e.touches && e.touches.length > 1) {