Skip to content

Instantly share code, notes, and snippets.

View wkm's full-sized avatar
🎯
Focusing

Wiktor Macura wkm

🎯
Focusing
View GitHub Profile
@wkm
wkm / gist:3d0b70b6e63d8b1324d0cda88c5e60f7
Created April 15, 2018 23:01
users-notified-per-incident.sql
WITH
incidents AS (
SELECT
i.incident_id,
MAX(i.title) AS title,
MIN(i.created_at) AS created_at,
MAX(IF(REGEXP_CONTAINS(title, "fire"),
1,
0)) AS has_fire,
MAX(IF(REGEXP_CONTAINS(title, "shot"),
@wkm
wkm / curl-format.txt
Created December 2, 2017 22:14
Format for detailed timings from curl
time_namelookup: %{time_namelookup}\n
time_connect: %{time_connect}\n
time_appconnect: %{time_appconnect}\n
time_pretransfer: %{time_pretransfer}\n
time_redirect: %{time_redirect}\n
time_starttransfer: %{time_starttransfer}\n
----------\n
time_total: %{time_total}\n
@wkm
wkm / gist:d0abfb8d7d0d8421dfaf
Last active March 25, 2018 16:37
keybase.md
### Keybase proof
I hereby claim:
* I am wkm on github.
* I am wkm (https://keybase.io/wkm) on keybase.
* I have a public key ASB4UKd2fjZYbZqV8Mrk2iRISzOtIA5d6gIrvUiYTTd8lgo
To claim this, I am signing this object:
HOMEBREW_VERSION: 0.9
HEAD: 9139239099c1d431e051d74cf07c35f5b1ce53fe
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit sandybridge
OS X: 10.7.3
Kernel Architecture: x86_64
Xcode: 4.3.2
GCC-4.0: N/A
GCC-4.2: build 5666
<?
class A {
static $instance = null;
public static function getInstance(){
if(is_null(self::$instance)){
self::newInstance();
}
@wkm
wkm / gist:1263230
Created October 5, 2011 00:15
A simple example of BoxPanel with Scala Swing
import swing._
object BoxPanelExample extends SimpleSwingApplication {
var boxPanel = new BoxPanel(Orientation.Vertical)
boxPanel.contents += new Label("a")
boxPanel.contents += new Label("b")
boxPanel.contents += new Label("c")
def top = new MainFrame {
title = "Sclera"