My efforts to port http://www.youtube.com/watch?v=f6kdp27TYZs to Clojure.
func boring(msg string) {
for i := 0; ; i++ {
fmt.Println(msg, i)
time.Sleep(time.Second)
}
#if INTERACTIVE | |
#r "Microsoft.CSharp.dll" | |
#endif | |
open System | |
open System.Dynamic | |
open System.Linq.Expressions | |
open System.Reflection | |
open System.Runtime.CompilerServices | |
open Microsoft.CSharp.RuntimeBinder |
-- 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%' |
package main | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"fmt" | |
) | |
func EncryptAESCFB(dst, src, key, iv []byte) error { | |
aesBlockEncrypter, err := aes.NewCipher([]byte(key)) |
import unittest | |
import collections | |
tests = collections.defaultdict(list) | |
class BddLoader(object): | |
def loadTestsFromModule(self, module): | |
return unittest.TestSuite(tests[module.__name__]) |
My efforts to port http://www.youtube.com/watch?v=f6kdp27TYZs to Clojure.
func boring(msg string) {
for i := 0; ; i++ {
fmt.Println(msg, i)
time.Sleep(time.Second)
}
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
# Dockerfile for ffmpeg with pretty much support for everything as per: | |
# https://trac.ffmpeg.org/wiki/CompilationGuide/Centos | |
# includes codecs with weird licensing like MP3 and AAC. | |
# | |
FROM fedora | |
MAINTAINER Ross Timson <ross@rosstimson.com> | |
# Install build requirements. | |
RUN dnf install -y autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel |
# HELP haproxy_process_nbthread Configured number of threads. | |
# TYPE haproxy_process_nbthread gauge | |
haproxy_process_nbthread 4 | |
# HELP haproxy_process_nbproc Configured number of processes. | |
# TYPE haproxy_process_nbproc gauge | |
haproxy_process_nbproc 1 | |
# HELP haproxy_process_relative_process_id Relative process id, starting at 1. | |
# TYPE haproxy_process_relative_process_id gauge | |
haproxy_process_relative_process_id 1 | |
# HELP haproxy_process_start_time_seconds Start time in seconds. |