Skip to content

Instantly share code, notes, and snippets.

@terrancesnyder
terrancesnyder / run.vbs
Created June 4, 2011 15:53
VBScript + Batch to run windows in background
================ run.vbs ================
REM 0 = hide window, 1 = show window (useful for debugging)
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run """" & "run.bat" & """" & sargs, 0, False
Set WshShell = Nothing
================ run.bat ================
REM Batch script to start VirtualBox instance of ReviewBoard in headless mode
@terrancesnyder
terrancesnyder / japanese-mapping.txt
Created November 4, 2011 17:44
Half Width to Full Width Katakana, FullWidth Ascii to HalfWidth
# Half-width Katakana => Full-width Katakana
"ア" => "ア"
"イ" => "イ"
"ウ" => "ウ"
"エ" => "エ"
"オ" => "オ"
"カ" => "カ"
"キ" => "キ"
"ク" => "ク"
"ケ" => "ケ"
@terrancesnyder
terrancesnyder / README.md
Last active May 26, 2020 08:07
Sankey Barchart with D3

Sankey Barchart

Info

Provides a visualization similar to google analytics shopper behavior analytics.

Requires

  • d3js
  • underscorejs
@terrancesnyder
terrancesnyder / merge_regions.sh
Last active January 31, 2020 02:38
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)
#!/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 September 13, 2012 22:27 — forked from ovaillancourt/index.html
Socket io + static file serving with connect
<!-- 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 August 22, 2019 20:03
API Ary - Draft
[#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" --]
hadoop fsck / | egrep -v '^\.+$' | grep -v corrup | grep / | grep -oh '^\S*:' | rev | cut -c 2- | rev | sort | uniq > corrupted.flst
@terrancesnyder
terrancesnyder / email-template.html
Created November 13, 2018 03:20
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;
@terrancesnyder
terrancesnyder / print.java
Created September 14, 2011 19:23
Print JPEG 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;
@terrancesnyder
terrancesnyder / ActiveDirectoryBrowser.java
Created October 17, 2011 18:27
Java Active Directory Browser
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;