openssl genrsa -out server.key 2048
openssl req -new -x509 -key server.key -out server.pem -days 3650
-- 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 ( | |
"fmt" | |
"sync" | |
) | |
type Event map[string]interface{} | |
type asyncStreamFunc func(done <-chan struct{}, in <-chan Event, out chan<- Event) |
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"time" | |
) | |
// Example SSE server in Golang. |
// github.com/nu7hatch/gouuid | |
BenchmarkV4 1000000 1426 ns/op | |
BenchmarkV5 2000000 910 ns/op | |
// github.com/streadway/simpleuuid | |
BenchmarkV5 5000000 689 ns/op | |
// github.com/tux21b/gocql/tree/master/uuid | |
BenchmarkRandomUUID 1000000 1470 ns/op |
var h = require('mercury').h; | |
var css = require('./index.css'); | |
var insert = require('insert-css'); | |
module.exports = function component(state) { | |
insert(css); | |
return h('.foo') | |
} |
var randomNumbers = [42, 12, 88, 62, 63, 56, 1, 77, 88, 97, 97, 20, 45, 91, 62, 2, 15, 31, 59, 5] | |
func partition(v: Int[], left: Int, right: Int) -> Int { | |
var i = left | |
for j in (left + 1)..(right + 1) { | |
if v[j] < v[left] { | |
i += 1 | |
(v[i], v[j]) = (v[j], v[i]) | |
} | |
} |
As configured in my dotfiles.
start new:
tmux
start new with session name:
diff --git a/tests/models/listing_test.js b/tests/models/listing_test.js | |
index 14c3d14..c04b7a6 100644 | |
--- a/tests/models/listing_test.js | |
+++ b/tests/models/listing_test.js | |
@@ -10,6 +10,7 @@ var dict = { | |
'Name': 'CPK', | |
'HeadingText': 'Restaurants', | |
'PrimaryCollection': 'food', | |
+ 'Personalization.TotalNotes': '10' | |
}; |
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include /home/t/nginx/conf/mime.types; | |
default_type application/octet-stream; |