Skip to content

Instantly share code, notes, and snippets.

View mnem's full-sized avatar

Dave Clayton-Wagner mnem

View GitHub Profile
@mnem
mnem / git_fetch_pull_all_subfolders.sh
Created December 6, 2011 14:35
Simple bash script for fetching and pulling all repos in the executed folder to the latest of the branch they are on
#!/bin/bash
################
# Uncomment if you want the script to always use the scripts
# directory as the folder to look through
#REPOSITORIES="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
REPOSITORIES=`pwd`
IFS=$'\n'
@mnem
mnem / game_dev_links.md
Last active December 15, 2023 22:38
Some game dev links that I should probably keep note of.
@mnem
mnem / silencio.rb
Created October 7, 2014 10:53
Preventing mkmf littering with log files
require 'mkmf'
# Make the MakeMakefile logger write file output to null.
# Probably requires ruby >= 1.9.3
module MakeMakefile::Logging
@logfile = File::NULL
end
@mnem
mnem / man xccov
Last active October 4, 2021 12:10
xccov(1) xccov(1)
NAME
xccov - view Xcode coverage data in human-readable or machine-parseable format.
SYNOPSIS
xccov view [--only-targets | --files-for-target target_name | --functions-for-file name_or_path]
@mnem
mnem / 00-setting-up-a-scaleway-ghost-server.md
Last active May 17, 2021 00:08
Setting up ghost on scaleway because the app image they have is really rather old.

Server image

I use Ubuntu 16.04/Ubuntu Xenial.

Setup server

Add a new user who isn't root, but who can sudo:

  1. Update all the things: apt-get update && apt-get dist-upgrade && apt-get autoremove
  2. Reboot, just in case: shutdown -r now
@mnem
mnem / nah_xcode_uncrustify.rb
Last active February 1, 2020 20:12
Script file to be run as an Xcode 4 behaviour which uncrustifies the project source using reasonable Objective-C formatting defaults. Alternatively, you can run it and pass a path to uncrustify.
#!/usr/bin/env ruby
###########################################################################
# Script to be called as an Xcode 4 behaviour which will attempt to
# uncrustify all source files in the open project.
#
# (c) Copyright 2012 David Wagner.
#
# Complain/commend: http://noiseandheat.com/
#
#*************************************************************************#
@mnem
mnem / ConEmu.xml
Last active January 20, 2019 09:22
My ConEmu.xml file. See comment for further details and how to install. To find out more about ConEmu, see: https://code.google.com/p/conemu-maximus5/
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2013-08-29 11:28:09" build="130827">
<value name="ColorTable00" type="dword" data="00000000"/>
<value name="ColorTable01" type="dword" data="00ee0000"/>
<value name="ColorTable02" type="dword" data="0000cd00"/>
<value name="ColorTable03" type="dword" data="00cdcd00"/>
<value name="ColorTable04" type="dword" data="000000cd"/>
<value name="ColorTable05" type="dword" data="00cd00cd"/>
@mnem
mnem / fibonacci_limits.c
Created February 23, 2014 01:08
Quick and dirty calculator for the largest fibonacci sequence number which can be held in common integer widths and in a JavaScript Number. Likely only compiles on a 64 bit machine with a reasonably modern gcc or clang.
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
// Uses the fibonacci sequence defined
// in http://oeis.org/A000045
__uint128_t fib(__uint128_t n) {
if (n == 0) {
return 0;

Recursive mutexes are a hack

Recursive mutexes are a hack. There's nothing wrong with using them, but they're a crutch. Got a broken leg or library? Fine, use the crutch. But at least be aware that you're using a crutch, and why; and once in a while check out the leg (or library) to be sure you still need the crutch. And if it's not healing up, go see a doctor, because that's just not OK. When you have no choice, there's no shame in using a crutch... but you can't run very well on a crutch, and you'll also be slowing down anyone who depends on you.

/System/iOSSupport
├── System
│   └── Library
│   ├── AccessibilityBundles
│   │   ├── AVFoundation.axbundle
│   │   ├── AVKit.axbundle
│   │   ├── AccessibilitySettingsLoader.bundle
│   │   ├── AdSheet.axbundle
│   │   ├── AddressBook-Assistant.axbundle
│   │   ├── AddressBookUIFramework.axbundle