Keybase proof
I hereby claim:
- I am bag-man on github.
- I am bag_man (https://keybase.io/bag_man) on keybase.
- I have a public key ASDcVWpn_Gzg_zivsjlklILaFDKNDBCaRxiwJdJvvdMIdQo
To claim this, I am signing this object:
var os = require("os"); | |
//Create function to get CPU information | |
function cpuAverage() { | |
//Initialise sum of idle and time of cores and fetch CPU info | |
var totalIdle = 0, totalTick = 0; | |
var cpus = os.cpus(); | |
//Loop through CPU cores |
import { deepEqual } from 'assert' | |
type RecursiveFn<T> = (xs: T[], out?: T[]) => T[] | |
type OperatorFn<T> = (T: T, xs: T[], out: T[]) => T | void | |
type FactoryFn = <T>(fn: OperatorFn<T>) => RecursiveFn<T> | |
const recursiveFactory: FactoryFn = <T>(fn: OperatorFn<T>) => { | |
const recursive: RecursiveFn<T> = (xs, out = []) => { | |
const x = xs.shift() |
'use strict' | |
const MongoClient = require('mongodb') | |
class Database { | |
constructor (uri) { | |
this.uri = uri | |
this.db = {} | |
return this |
import { Document, Element, parseXml } from 'libxmljs'; | |
import { VError } from 'verror'; | |
export class XMLReader { | |
private document: Document; | |
private namespaces: Record<string, string>; | |
constructor(inputXml: string) { | |
try { | |
this.document = parseXml(inputXml); |
// Avoid generating expected results as they are not testing your logic independently | |
describe('1+1=2 testing antipattern', () => { | |
describe('add', () => { | |
const add = (a: number, b: number): number => a + b; | |
const expected = 1 + 1; | |
it('should add two numbers', () => { | |
// This is testing two sets of logic, and doesnt guarantee the correctness of the function | |
// as the output of expected could also be wrong | |
expect(add(1, 1)).toEqual(expected); |
+ '[' -z /bin/bash ']' | |
++ basename /bin/bash | |
+ shell=bash | |
+ case "$shell" in | |
+ shopt -s extglob | |
+ NODEDIST=https://nodejs.org/dist | |
+ NAVE_CACHE_DUR=86400 | |
++ curl --version | |
++ head -n1 | |
+ NAVEUA='nave/curl 7.64.1 (x86_64-pc-linux-gnu) libcurl/7.64.1 OpenSSL/1.1.1b zlib/1.2.11 libidn2/2.1.1 libpsl/0.20.2 (+libidn2/2.1.1) libssh2/1.8.1 nghttp2/1.36.0' |
I hereby claim:
To claim this, I am signing this object:
I've always had fzf and ripgrep on my radar, and I've finally gotten around to using them together. Good lord it makes a world of difference, especially when added to Vim as well as Bash.
Add the following snippet to your ~/.bashrc, this add's fzf keybindings to bash and gets fzf to use ripgrep by default for faster searching.
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --follow --glob "!.git/*"'
bind -x '"\C-p": vim $(fzf);'
Okay now what can you do?
module.exports = function findCodingRange (codingSeq, contig, reverse) { | |
let codingLength = codingSeq.length | |
, start = 0 | |
, end = 0 | |
, selector = 12 | |
, fail = false | |
start = contig.indexOf(codingSeq.substring(0, selector)) | |
end = contig.indexOf(codingSeq.substring(codingLength - selector, codingLength)) + selector |
This is an assessed reflection on some workshops that we did for Agile Methodologies
As part of the course we have done three two hour workshops on Agile methodologies. These have been interesting as they have formalised the practises that I had been doing previously in my industrial year.
For example I wasn't aware that pair programming, test driven development, and continuous integration were part of extreme programming, however I had been using them all year. It was also interesting to see that other practices I had been trained in were closely related to the agile manifesto, such as creating and weighting stories, but we weren't following agile in any formal way.
Pair programming is an excellent tool and from experience of the workshops, personal projects and my industrial year, I can argue that working as a pair is a lot more efficient than working individually. The caveat for this is that both partners are at the same level of familiarisation