I hereby claim:
- I am rtpg on github.
- I am rtpg (https://keybase.io/rtpg) on keybase.
- I have a public key ASD-wP2usgoqaEFBlO3ZpUS96VO7chqGCyzeRsU2gEWsego
To claim this, I am signing this object:
| #! /bin/bash | |
| # Push a message on-screen every 60 seconds to remind you of what you're supposed to be doing | |
| # requires lib-notify (most distros have it I think) | |
| while [ 1 ]; do | |
| notify-send Hey "Get back to work" | |
| sleep 60; | |
| done |
| /* | |
| * photon.cpp | |
| * photonSplit | |
| * | |
| * Created by Diane Nguyen on 4/25/13. | |
| * Copyright 2013 __MyCompanyName__. All rights reserved. | |
| * | |
| */ | |
| #include "photon.h" | |
| #include <cstdlib> |
| db = MongoClient('localhost', 27017).some_db # some_db is the DB name | |
| db.table_name.insert_one({ # table name | |
| 'key1': value1, | |
| 'key2': value2 | |
| }) | |
| db.table_name.update_many({'key1':'some_value'}, # update all elts with key1 == 'some_value', setting key2 to 'processed' | |
| {'$set': {'key2': 'processed'}) |
| "use strict" | |
| // module App.Models | |
| exports.createUser = function(u){ | |
| // you might want to put some real implementations here | |
| return 3; | |
| }; | |
| exports.lookupUser = function(u){ |
| import Data.Exists (Exists, mkExists, runExists) | |
| type Circle = {x:: Int, y:: Int, r:: Int} | |
| type Rectangle = {x:: Int, y:: Int, w:: Int, h:: Int} | |
| drawCircle :: Circle -> String | |
| drawCircle c = "This is a circle!" | |
| drawRectangle :: Rectangle -> String | |
| drawRectangle r = "This is a rectangle!" |
| import Data.Exists (Exists, mkExists, runExists) | |
| type Circle = {x:: Int, y:: Int, r:: Int} | |
| type Rectangle = {x:: Int, y:: Int, w:: Int, h:: Int} | |
| drawCircle :: Circle -> String | |
| drawCircle c = "This is a circle!" | |
| drawRectangle :: Rectangle -> String | |
| drawRectangle r = "This is a rectangle!" |
I hereby claim:
To claim this, I am signing this object:
| // this worked in Typescript 3.2.4 | |
| // It feels like we should be able to say SameShape<Q extends R, R extends Q>, but this triggers circular reference | |
| // detection in Typescript. Somehow going to {[K in keyof Q]: Q[K]} solves this (though maybe this won't catch things | |
| // like symbols?) | |
| type SameShape<Q extends R, R extends { [K in keyof Q]: Q[K] }> = { | |
| [K in keyof Q]: R[K] // re-asserting every key of Q is present in R with the same type | |
| } & { // anding the types together will catch any conflicts | |
| [K in keyof R]: Q[K] // re-asserting every key of R is present in Q with the same type | |
| } |