Skip to content

Instantly share code, notes, and snippets.

@mtrl
mtrl / Phonegap iOS hide status bar
Created May 2, 2014 21:46
Hide Status bar on iOS with phonegap application
To hide statusbar, add the following code in the file MainViewController.m under the function -(void)viewDidUnload
- (BOOL)prefersStatusBarHidden
{
return YES;
}
git rm -r --cached .;git add .;git commit -m ".gitignore is now working"
--[[
KAP UAV Exposure Control Script v1.5
-- Released under GPL by waterwingz and wayback/peabody
http://chdk.wikia.com/wiki/KAP_%26_UAV_Exposure_Control_Script
@title KAP UAV 1.5
@param i Shot Interval (sec)
@default i 15
@range i 2 120
@param s Total Shots (0=infinite)
@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 / .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;