Andy Thomason is a Senior Programmer at Genomics PLC. He has been witing graphics systems, games and compilers since the '70s and specialises in code performance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.awt.Dimension | |
| import java.awt.event.MouseAdapter | |
| import java.awt.event.MouseEvent | |
| import javax.swing.JFrame | |
| import scala.collection.immutable | |
| import scala.concurrent.duration._ | |
| import akka.actor._ | |
| import akka.stream._ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM openjdk:8-jre-alpine | |
| RUN mkdir -p /opt/app | |
| WORKDIR /opt/app | |
| COPY ./run_jar.sh ./app-assembly.jar ./ | |
| ENTRYPOINT ["./run_jar.sh"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "Version": "2012-10-17", | |
| "Id": "arn:aws:sqs:YOUR-AWS-REGION:YOUR-AWS-ACCOUNT-ID:YOUR-QUEUE-NAME/SQSDefaultPolicy", | |
| "Statement": [ | |
| { | |
| "Sid": "example-statement-ID", | |
| "Effect": "Allow", | |
| "Principal": { | |
| "AWS": "*" | |
| }, |
This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.
Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.
Use the Raspberry Pi Configuration tool or sudo raspi-config to:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const moment = require('moment'); | |
| const h = moment().format('YYYY-MM-DD') | |
| console.log('Times', h); | |
| const oneYearEarlier = moment(h).subtract(365, 'days').calendar() | |
| console.log('Last Year', oneYearEarlier) | |
| if(h > oneYearEarlier) console.log('Can compare dates') | |
| const startOfMonth = moment().startOf('month').format('YYYY-MM-DD'); | |
| const endOfMonth = moment().endOf('month').format('YYYY-MM-DD'); | |
| console.log(startOfMonth) | |
| console.log(endOfMonth) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const vcap = require('cfenv') | |
| const services = vcap.getAppEnv().getServices() | |
| const local = vcap.getAppEnv().isLocal | |
| console.info('Local:', local) | |
| module.exports = { | |
| cf_api: { | |
| password: local ? process.env.cfapi_pw : services.cf_api.credentials.password, | |
| username: local ? process.env.cfapi_user : services.cf_api.credentials.username, | |
| url: local ? process.env.api_url : services.cf_api.credentials.url | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git remote set-url origin git@<new-git-url> | |
| git remote add internal <new-git-url> | |
| # Delete local branch | |
| git branch -D the_local_branch | |
| # Check out branch from a non-origin upstream | |
| # git fetch <upstream/fork name | |
| # https://stackoverflow.com/questions/30862558/checkout-branch-on-different-remote |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // NOTE: this adds a filename and line number to winston's output | |
| // Example output: 'info (routes/index.js:34) GET 200 /index' | |
| var winston = require('winston') | |
| var path = require('path') | |
| var PROJECT_ROOT = path.join(__dirname, '..') | |
| var logger = new winston.logger({ ... }) | |
| // this allows winston to handle output from express' morgan middleware |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| // Use IntelliSense to learn about possible attributes. | |
| // Hover to view descriptions of existing attributes. | |
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "type": "chrome", | |
| "name": "Chrome", | |
| "request": "launch", |
NewerOlder
