Skip to content

Instantly share code, notes, and snippets.

View marcuswhybrow's full-sized avatar

Marcus Whybrow marcuswhybrow

  • Nottingham, England
View GitHub Profile
@marcuswhybrow
marcuswhybrow / venus-sigil.ahk
Created May 22, 2020 13:58
Auto Hot Key script for dodging FFX Thunder Plains lighting strikes
#NoEnv
#MaxThreadsPerHotkey 2
SendMode Input
SetWorkingDir %A_ScriptDir%
F9::
Count := 0
Toggle := !Toggle
loop {
@marcuswhybrow
marcuswhybrow / leadership.md
Last active March 3, 2021 08:58
Leadership

https://youtu.be/ReRcHdeUG9Y?t=2589

Leadership is not a rank, leadership is not a position, leadership is a decision, leadership is a choice. It has nothing to do with your position in the organisation. If you decide to look after the person to the left of you and look after the person to the right of you, you have become a leader.

https://youtu.be/-M8Hl5MUr8w?t=627

I've never quite got over this idea that we're all to some degree the author of our own fate and if we'd only look around properly we could reconstruct situations that we feel we're the victim of but which we're actually personally creating.

https://youtu.be/-M8Hl5MUr8w?t=1527

We're all born with deep tallents and abilities, if you're a human being it comes with the kit. I'm convinced that the most distinctive feature of human life is this power of imagination.

@marcuswhybrow
marcuswhybrow / 01-general.md
Last active October 8, 2016 03:07
Understanding GraphQL

General

https://youtu.be/etax3aEe2dA?t=402

Having all of the business logic live underneath the API layer, and the API layer be a thin layer on top of that, proved to be really valuable to us.

Single Source of Truth|Access|Batching|Caching

  1. Define a class to represent a conceptual data object.
  2. Define a single gen(v: Viewer, id: number) method which requires a Viewer for authorization.
@marcuswhybrow
marcuswhybrow / a_simple_iteration.py
Last active June 16, 2016 00:27
Summing Natural Number Multiples
# In Dead Last, With 883ms It's... Your Friends Simple Interation
# ===============================================================
# I rewrote you're friends code in Python. I also added the ability to accept "limit", and "numbers" as parameters.
# That way it works the same ways my examples do, so I can run tests in the same way.
# Notes:
# - It kind of sucks because you always have to check every number, 1000 iterations in this case.
# Instead of "1" he could have incremented "x" by the largest input number, to skip obvious failures.
@marcuswhybrow
marcuswhybrow / gist:5638052
Created May 23, 2013 17:58
List size of all databases in MySQL
SELECT table_schema "DB Name",
Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB"
FROM information_schema.tables
GROUP BY table_schema;
@marcuswhybrow
marcuswhybrow / mysql2sqlite.sh
Created October 22, 2012 14:18 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite file | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite dump.sql | sqlite3 database.sqlite
@marcuswhybrow
marcuswhybrow / gist:3140154
Created July 19, 2012 01:23
rsnapshot Ubuntu configuration for MSM
Establish the rsnapshot config file, so you need the top level backup.
Here is a quick install guide to rsnapshot, this should make a few things below a bit clearer.
http://linuxmoz.com/rsnapshot-ubuntu-install/
In my case (on my server):
snapshot_root /backup/snapshots/
@marcuswhybrow
marcuswhybrow / bump.sh
Created June 28, 2012 18:27
Script to bump the major, minor or patch number by adding a new tag to the git repository, and modifying the "latest" tag.
latest_tag=$(git tag -l *.*.* --contains $(git rev-list --tags --max-count=1))
if [[ ! "$latest_tag" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "The \"latest\" tag did not exist, or did not point to a commit which also had a semantic version tag."
exit 1
fi
major=$(echo "$latest_tag" | awk -F '.' '{print $1}')
minor=$(echo "$latest_tag" | awk -F '.' '{print $2}')
patch=$(echo "$latest_tag" | awk -F '.' '{print $3}')
@marcuswhybrow
marcuswhybrow / config.sh
Created May 18, 2012 15:39
My Minecraft server Ubuntu init script
#!/bin/bash
# /opt/minecraft/server2/manager.config
### Important Names
# A short name representation for this server, used for consistent directory names:
SERVER_NAME="server2"
# Name to use for the screen instance (must be unique system wide):