Skip to content

Instantly share code, notes, and snippets.

package super.hacky.flink.logging
import java.util
import ch.qos.logback.classic.LoggerContext
import ch.qos.logback.classic.selector.ContextSelector
import ch.qos.logback.classic.util.ContextInitializer
import org.apache.flink.runtime.taskmanager.{Task, TaskManagerRuntimeInfo}
import org.json4s.native.JsonMethods
import org.json4s.{JObject, JString}
@Astn
Astn / flink.scala.startup.1.md
Created November 8, 2016 16:38
Startup log showing TypeExtractor Info
@Astn
Astn / Observable.Join.stuff.sc
Created June 22, 2016 20:40
Example code for playing with observables and joins
import rx.lang.scala.Observable
object stuff {
case class generatedObject(config:String)
case class myInterface(name:String, config:String)
val mymap0 = Map("eth0" -> myInterface("eth0" ,"on"),
"eth1" -> myInterface("eth1" ,"on"),
"wifi0" -> myInterface("wifi0" ,"on"),
"wifi0" -> myInterface("wifi0" ,"off"))
/**
* Created by astn on 6/26/15.
*/
/** 
 * Created by astn on 6/25/15.
 */
object themain {
def rows(inp: Array[Int]): Array[Set[Int]] = {
def nextRow(p: Array[Int], r: Int): Set[Int] = {
p.drop(r * 9).take(9).toSet 

/**
* Created by astn on 6/25/15.
*/
object themain {
def rows(inp: Array[Int]): Array[Set[Int]] = {
def nextRow(p: Array[Int], r:Int) = p.drop(r*9).take(9).toSet
(0 to 8).map(f=> nextRow(inp,f)).toArray
}
@Astn
Astn / eights.sc
Last active August 29, 2015 14:23
4 eights, the fun way
// given you have four 8's and the operators +,-,*,/
// and you want to determine how to order the operators
// to end up with the result of 56
val inputs = Seq(8,8,8,8)
val allOps = List(
((a:Int,b:Int)=>a+b,"+"),
((a:Int,b:Int)=>a-b,"-"),
((a:Int,b:Int)=>a*b,"*"),
((a:Int,b:Int)=>a/b,"/"))
@Astn
Astn / linqpad.populateESFromJson
Last active August 29, 2015 14:17
populate elastic search from json dumb
using Nest;
using Nest.SerializationExtensions;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
-Astn: Austin Harris
TmanSquarePants: Tyler Ellingson
@Astn
Astn / all-render-nustache.ps1
Created September 15, 2014 23:09
Render Nustache for everything
# Get us out of a git directory if we are in one.
#while (( ls -Directory -Hidden -Filter ".git" | measure).Count -gt 0 ) {
# Write-Warning "Moving up a directory because a hidden .git folder was detected"
# $loc = (Get-Location).Path
# Write-Warning "Now at ${loc}"
# cd ..
# }
## pull latest of configuration project
IF ((Test-Path .\configuration) -eq $false) {
@Astn
Astn / Setup-Node_Npm_Grunt.ps1
Last active August 29, 2015 14:06
Makes sure that Node, npm, and Grunt are installed, if not, will set them up via chocolatey + npm, and will make sure they are in the PATH
function elevateme {
# Get the ID and security principal of the current user account
$myWindowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent()
$myWindowsPrincipal=new-object System.Security.Principal.WindowsPrincipal($myWindowsID)
# Get the security principal for the Administrator role
$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator
# Check to see if we are currently running "as Administrator"
if ($myWindowsPrincipal.IsInRole($adminRole))