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
select c from ( | |
select cast(dbms_lob.substr(t.c, 4000, (n.i) * 4000 + 1) as varchar(4000)) c, t.r i, n.i j | |
from (( | |
select rownum r, dbms_lob.getlength(c) l, c | |
from ( | |
select dbms_xmlgen.getxml('select * from all_tables') c | |
from dual) | |
) t inner join ( | |
select rownum - 1 as i | |
from dual |
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
#!/usr/bin/env ruby | |
require 'open3' | |
def replace(md, strip=false) | |
rex = /```([a-zA-Z]+)\n(([^`\n]{3,}\n)*)```\s*```mdexec\n([^`\n]{3,}\n)*```/ | |
replaced = md.gsub(rex) do |rep| | |
int, code = $1, $2 | |
if !strip |
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
object Test extends App { | |
lazy val flow: SplunkEvent => Seq[Email[Alert]] = | |
receiveEvent andTap rawTap andThen | |
convertToSecurityEvent andMaybeTap eventTap andMaybe | |
classifyIfTrained andMaybeTap classificationTap andMaybeSeq | |
aggregateByTimeWindow andForEach (_.sortBy(_.event.time)) andForEach | |
convertToAlert andForEachTap alertTap andForEachOpt | |
createEmail andForEachTap emailTap | |
} |
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
package org.frohoff.flow | |
import scala.collection.mutable.Buffer | |
import Flow._ | |
object Test extends App { | |
val f: Flow[Int,Int] = Flow[Int] | |
val f2: Flow[Int,String] = f.map(_.toHexString) | |
val f3: Flow[Int,Option[Int]] = f.map(Option(_)) | |
//f3.flatten // doesn't compile yet |
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
object NullSafeConversions { | |
implicit def ns[A](a:A) = new NullSafe(a) | |
implicit def ro[A](o:Option[A]) = new RichOption(o) | |
def ?[A](a:A) = if (a == null) Some(a) else None | |
case class NullSafe[A](a:A) extends AnyVal { | |
def ?[B >: Null](f: A => B):B = if (a != null) f(a) else null | |
} | |
case class RichOption[A](o:Option[A]) extends AnyVal { |
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
var crypto = require('crypto') | |
var hashType = process.argv[2] || 'sha1' | |
var numHashes = parseInt(process.argv[3] || 1) | |
// init chain with stdout | |
var piped = process.stdout | |
for (var i = 0; i < numHashes; i++) { | |
// prepend chain with new hash |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"bufio" | |
"regexp" | |
"io" | |
) |
NewerOlder