Skip to content

Instantly share code, notes, and snippets.


Daniel Norman 2color

View GitHub Profile
View postgres_queries_and_commands.sql
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), 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(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
Emoji Meaning
⚠️ WIP
Not Done
🎆 Serendipitous
2color / nginx.conf
Created Oct 18, 2017 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048

Keybase proof

I hereby claim:

  • I am 2color on github.
  • I am 2color ( on keybase.
  • I have a public key whose fingerprint is EF85 B9E9 3F47 D488 56BF 37AF C466 A8FA 57F3 9905

To claim this, I am signing this object:

View credentials-example.yaml
github-access-token: "......"
gcr-key: |
"type": "service_account",
"project_id": "myproject"
git-private-key: |-
2color /
Last active Mar 5, 2018 — forked from willejs/
Moving Concourse Pipelines

Moving Concourse Pipelines


Currently concourse does not support moving pipelines between teams via fly CLI. There is an issue for that here

The only way to do this is to make a few changes in the DB.

If you run the statement below you will see that 6 tables have the team_id column.

concourse=> select table_name                                                                                                                                                                                                                                                                                                                                                       from INFORMATION_SCHEMA.COLUMNS                                                                                                                                                                                                                                                                   
View ssb-message.json
"key": "%XeDqVs7hGP1g36xG+u8mCcy6yp+G4QrC25tO/8RmTzA=.sha256",
"value": {
"previous": "%7HOW+sn5+LqSn48AFkhHLUkLIVCpljzGbBoIo+P25wo=.sha256",
"author": "@QGXfP5kyNOnxhuf6+d9nSDPwSu55vjEdmKOecegeQso=.ed25519",
"sequence": 34,
"timestamp": 1543250630956,
"hash": "sha256",
"content": {
"type": "contact",
2color / defafultObjectProps.js
Created Jan 10, 2019
Default method parameters can access object properties
View defafultObjectProps.js
class Person {
constructor (name) { = name
this.defaultSalultation = 'Dr.'
sayHello (salutation = this.defaultSalultation) {
return `Hello ${salutation} ${}`
2color / publishReplay.js
Last active Jan 10, 2019
Example of how publishReplay works
View publishReplay.js
//emit value every 1 second
const source = Rx.Observable.interval(1000).take(5);
const example = source
//side effects will be executed once
.do(() => console.log('Do Something!'))
//do nothing until connect() is called
// Cache the last 3 values

Trigger cronjob manually

kubectl create job --from=cronjob/[CRONJOB] test-job-name

You can’t perform that action at this time.