This gist has been upgraded to a blog post here.
-- 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%' |
import com.twitter.util.{Future => TwFuture} | |
import scala.concurrent.{Future => ScFuture, promise => ScPromise} | |
implicit def twFutureToScala[T](twFuture: TwFuture[T]): ScFuture[T] = { | |
val prom = ScPromise[T] | |
twFuture.onSuccess { res: T => | |
prom.success(res) | |
} | |
twFuture.onFailure { t: Throwable => | |
prom.failure(t) | |
} |
#!/usr/bin/env bash | |
# | |
# Generate a set of TLS credentials that can be used to run development mode. | |
# | |
# Based on script by Ash Wilson (@smashwilson) | |
# https://github.com/cloudpipe/cloudpipe/pull/45/files#diff-15 | |
# | |
# usage: sh ./genkeys.sh NAME HOSTNAME IP | |
set -o errexit |
// Copyright 2004-present Facebook. All Rights Reserved. | |
/** | |
* Immutable data encourages pure functions (data-in, data-out) and lends itself | |
* to much simpler application development and enabling techniques from | |
* functional programming such as lazy evaluation. | |
* | |
* While designed to bring these powerful functional concepts to JavaScript, it | |
* presents an Object-Oriented API familiar to JavaScript engineers and closely | |
* mirroring that of Array, Map, and Set. It is easy and efficient to convert to |
- You need to modify some Traktor files – do backup before you try – if files are incorrects screens become black.
- You're doing that at your own risk!
- If sth goes really bad – reinstall Traktor :-)
- Traktor QML files are located by default in
/Applications/Native Instruments/Traktor 2/Traktor.app/Contents/Resources/qml
on Mac, on Windows look forqml
in directory where Traktor is installed (I don't have windows machine around)… - You need real text-editor to modify files, you should try with Atom or Notepad++ to apply modifications
- Files here are so called diff files, here is how to read them: http://stackoverflow.com/questions/2529441/how-to-read-the-output-from-git-diff
Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * x
import shapeless.{::, DepFn1, HList, HNil, LabelledGeneric} | |
import shapeless.labelled.{FieldType, field} | |
object deepcopy extends App { | |
trait DeepCopy[A] extends DepFn1[A] | |
object DeepCopy extends LowPriorityDeepCopy { | |
type Aux[A, O] = DeepCopy[A] {type Out = O} |
package ru.scala | |
import io.prometheus.client.{Collector, Counter, Gauge, SimpleCollector} | |
import shapeless.{HNil, LabelledGeneric} | |
import shapeless._ | |
import shapeless.labelled.FieldType | |
import scala.annotation.implicitNotFound | |
package object prometheus { |
With GitHub Actions, a workflow can publish artifacts, typically logs or binaries. As of early 2020, the life time of an artifact is hard-coded to 90 days (this may change in the future). After 90 days, an artifact is automatically deleted. But, in the meantime, artifacts for a repository may accumulate and generate mega-bytes or even giga-bytes of data files.
It is unclear if there is a size limit for the total accumulated size of artifacts for a public repository. But GitHub cannot reasonably let multi-giga-bytes of artifacts data accumulate without doing anything. So, if your workflows regularly produce large artifacts (such as "nightly build" procedures for instance), it is wise to cleanup and delete older artifacts without waiting for the 90 days limit.
Using the Web page for the "Actions" of a repository, it is possible to browse old workflow runs and manually delete artifacts. But the procedure is slow and tedious. It is fine to delete one selected artifact. It is not for a regular cleanup. We need