Skip to content

Instantly share code, notes, and snippets.

Atom Settings for Sync
@simonellistonball
simonellistonball / mysql.sql
Last active August 8, 2017 19:51
Quick Metron DB setup
CREATE DATABASE IF NOT EXISTS metron;
GRANT ALL PRIVILEGES ON metron.* TO 'metron'@'sball-metron-0.field.hortonworks.com' identified by 'metron';
use metron;
create table if not exists users(
username varchar(50) not null primary key,
password varchar(50) not null,
enabled boolean not null
@simonellistonball
simonellistonball / xml2json.xsl
Created April 26, 2016 14:56
XML 2 JSON XSLT
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">{
<xsl:apply-templates select="*"/>}
</xsl:template>
<!-- Object or Element Property-->
<xsl:template match="*">
"<xsl:value-of select="name()"/>" : <xsl:call-template name="Properties"/>
</xsl:template>
@simonellistonball
simonellistonball / isin-validator.js
Created February 5, 2014 12:00
ISIN validation in javascript
/**
* @author sellistonball
*/
/**
* Calculates a check digit for an isin
* @param {String} code an ISIN code with country code, but without check digit
* @return {Integer} The check digit for this code
*/
function calcISINCheck(code) {
@simonellistonball
simonellistonball / Rmarkdown_tag.rb
Created July 24, 2013 02:15
Rmarkdown block tag for Liquid in Jekyll
module Jekyll
class RMarkDownInlineTag < Liquid::Block
def initialize(tag_name, markup, tokens)
super
require 'rinruby'
end
# parse the content of the tag as if it were an Rmd file