-
This is a numbered list.
-
I'm going to include a fenced code block as part of this bullet:
Code More Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String hbaseShellId(String id, Date d) throws IOException { | |
byte[] idBytes = IdUtil.nonRandByteBucketizeId(id, d); | |
StringBuilder sb = new StringBuilder("\"\\x"); | |
sb.append(String.format("%02x", idBytes[0])); | |
sb.append((new String(idBytes)).substring(1)); | |
sb.append("\""); | |
return sb.toString(); | |
} | |
public static void main(String[] args) throws IOException { |
This article is now published on my website: A one-off git repo server.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extremely basic development setup to serve the current directory at http://localhost:9001 | |
# Start nginx in this directory with `nginx -p . -c nginx.conf` | |
# Stop nginx with `nginx -p . -s stop` | |
events {} | |
http { | |
# Serve files with correct mimetypes on OSX | |
# location may have to be adjusted depending on your OS and nginx install | |
include /usr/local/etc/nginx/mime.types; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE IF EXISTS CTE_AllTables; | |
-- CREATE TEMPORARY TABLE IF NOT EXISTS CTE_AllTables | |
CREATE TEMPORARY TABLE CTE_AllTables AS | |
SELECT | |
ist.table_schema AS OnTableSchema | |
,ist.table_name AS OnTableName | |
,tForeignKeyInformation.FkNullable | |
-- WARNING: TableSchema or Tablename can contain entry-separator (';' used) | |
,CAST(DENSE_RANK() OVER (ORDER BY ist.table_schema, ist.table_name) AS varchar(20)) AS OnTableId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from slacker import Slacker | |
import json | |
import argparse | |
import os | |
import shutil | |
import copy | |
from datetime import datetime | |
# This script finds all channels, private channels and direct messages | |
# that your user participates in, downloads the complete history for |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# NOTE: wifi network interface is: en1 | |
wifi_router=192.168.200.1 | |
wifi_address=en1:ec.35.86.4f.00.bc | |
TOADDR=`ifconfig en1 inet | sed -nl 's/\w*inet \([^ ]*\).*/\1/p'` | |
TO=`echo -n ${TOADDR//[[:space:]]}` | |
echo "ADDING ROUTE TO $1 VIA en1 (wi-fi): $TO" | |
route -n add -host $1 $wifi_router -ifp $wifi_address -ifa $TO -static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MIT License | |
# Copyright (c) 2016 Chandler Abraham | |
# Updates to export formats (c) 2017 Aaron Macks | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function PgUpsertPlugin( | |
builder, | |
{ pgDisableDefaultMutations } | |
) { | |
if (pgDisableDefaultMutations) { | |
return; | |
} | |
builder.hook("inflection", (inflection, build) => | |
build.extend(inflection, { |