Skip to content

Instantly share code, notes, and snippets.

import os
import sys
# constants, configure to match your environment
HOST = 'http://localhost:9200'
INDEX = 'test'
TYPE = 'attachment'
TMP_FILE_NAME = 'tmp.json'
@michiel
michiel / nginx-method-filter.conf
Created July 2, 2014 13:32
nginx method filter
map $request_method $not_allowed_method {
default 1;
GET 0;
HEAD 0;
POST 0;
}
if ($not_allowed_method) {
return 405;
}

Keybase proof

I hereby claim:

  • I am michiel on github.
  • I am michielkalkman (https://keybase.io/michielkalkman) on keybase.
  • I have a public key whose fingerprint is 7A12 8594 3745 859D B6F6 B417 E8F4 53D6 FDC5 CCFA

To claim this, I am signing this object:

Ace editor component for Ember.

  • A two-way binding is set up between value and the text in the editor.
  • Configure Ace in the aceInit callback.

Template

{{ace-editor value=value aceInit=aceInit class="editor"}}
function logslider(pos) {
var minp = 0;
var maxp = 100;
var minv = Math.log(100);
var maxv = Math.log(10000000);
var scale = (maxv - minv) / (maxp - minp);
return Math.exp(minv + scale * (pos - minp));
}
var position = $(this).position();
var cssProps = {
top : position.top,
left : position.left,
opacity : '0.55'
};
$(this).click(function() {
$(this).clone().css(cssProps).appendTo(this);
});
desc "Generate a new key"
task :gen_key do
domain = get_env(:domain)
filename = "#{domain}.key"
`openssl genrsa -out #{filename} 2048`
end
desc "Generate a new CSR"
task :gen_csr => :gen_key do
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://d3js.org/d3.v2.js"></script>
<link href="styles.css" rel="stylesheet" type="text/css" />
<title>"Percent complete" bar</title>
</head>
require('config/adapters/faye-adapter');
export default DS.FayeAdapter.extend();