Skip to content

Instantly share code, notes, and snippets.

View klaemo's full-sized avatar

Clemens Stolle klaemo

View GitHub Profile
@klaemo
klaemo / http.log
Created March 5, 2014 16:21
CouchDB + stud: https vs. http
ab -n 100 -k http://klaemo.me:5984/test/hello
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking klaemo.me (be patient).....done
Server Software: CouchDB/1.5.0
@klaemo
klaemo / gist:10389088
Created April 10, 2014 14:36
docker ubuntu ssl error
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libssl-dev : Depends: libssl1.0.0 (= 1.0.1-4ubuntu3) but 1.0.1-4ubuntu5.12 is to be installed
Recommends: libssl-doc but it is not going to be installed
@klaemo
klaemo / gist:d287654447f2bce0b7b5
Created May 11, 2014 14:27
couchdb permissions
root@24e94f9f65f8:/# ls -l /usr/local/var/lib/
total 4
drwxrwxrwx 2 couchdb couchdb 4096 May 10 14:58 couchdb
root@24e94f9f65f8:/# sudo -i -u couchdb couchdb
sudo: unable to change directory to /usr/local/var/lib/couchdb: Permission denied
root@24e94f9f65f8:/#
@klaemo
klaemo / transaction.js
Created June 3, 2014 14:01
transaction
{
"product": "product-id",
"from": "storage",
"to": "sold",
"volume": 10
}
// or
{
"product": "product-id",
"from": "delivery",
@klaemo
klaemo / main.css
Last active August 29, 2015 14:04
holgi's blog
/* ganz ans Ende der main.css */
body {
margin: 0;
padding: 14px;
font-family: Georgia, serif;
font-size: 16px;
color: #222;
line-height:1.5;
background-color:white;
background-position: top left;
@klaemo
klaemo / index.html
Created July 23, 2014 22:38
stackenblochen mobile
<!-- in den <head> -->
<meta name="viewport" content="width=device-width, initial-scale=1">
@klaemo
klaemo / style.css
Last active August 29, 2015 14:14
understandinges6
body {
font-family: Georgia, serif;
color: #222;
line-height: 1.5;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@klaemo
klaemo / mixin.js
Created January 28, 2015 11:48
onTransitionEnd one-off function
var transitionend = require('transitionend-property')
module.exports = {
onTransitionEnd: function(el, fn) {
var self = this
function handler(event) {
fn.call(self, event)
el.removeEventListener(event.type, handler)
}
el.addEventListener(transitionend, handler, false)
@klaemo
klaemo / schema
Created March 21, 2015 14:34
inventory
/*
Products flow from one location to another. This is tracked with deliveries.
Delivery:
amount
sourceId
targetId
productId
*/
Delivery.belongsTo(Location, { as: 'source' })
@klaemo
klaemo / gist:61ff0bc2fd3b81490be6
Created May 13, 2015 13:19
fast image rendering in the browser
var context = canvas.getContext('2d')
var img = new Image()
img.onload = function() {
context.drawImage(img, 0, 0)
window.URL.revokeObjectURL(this.src)
}
img.src = window.URL.createObjectURL(new Blob([data], {'type': 'image\/jpeg'}))