Skip to content

Instantly share code, notes, and snippets.

@matlockx
matlockx / postgres_queries_and_commands.sql
Last active August 9, 2021 09:36 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@matlockx
matlockx / gist:0c31bfadafe71b75ecf82588c8dd6751
Created March 28, 2018 06:51
Get latest tag from git repo
#!/usr/bin/env sh
git for-each-ref refs/tags --sort=-taggerdate --format='%(refname:short)' --count=1

Keybase proof

I hereby claim:

  • I am matlockx on github.
  • I am matlockx (https://keybase.io/matlockx) on keybase.
  • I have a public key ASCB7W0RBvC4PAzt1BHTJ3VxpWUuJv0Edu_mEs9AAgtP5go

To claim this, I am signing this object:

package io.lutterome.main;
import com.netflix.client.config.CommonClientConfigKey;
import com.netflix.client.config.IClientConfig;
import com.netflix.ribbon.ClientOptions;
import com.netflix.ribbon.Ribbon;
import com.netflix.ribbon.http.HttpResourceGroup;
import com.netflix.ribbon.transport.netty.RibbonTransport;
import com.netflix.ribbon.transport.netty.http.LoadBalancingHttpClient;
import io.netty.buffer.ByteBuf;
@matlockx
matlockx / bla
Created September 4, 2015 10:24
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAxgkoUny+cWG11i7eK5K/LZrEfA5SmTKztm0GAqlsx1XSBoWJex2B+3j7NKYmkswsqjQNr2V1sHoEX/49SK8DsEOYOTt2SKkRAT/Sq8vmQ2jvELbmOhvJgBMRNYMilU9iYvA00trAztdEJR7zyrAMPsuT9OL9LfsZ63PyBoUUyQxzpzlg3PWCwGoDyr74goMT6QcFiVHokUMBBYO6hPUcwwCN+0FBVy/iLiP8FOd7gKzEUFOFt1kCv6UbUE2XeS6TbBZXYLLzZfQikH96fhjBDQuO04IvPUrm52moi4B38xdJcE5zGavu5tnmRk/8n4WE1L2FC2Cb8KOC7ETFQxknjw== mjoeh@devstation17.office.tipp24.de
"sssabla".getClass.getDeclaredMethods.toList.foreach{m => val rootMethod = m.getClass.getDeclaredMethod("getRoot");rootMethod.setAccessible(true);println(m.setAccessible(true) + " " + System.identityHashCode(m) + " root: " + System.identityHashCode(rootMethod.invoke(m)) + " " + m)}
@matlockx
matlockx / build.sbt
Created August 10, 2014 11:10
could not find implicit value for parameter marshaller
name := """short-url"""
version := "1.0"
scalaVersion := "2.11.2"
libraryDependencies ++= Seq(
"io.spray" % "spray-can" % "1.3.1" % "compile",
"io.spray" % "spray-routing" % "1.3.1" % "compile",
"com.typesafe.akka" %% "akka-actor" % "2.3.3"
<html>
<body>
<h1 id="title">Combinations</h1>
<input type="text" id="numbers" value="1,2,3,4,5" />
<input type="text" id="stars" value="1,2,3" />
<input type="submit" id="byBtn" value="Change" onclick="change()" />
<div id="info"></div>
<div id="combinations"></div>
<script>
#!/bin/sh
exec scala "$0" "$@" -feature
!#
// Execute:
// ./RandomSymbol numberOfSymbolIds numberOfSymbolsOnCard
object RandomSymbol {
def main(args: Array[String]) {
val symbolIdList = 1 to args(0).toInt toList
@matlockx
matlockx / gist:4664148
Created January 29, 2013 13:18
exception when using zinc
:clean
:compileJava UP-TO-DATE
:compileScala FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileScala'.
> scala.collection.JavaConverters$.asScalaBufferConverter(Ljava/util/List;)Lscala/collection/JavaConverters$AsScala;