Skip to content

Instantly share code, notes, and snippets.

View RolandWarburton's full-sized avatar
🍃

Roland RolandWarburton

🍃
View GitHub Profile
// 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 / navigating_Zsh_and_Bash.md
Last active April 29, 2023 16:31
navigating Zsh and Bash cheat sheet!

Start and end of line

  1. Ctrl+A or Home: Go to the beginning of the line.
  2. Ctrl+E or End: Go to the end of the line. Zsh Bindings:
    bindkey "^[[H" beginning-of-line
    bindkey "^[[F" end-of-line

Start and end of line

  1. Alt+F: Go right (forward) one word.
  2. Alt+B: Go left (back) one word.
@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 / autoindex_fancy.html
Created June 27, 2020 10:05
fancy index for nginx autoindex
<style>
body {
background: #121212 !important;
color: #dedede !important;
font-size: 1.25em;
}
a, a:visited {
color: #dedede;
}
</style>
@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:

@RolandWarburton
RolandWarburton / test.md
Last active April 10, 2021 07:35
testing markdown parser

Test doc

Hello world!

The quick brown fox h2 heading

Cras ac ipsum conubia porttitor nostra vitae himenaeos elit congue vehicula sit amet eu turpis. Class aptent sagittistaciti sociosqu ad litora torquent per conubia porttitor nostra, per inceptos himenaeos. Phasellus sudo apt install molestie sagittis sudo apt install placeholders et conubia porttitor nostra aliquam. echo "hello world" porttitor commodo tellus ut nisi rutrum dapibus. In hac habitasse platea dictumst. sudo apt install placeholders luctus iaculis augue sit amet laoreet. Nulla ac porttitor sagittis sem, et placerat neque.

Some subtext about the fox