start new:
tmux
start new with session name:
tmux new -s myname
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "os" | |
| "os/signal" | |
| "strconv" |
| // https://webreflection.medium.com/using-the-input-datetime-local-9503e7efdce | |
| Date.prototype.toDatetimeLocal = | |
| function toDatetimeLocal() { | |
| var | |
| date = this, | |
| ten = function (i) { | |
| return (i < 10 ? '0' : '') + i; | |
| }, | |
| YYYY = date.getFullYear(), | |
| MM = ten(date.getMonth() + 1), |
| #A sequence for installing a taskwarrior server on an ec2 amazon linux instance | |
| #hopefully this can save someone a bunch of time | |
| #FIRST go to the ec2 instance management panel, | |
| #edit the security group for the instance and add an inbound rule, custom tcp, port 53589, source anywhere (0.0.0.0/0) | |
| #THEN ssh to the box as ec2-user and run the following | |
| #build taskserver | |
| sudo yum install gcc cmake gnutls-devel gnutls-utils libuuid-devel clang | |
| curl -O http://taskwarrior.org/download/taskd-latest.tar.gz |
| /** | |
| 1. Install the Stylish(https://chrome.google.com/webstore/detail/stylish/fjnbnpbmkenffdnngjfgmeleoegfcffe?hl=en) extension for Chrome. | |
| 2. Open up extension options and paste the whole CSS mentioned below. | |
| 3. Specify the domain name to be `github.com`. | |
| 4. Add a title and save. | |
| */ | |
| .header { | |
| padding-top: 10px; | |
| padding-bottom: 10px; |
| package main | |
| import ( | |
| "bytes" | |
| "io" | |
| "os" | |
| "os/exec" | |
| ) | |
| func main() { |
| // This #include statement was automatically added by the Spark IDE. | |
| #include "elapsedMillis/elapsedMillis.h" | |
| #include "HttpClient/HttpClient.h" | |
| #include "PietteTech_DHT.h" // From: https://github.com/piettetech/PietteTech_DHT | |
| #include "math.h" | |
| /* Function prototypes -------------------------------------------------------*/ | |
| void dht_wrapper(); // must be declared before the lib initialization | |
| // create an IAM Lambda role with access to dynamodb | |
| // Launch Lambda in the same region as your dynamodb region | |
| // (here: us-east-1) | |
| // dynamodb table with hash key = user and range key = datetime | |
| console.log('Loading event'); | |
| var AWS = require('aws-sdk'); | |
| var dynamodb = new AWS.DynamoDB({apiVersion: '2012-08-10'}); | |
| exports.handler = function(event, context) { |