Skip to content

Instantly share code, notes, and snippets.

@mtrl
mtrl / ReleaseEvents.cs
Created March 14, 2016 11:46
ReleaseEvents.cs
using Tridion.ContentManager.ContentManagement;
using Tridion.ContentManager.Extensibility;
using Tridion.ContentManager.Extensibility.Events;
using Tridion.ContentManager.CommunicationManagement;
using System;
using Tridion.ContentManager;
using System.IO;
using System.Web;
@mtrl
mtrl / tampermonkey-rightmove-full-screen.js
Last active December 30, 2015 17:29
Tampermonkey script for rightmove.co.uk to make the search results display full screen
// ==UserScript==
// @name rightmove.co.uk full screen width
// @description Shows rightmove.co.uk search results at full screen width
// @updateURL https://gist.github.com/mtrl/7861280/raw/tampermonkey-rightmove-full-screen.js
// @version 1.0.1
// @match http://www.rightmove.co.uk/property-for-sale/property*
// @match http://www.rightmove.co.uk/property-to-rent/property/*
// @copyright 2013, Mark Williams
// ==/UserScript==
function addGlobalStyle(css) {
@mtrl
mtrl / hobbyking-userscript-hide-daily-video.js
Last active December 27, 2015 18:19
A little tampermonkey/greasemonkey script to hide the daily video on HobbyKing.com
// ==UserScript==
// @name Remove HobbyKing auto play daily video
// @namespace http://mtrl.co.uk/
// @updateURL https://gist.github.com/mtrl/7369221/raw/hobbyking-userscript-hide-daily-video.js
// @version 1.0.3
// @description Removes the annoying autoplay daily video from the home page of HobbyKing.com
// @match http://hobbyking.com/hobbyking/store/index.asp
// @match http://www.hobbyking.com/hobbyking/store/index.asp
// ==/UserScript==
@mtrl
mtrl / gist:4683489
Created January 31, 2013 15:09
MS SQL 2008. Create new database from .bak file
From http://codeonaboat.wordpress.com/2012/02/16/sql-server-2008-creating-a-database-from-a-bak-file/
If that’s where you are stuck, the following will help you.
1. In SSMS, open a query window in the master database of the database server. That’s where you will run the following queries.
2. See what the “LogicalName” of the database that has been backed up in the .bak file is
RESTORE FILELISTONLY
FROM DISK = 'c:\tmp\tridioncm.bak'
@mtrl
mtrl / Vagrantfile
Created November 2, 2015 12:36
Vagrant file for DD4T 2.0 vNext application
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@mtrl
mtrl / .vimrc
Created July 31, 2012 11:16
My .vimrc file
set background=dark
set hlsearch
" Use incremental searching
set incsearch
" Set standard setting for PEAR coding standards
set tabstop=4
set shiftwidth=4
@mtrl
mtrl / gist:2955001
Created June 19, 2012 16:08
Rsync resume and progress
rsync -P [local files] -e ssh [user]@[remote]:[remote location]
@mtrl
mtrl / gist:2935445
Created June 15, 2012 08:36
VNC over SSH
On client open a terminal and “ssh -L 5902:localhost:[remote-port(usually 5900) [user]@[server]”
Open VNC client and connect to display 2 on localhost, specify password if needed
@mtrl
mtrl / gist:2724148
Created May 18, 2012 09:06
ffmpeg - FLAC to m4a
for i in *.flac; do ffmpeg -i "$i" -acodec alac "`basename "$i" .flac`.m4a"; done;
@mtrl
mtrl / gist:2291190
Created April 3, 2012 11:35
Mac - Mount ISO to bootable USB
$ diskutil list
and it returns something like
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 999.9 GB disk0s2
/dev/disk1