Skip to content

Instantly share code, notes, and snippets.

View tlberglund's full-sized avatar

Tim Berglund tlberglund

  • StarTree
  • Mountain View CA
View GitHub Profile
@tlberglund
tlberglund / git-loglive
Last active January 12, 2024 03:40
Log Live Git Command
#!/bin/bash
while :
do
clear
git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all $*
sleep 1
done
@tlberglund
tlberglund / liquibase.gradle
Created July 17, 2012 22:42
The Liquibase Plugin as a Buildfile
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.TaskAction
import liquibase.integration.commandline.Main
apply plugin: LiquibasePlugin
buildscript {
#!/bin/bash
#Ensure we have the quantity specified on the CLI
if [ -z "$3" ]; then ARG_ERR=ERR; fi
if [ -z "$2" ]; then ARG_ERR=ERR; fi
if [ -z "$1" ]; then ARG_ERR=ERR; fi
if [ -n "$ARG_ERR" ];
then
echo "Usage: <filecount> <filenamebase> <filenameextension>"
exit
@tlberglund
tlberglund / jax-git-workshop.md
Created October 15, 2012 15:59
JAX London Git Workshop Notes

JAX Git Workshop

Outline

  • git init project
  • git config --global user.name "Tim Berglund"
  • git config --global user.email "tlberglund@github.com"
  • git status
  • git add <file>
  • Diff
    • git diff
@tlberglund
tlberglund / gist:3208768
Created July 30, 2012 18:08
Live Log Script
#!/bin/bash
while :
do
clear
git --no-pager log -$1 --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
sleep 1
done
CREATE STREAM twitter_reinvent_kafka_ksql AS
SELECT
TIMESTAMPTOSTRING(CreatedAt, 'yyyy-MM-dd HH:mm:ss.SSS') AS CreatedAt,
EXTRACTJSONFIELD(user,'$.Name') AS user_Name,
EXTRACTJSONFIELD(user,'$.ScreenName') AS user_ScreenName,
EXTRACTJSONFIELD(user,'$.Location') AS user_Location,
EXTRACTJSONFIELD(user,'$.Description') AS user_Description,
Text,
hashtagentities,
lang
CREATE STREAM twitter_summit AS
SELECT
TIMESTAMPTOSTRING(CreatedAt, 'yyyy-MM-dd HH:mm:ss.SSS') AS CreatedAt,
EXTRACTJSONFIELD(user,'$.Name') AS user_Name,
EXTRACTJSONFIELD(user,'$.ScreenName') AS user_ScreenName,
EXTRACTJSONFIELD(user,'$.Location') AS user_Location,
EXTRACTJSONFIELD(user,'$.Description') AS user_Description,
Text,
hashtagentities,
lang
CREATE STREAM twitter_raw
(CreatedAt bigint,
Id bigint,
Text VARCHAR,
SOURCE VARCHAR,
Truncated VARCHAR,
InReplyToStatusId VARCHAR,
InReplyToUserId VARCHAR,
InReplyToScreenName VARCHAR,
GeoLocation VARCHAR,
{
"name": "twitter_source_json_01",
"config": {
"connector.class": "com.github.jcustenborder.kafka.connect.twitter.TwitterSourceConnector",
"twitter.oauth.accessToken": "",
"twitter.oauth.consumerSecret": "",
"twitter.oauth.consumerKey": "",
"twitter.oauth.accessTokenSecret": "",
"kafka.delete.topic": "twitter_deletes_json_01",
"value.converter": "org.apache.kafka.connect.json.JsonConverter",