Skip to content

Instantly share code, notes, and snippets.

@talios
talios / gist:26e5e698e8e9e740bac1bed0d7b00f52
Created September 26, 2016 08:10
Oracle JDK crashes A LOT under the new macOS Siera release :( Or at least, IntelliJ IDEA does.
Process: idea [16532]
Path: /Users/USER/*/IntelliJ IDEA 2016.3 CE EAP.app/Contents/MacOS/idea
Identifier: com.jetbrains.intellij.ce-EAP
Version: EAP IC-163.SNAPSHOT (IC-163.SNAPSHOT)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: idea [16532]
User ID: 501
Date/Time: 2016-09-26 21:09:21.992 +1300
@talios
talios / netchat.hs
Created July 7, 2014 10:36
Network Chat in Haskell.
import Control.Concurrent
import Control.Concurrent.Chan
import Data.UUID
import Data.UUID.V4
import Network.Socket
import System.IO
data Message = Message UUID String
deriving (Show, Eq)
@talios
talios / gist:bdb79750df7e5cba6d54
Last active August 29, 2015 14:02
Simple implementation of the clojure "thread macro" or F# pipe operator...
implicit class Piper[A](val a: A) extends AnyVal {
def |>[B](fn: (A => B)): B = fn(a)
}
def add5(a: Int) = a + 5
def times2(a: Int) = a * 2
def pipeit(a: Int) = {
(a |> add5
|> times2
@talios
talios / gist:9944948
Created April 2, 2014 22:52
Nashorn returns a different type for array lengths :(
$ /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/bin/jrunscript
nashorn> [1,2,3].length
3
$ jrunscript
js> [1,2,3].length
3.0
@talios
talios / git-mvnrelease
Created March 21, 2014 21:00
Git command to wrap handling Apache Maven Releases with GitFlow
#!/bin/sh
if ! git diff-index --quiet HEAD --; then
echo "Git is dirty, clean up your mess!"
exit 1
fi
VERSION=`xml sel -N x="http://maven.apache.org/POM/4.0.0" -t -v "/x:project/x:version" pom.xml`
BASEVERSION=${VERSION%-SNAPSHOT}
ARTIFACTID=`xml sel -N x="http://maven.apache.org/POM/4.0.0" -t -v "/x:project/x:artifactId" pom.xml`
@talios
talios / gist:8907132
Created February 9, 2014 22:39
Strange git case sensitivity issue on OS/X
$ git branch -vv --no-merged
feature/JDK8 8e89521 First steps to JDK8
feature/jdk8 da4efaa WIP JDK8 Streams/Lambda Migration
$ git checkout feature/JDK8
Switched to branch 'feature/JDK8'
$ git checkout feature/jdk8
Switched to branch 'feature/jdk8'
whois microsoft.com Fri 22 Nov 2013 11:39:32 NZDT
Whois Server Version 2.0
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.
MICROSOFT.COM.ZZZZZZZZZZZZZZZZZZZZZZ.IS.A.GREAT.COMPANY.ITREBAL.COM
MICROSOFT.COM.ZZZZZZZZZZZZZZZZZZZ.GET.ONE.MILLION.DOLLARS.AT.WWW.UNIMUNDI.COM
@talios
talios / git-mvnstage
Last active December 20, 2015 20:29
Stage an Apache Maven artifact release into a separate repository based on the git commits SHA1, so to allow for interim, unmerged dependencies to resolve for other users.
#!/bin/sh
if ! git diff-index --quiet HEAD --; then
echo "Git is dirty, clean up your mess!"
exit 1
fi
VERSION=`xml sel -N x="http://maven.apache.org/POM/4.0.0" -t -v "/x:project/x:version" pom.xml`
ARTIFACTID=`xml sel -N x="http://maven.apache.org/POM/4.0.0" -t -v "/x:project/x:artifactId" pom.xml`
SHA1=`git rev-parse HEAD`
int 1
int 2
int 3
int 4
int 5
A low maintenance chili recipe. Requires a big pot. Makes enough for loads of meals!
1 kilo of dry red kidney beans.
200 grams of dry black beans.
3 satchels of El Paso mixes (1 of taco, fajita, and burrito).
5 red peppers seeds removed.
3 red peppers with the seeds.
2 kilo diced beef.
3 cans of diced tomato.
3 or 4 cloves of garlic.