Skip to content

Instantly share code, notes, and snippets.

@lionicsheriff
lionicsheriff / rc.lua
Last active December 14, 2015 03:39
Kindle Touch: Remap home button to next page. Requires xdotool While reading, reject touch events. Can be overriden by holding down home
-- Copyright (c) 2011 Amazon Technologies, Inc. All rights reserved.
-- PROPRIETARY/CONFIDENTIAL
-- Use is subject to license terms.
require("awful")
require("awful.rules")
-- local copy of the screen
g_screenOne = screen[1]
// ==UserScript==
// @id dft-always-show-dialoglog
// @name Show dialoglog
// @version 1.0
// @namespace dft
// @author Matthew Goodall
// @description
// @include http://mspaintadventures.com/*
// @run-at document-end
// ==/UserScript==
@lionicsheriff
lionicsheriff / gist:3908886
Created October 17, 2012 23:00
I should be more careful
function revert_last_commit()
{
read -p "Are you sure you want to revert the last commit?[y/N] " -n 1 answer
echo
if test $answer = 'y'
then
svn up
local head="$(svn info | grep Revision | cut -d' ' -f2)"
local prev="$(expr $head - 1)"
@lionicsheriff
lionicsheriff / gist:3791800
Last active October 11, 2015 02:57
Push command into shell history
history_push(){
local COMMAND
for arg in "$@"
do
case "$arg" in
*\ *)
*\'*)
COMMAND="$COMMAND \"$arg\""
;;
*\"*)
// ==UserScript==
// @id dft-postion-unfixed
// @name Remove position fixed
// @version 2.0
// @namespace dft
// @author Matthew Goodall
// @description Changes position:fixed to position:relative
// @include *
// @exclude https://docs.google.com/*
// @run-at document-end
@lionicsheriff
lionicsheriff / dft-position-unfixed.js
Last active October 10, 2015 18:57
unfix position
// ==UserScript==
// @id dft-postion-unfixed
// @name Remove position fixed
// @version 2.0
// @namespace dft
// @author Matthew Goodall
// @description Changes position:fixed to position:static
// @include *
// @exclude https://docs.google.com/*
// @run-at document-end
tell application "Firefox"
activate
set the_title to name of first window
tell application "System Events"
key code 53 # escape key
delay 1
keystroke "l" using {command down}
delay 1
keystroke "c" using {command down}
delay 1