Skip to content

Instantly share code, notes, and snippets.

View ianbattersby's full-sized avatar
🐘
@ianbattersby@hachyderm.io

Ian Battersby ianbattersby

🐘
@ianbattersby@hachyderm.io
View GitHub Profile
@ianbattersby
ianbattersby / archandwin8.md
Last active August 29, 2015 14:20
Some notes for Mark from installing Arch side-by-side with existing Windows 8.1 installation

NOTE! If you have a BitLockered Windows partition and TPM this may fail in ways I don't want to comprehend. Un-bitlock first if I were you should that be the case.

NOTE! I wrote most of this from memory, one I regularly volunteer is shocking ;)

Backup shit

  • Boot into Windows and backup your current UEFI partition using BCDEDIT /export
  • Backup Windows if you really give a shit

Before you do anything else

  • Turn off SECURE BOOT in the BIOS and make sure it still boots up into Windows
@ianbattersby
ianbattersby / alsa.conf
Last active August 29, 2015 14:19
ThinkPad t440 /etc/modprobe.d/alsa.conf for audio
options snd_hda_intel enable=0,1
options snd slots=snd_hda_intel,thinkpad_acpi
options snd_hda_intel index=0
options thinkpad_acpi index=1
@ianbattersby
ianbattersby / gist:d6f2813bc0a30f6e0307
Last active August 29, 2015 14:19
Ian's Coffee List
Aldgate: @AssociationEC3^+ and @Dose_E1*%
Camden Town: Lola's*%
Farringdon: Prufrock+^% and Dept Coffee & Resp^%
Holborn: Workshop^
Islington: @SaintEspresso+*%
Kings Cross: CaravanX^+@
OldSt/Barbican: TimberYard* and Look Ma No Hands*
OldSt/Hoxton: MacIntyres R.I.P. and Embassy East
Marble Arch: Borough Barista*
TCourtRd: T.A.P. Coffee
function generateUUID(){
var d = new Date().getTime();
var uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
var r = (d + Math.random()*16)%16 | 0;
d = Math.floor(d/16);
return (c === "x" ? r : (r&0x7|0x8)).toString(16); });
return uuid;
}
@ianbattersby
ianbattersby / LockMachine.scpt
Created May 17, 2014 19:27
Alfred workflow examples
on alfred_script(q)
do shell script "open /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app"
end alfred_script
@ianbattersby
ianbattersby / OrmLiteVistaDbCommand.cs
Created February 19, 2014 13:22
Current VistaDB.5 OrmLite v4 dialect
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using VistaDB.Provider;
namespace ServiceStack.OrmLite.VistaDB
{
public class OrmLiteVistaDbCommand : IDbCommand
@ianbattersby
ianbattersby / gist:7475232
Created November 14, 2013 22:14
Alfred: Bind hotkey to iterm2 new window
on alfred_script(q)
if isAppRunning("iTerm") then
tell application "iTerm"
set myterm to (make new terminal)
tell myterm
set mysession to (make new session at the end of sessions)
tell mysession
exec command "/bin/zsh -l"
end tell
end tell
@ianbattersby
ianbattersby / gist:7254920
Last active December 27, 2015 02:49
Current IntelliJ colour scheme (inspired by Soda Dark)

NB: Where no background is specified, THERE ISN'T ONE (no tick)

General

  • Default text: fgF8F8F8 bg383838
  • Caret: F8F8F8

NB: Rest are darcula defaults I think

Language Defaults

@ianbattersby
ianbattersby / GeEndpointTests.cs
Created September 17, 2013 12:53
Example of Simple.Web bootstrapping w/acceptance test. NOTE: The acceptance test assembly does not need to reference anything other than the bootstrapping assembly!
namespace SimpleWebTest.Tests.Acceptance
{
using SimpleWebTest;
using Xunit;
public class GetEndpointTests : IDisposable
{
private const string port = 5000;
@ianbattersby
ianbattersby / Program.cs
Last active December 22, 2015 07:09
Example Simple.web w/Razor
namespace ConsoleApplication26
{
using System;
using System.Collections.Generic;
using Simple.Web;
using Simple.Web.Behaviors;
internal class Program
{