Skip to content

Instantly share code, notes, and snippets.

%% @doc Name of the riak cluster for the stats
{mapping, "riak_cluster.stats", "ark_stats.riak_cluster", [
{datatype, atom},
{default, "$(riak_cluster.default)"}
]}.
%% @doc Name of the riak cluster for the tracker
{mapping, "riak_cluster.tracker", "ark_tracker.riak_cluster", [
{datatype, atom},
{default, "$(riak_cluster.default)"}
@hanikesn
hanikesn / reload.erl
Created June 16, 2014 14:02
Erlang Scripts
#!/usr/bin/env escript
%%! -sname enkidu_compile@localhost -pa deps/*/ebin apps/*/ebin debug verbose
main([_Module, _File]) ->
{ok, _Result} = rpc:call(enkidu@localhost, c ,c, [_File, [debug_info, fail_on_warning, {parse_transform, lager_transform}]]).
%rpc:call(enkidu@localhost, code ,purge, [list_to_atom(_Module)]),
%{module, _Result} = rpc:call(enkidu@localhost, code ,load_file, [list_to_atom(_Module)]).
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
<link rel="import" href="../paper-slider/paper-slider.html">
<link rel="import" href="../yt-video/yt-search-video.html">
@hanikesn
hanikesn / router.php
Last active August 29, 2015 14:21
PHP Router for static files
// Warning: unsafe, use only in dev enviroment
if(is_file($_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI'])) {
header('Content-Type:');
readfile($_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI']);
exit;
}
@hanikesn
hanikesn / functional.js
Created May 27, 2015 22:19
Javascript Helpers
var chain_deferreds = function (data, f) {
var start = jQuery.Deferred();
var end = data.reduce(function (prev, d) {
return prev.then(function () {
return f(d);
});
}, start);
start.resolve();
return end;
};
@hanikesn
hanikesn / java-sd_notify.java
Last active August 29, 2015 14:27 — forked from yrro/java-sd_notify.java
The poor Java programmer's alternative to calling sd_notify
package systemd;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.nio.file.Files;
import java.nio.file.LinkOption;
import java.nio.file.Paths;
import java.util.function.Supplier;
@lombok.extern.slf4j.Slf4j
@hanikesn
hanikesn / multiply.js
Created January 18, 2016 01:47
JavaScript BigNum
function reverse(s){
return s.split("").reverse().join("");
}
function add(left, right) {
if(left.length < right.length) {
var swp = left;
left = right;
right = swp;
}
rleft = reverse(left);
@hanikesn
hanikesn / dashboard.yaml
Last active April 6, 2020 22:35
OpenID Connect Kubernetes Dashboard
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: kubernetes-dashboard
namespace: kube-system
labels:
k8s-app: kubernetes-dashboard
kubernetes.io/cluster-service: "true"
spec:
replicas: 1
@hanikesn
hanikesn / content-packs.yml
Last active February 10, 2020 09:40
Graylog Kubernetes Setup
apiVersion: v1
kind: ConfigMap
metadata:
name: graylog-content-packs
data:
grok-patterns.json: |2
{
"name": "Core Grok Patterns",
"description": "Core grok patterns",
"category": "Grok",