Skip to content

Instantly share code, notes, and snippets.


Daniel Norman 2color

View GitHub Profile
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
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} ${}`
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 /
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 credentials-example.yaml
github-access-token: "......"
gcr-key: |
"type": "service_account",
"project_id": "myproject"
git-private-key: |-

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:

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
Emoji Meaning
⚠️ WIP
Not Done
🎆 Serendipitous
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%'
2color / gist:2070f7870cc237ea7ab72e5276b149ff
Created Sep 5, 2017 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.
View gist:2070f7870cc237ea7ab72e5276b149ff

Client-side SSL

For excessively paranoid client authentication.

Using self-signed certificate.

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
You can’t perform that action at this time.