Skip to content

Instantly share code, notes, and snippets.

View RolandWarburton's full-sized avatar
🍃

Roland RolandWarburton

🍃
View GitHub Profile
@RolandWarburton
RolandWarburton / pdf-spammer.go
Created May 27, 2024 04:29
bulk generate PDF files for testing
package main
import (
"fmt"
"os"
"sync"
"github.com/go-pdf/fpdf"
)
// go tool pprof mem_profile.pprof
func dumpMemoryProfile() {
memProfileFile, err := os.Create("mem_profile.pprof")
if err != nil {
log.Fatal("Could not create memory profile file: ", err)
}
defer memProfileFile.Close()
err = pprof.WriteHeapProfile(memProfileFile)
if err != nil {
@RolandWarburton
RolandWarburton / installing_termux.md
Last active July 15, 2022 11:53
Installing termux

Installing Termux

At the time of writing, you need to go download the latest apk from the releases page.

After installing run termux-change-repo. Select all mirrors -> setting it to the Grimler91 mirror seemed to work for me.

Next run pkg up -y to update all packages and mirrors etc.

After that libssl should be working (i was having trouble with it).

@RolandWarburton
RolandWarburton / pr-ticket-name-checker.js
Created January 20, 2022 02:20
Grease Monkey bookmarklet to never miss a badly named jira PR again
// ==UserScript==
// @name PR ticket name checker
// @author Roland Warburton
// @version 1.1
// @grant none
// @match https://github.com/REPLACEME/*/pull/*
// ==/UserScript==
// README
// 1. Update the @match rule for your organization
@RolandWarburton
RolandWarburton / mobileDetect.ts
Created October 17, 2021 08:17
mobileDetect.ts
// Borrowed from
// https://github.com/juliangruber/is-mobile/blob/master/index.js
const mobileRE = /(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i
const tabletRE = /android|ipad|playbook|silk/i
export function IsMobile (opts?: any) : boolean {
if (!opts) opts = {}
let ua = opts.ua
# change /home/roland/backup to backup location on host
# change the username, password, and ip
# change the authSource
docker run \
-it --name "mongodump" --rm \
-v /home/roland/backup:/data \
-w /data/ \
mongo:4.0 \
mongodump \
@RolandWarburton
RolandWarburton / index.controller.ts
Last active June 19, 2021 02:42
testController.spec.ts
import { NextFunction, Request, Response } from "express";
class IndexController {
public index = (req: Request, res: Response, next: NextFunction): void => {
try {
res.status(200).json({ hello: "world" });
} catch (error) {
next(error);
}
};

Keybase proof

I hereby claim:

  • I am rolandwarburton on github.
  • I am rolandwarburton (https://keybase.io/rolandwarburton) on keybase.
  • I have a public key ASDK5FUTa-FuO4-tTPmY1MZJMF6-EtC7iG29XCScngoIRQo

To claim this, I am signing this object:

# W3
R1
```none
ip route 10.1.1.0 255.255.255.252 s0/1/0
```
R2
const bounceEffect = (target) => {
const dur = 1.25;
const bounceEffect = new TimelineMax();
bounceEffect
.to(target, { y: "-=20", ease: Sine.easeInOut, duration: dur })
.to(target, { y: "+=40", ease: Sine.easeInOut, duration: dur })
.to(target, { y: "-=20", ease: Sine.easeInOut, duration: dur });
};