Skip to content

Instantly share code, notes, and snippets.

@terrancesnyder
terrancesnyder / japanese-mapping.txt
Created Nov 4, 2011
Half Width to Full Width Katakana, FullWidth Ascii to HalfWidth
View japanese-mapping.txt
# Half-width Katakana => Full-width Katakana
"ア" => "ア"
"イ" => "イ"
"ウ" => "ウ"
"エ" => "エ"
"オ" => "オ"
"カ" => "カ"
"キ" => "キ"
"ク" => "ク"
"ケ" => "ケ"
@terrancesnyder
terrancesnyder / README.md
Last active May 26, 2020
Sankey Barchart with D3
View README.md

Sankey Barchart

Info

Provides a visualization similar to google analytics shopper behavior analytics.

Requires

  • d3js
  • underscorejs
@terrancesnyder
terrancesnyder / merge_regions.sh
Last active Jan 31, 2020
automated merge hbase 0.98+ - Bash script that will invoke hshell to query for regions and then perform a merge_region command but only within each regionserver (to avoid data copy/locality issues)
View merge_regions.sh
#!/bin/bash
TABLE=$1
MAX=$2
echo "Examining Table $TABLE...."
echo "scan 'hbase:meta',{ COLUMNS => 'info:server', FILTER=>\"PrefixFilter('$TABLE')\"}" | hbase shell > "$TABLE.out" 2>&1
echo "Making splits $TABLE.splits"
echo "" > "$TABLE.splits"
@terrancesnyder
terrancesnyder / index.html
Created Sep 13, 2012 — forked from ovaillancourt/index.html
Socket io + static file serving with connect
View index.html
<!-- This should be served by your server -->
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io.connect('http://localhost');
socket.on('news', function (data) {
console.log(data);
socket.emit('my other event', { my: 'data' });
});
</script>
@terrancesnyder
terrancesnyder / apiary.txt
Last active Aug 22, 2019
API Ary - Draft
View apiary.txt
[#ftl]
[#-- @ftlvariable name="resourceApis" type="java.util.List<com.webcohesion.enunciate.api.resources.ResourceApi>" --]
[#-- @ftlvariable name="serviceApis" type="java.util.List<com.webcohesion.enunciate.api.services.ServiceApi>" --]
[#-- @ftlvariable name="data" type="java.util.List<com.webcohesion.enunciate.api.datatype.Syntax>" --]
[#-- @ftlvariable name="title" type="java.lang.String" --]
[#-- @ftlvariable name="disableMountpoint" type="java.lang.Boolean" --]
[#-- @ftlvariable name="disableResourceLinks" type="java.lang.Boolean" --]
[#-- @ftlvariable name="apiRelativePath" type="java.lang.String" --]
[#-- @ftlvariable name="includeApplicationPath" type="java.lang.Boolean" --]
View gist:95a6c98c1472ccd598cfd4e32f941f73
hadoop fsck / | egrep -v '^\.+$' | grep -v corrup | grep / | grep -oh '^\S*:' | rev | cut -c 2- | rev | sort | uniq > corrupted.flst
View email-template.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Catalina News</title>
</head>
<link href="https://fonts.googleapis.com/css?family=Noto+Sans|Roboto:100,300,400,500" rel="stylesheet">
<style>
body {
margin: 0px auto;
View print.java
package com.halo.struts.action;
import java.io.FileInputStream;
import java.io.IOException;
import javax.print.Doc;
import javax.print.DocFlavor;
import javax.print.DocPrintJob;
import javax.print.PrintException;
import javax.print.PrintService;
View ActiveDirectoryBrowser.java
package org.mule.example.echo;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import javax.naming.Context;
import javax.naming.NamingEnumeration;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
View gist:df73f89715ec41a7ceb4e270d8d370e5
Exception in thread "iothread-2" java.lang.NullPointerException
at zmq.Utils.tuneTcpSocket(Utils.java:48)
at zmq.TcpListener.acceptEvent(TcpListener.java:91)
at zmq.IOObject.acceptEvent(IOObject.java:123)
at zmq.Poller.run(Poller.java:250)
at java.lang.Thread.run(Thread.java:748)
Exception in thread "iothread-2" java.lang.NullPointerException
at zmq.Utils.tuneTcpSocket(Utils.java:48)
at zmq.TcpListener.acceptEvent(TcpListener.java:91)
at zmq.IOObject.acceptEvent(IOObject.java:123)