Skip to content

Instantly share code, notes, and snippets.

View jfrazee's full-sized avatar

Joey jfrazee

View GitHub Profile
@jfrazee
jfrazee / fcron.init.sh
Last active August 14, 2021 05:39
fcron init script
#!/bin/sh
# This is based on the cron init script for vixie cron from Ubuntu 20.04 and the
# fcron.init.suse init script included with fcron which are licensed under the
# GPLv2 license.
### BEGIN INIT INFO
# Provides: fcron
# Required-Start: $remote_fs $syslog $time
# Required-Stop: $remote_fs $syslog
@jfrazee
jfrazee / settings.workbench.colorCustomizations.json
Created May 28, 2021 18:19
Visual Studio Code Light Sidebar
{
"workbench.colorCustomizations": {
"[Default Dark+]": {
"sideBar.foreground": "#1E1E1E",
"sideBar.background": "#F1F1F1",
"sideBarTitle.foreground": "#1E1E1E",
"sideBarSectionHeader.background": "#0000",
"sideBarSectionHeader.border": "#61616130",
"list.hoverForeground":"#FFFFFF",
"list.hoverBackground":"#007FD4",
#!/bin/bash
# List the blobs in an Azure storage container.
echo "usage: ${0##*/} <container-name> [blob-name]"
storage_account="$AZURE_STORAGE_ACCOUNT"
storage_suffix="${AZURE_STORAGE_SUFFIX:-core.windows.net}"
container_name="$1"
access_key="$AZURE_STORAGE_KEY"
@jfrazee
jfrazee / LookupAttribute_CSV_Example.xml
Last active April 16, 2017 19:05
LookupAttribute CSV Example
<?xml version="1.0" ?>
<template encoding-version="1.0">
<description></description>
<groupId>1cd46966-0159-1000-3bc2-e181b17f75f5</groupId>
<name>LookupAttribute CSV Example</name>
<snippet>
<processGroups>
<id>77fa6bb7-015b-1000-0000-000000000000</id>
<parentGroupId>1cd46966-0159-1000-0000-000000000000</parentGroupId>
<position>
@jfrazee
jfrazee / NIFI-3585.xml
Created March 21, 2017 19:19
NIFI-3585: Add DatabaseAdapter impl for MS SQL 2008
<?xml version="1.0" ?>
<template encoding-version="1.0">
<description>Add DatabaseAdapter impl for MS SQL 2008</description>
<groupId>f23b8db4-015a-1000-3c3d-2f6bbd6e7aed</groupId>
<name>NIFI-3585</name>
<snippet>
<processGroups>
<id>f23c8dca-015a-1000-0000-000000000000</id>
<parentGroupId>f23b8db4-015a-1000-0000-000000000000</parentGroupId>
<position>
@jfrazee
jfrazee / NIFI-3147-suggestions.diff
Created March 7, 2017 14:50
NIFI-3147-suggestions.diff
diff --git a/nifi-nar-bundles/nifi-ccda-bundle/nifi-ccda-nar/pom.xml b/nifi-nar-bundles/nifi-ccda-bundle/nifi-ccda-nar/pom.xml
index 7bb3112b9..41ddb5c05 100644
--- a/nifi-nar-bundles/nifi-ccda-bundle/nifi-ccda-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-ccda-bundle/nifi-ccda-nar/pom.xml
@@ -33,7 +33,6 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-ccda-processors</artifactId>
- <version>1.2.0-SNAPSHOT</version>
</dependency>
@jfrazee
jfrazee / README.md
Last active July 28, 2016 14:40
NIFI-2142 Cache compiled XSLT in TransformXml

NIFI-2142 Cache compiled XSLT in TransformXml

Basic Usage

Note the stark contrast between TransformXml running with and without caching:

@jfrazee
jfrazee / FilterBadGzipFiles.scala
Last active September 5, 2019 12:28
Spark job to read gzip files, ignoring corrupted files
import java.io._
import scala.io._
import java.util.zip._
// Spark
import org.slf4j.Logger
import org.apache.spark.{ SparkConf, SparkContext, Logging }
// Hadoop
import org.apache.hadoop.io.compress.GzipCodec
@jfrazee
jfrazee / tuple_to_args.scala
Created August 19, 2013 16:37
Convert tuples to scala arguments
// Just an ordinary function
def sum(x: Int, y: Int, z: Int) = x + y + z
// A tuple of arguments
val args = (1, 2, 3)
// Convert the function to a (partial) Function, which has a tupled method
// that takes tuples up to arity 5
(sum _).tupled(args)
--- a/lib/em-twitter/connection.rb
+++ b/lib/em-twitter/connection.rb
@@ -137,7 +137,7 @@ module EventMachine
protected
def handle_stream(data)
- @last_response << @decoder.decode(data)
+ @last_response << (@decoder ||= BaseDecoder.new).decode(data)
if @last_response.complete?