Skip to content

Instantly share code, notes, and snippets.

View mason-larobina's full-sized avatar

Mason Larobina mason-larobina

  • Western Australia
  • 11:29 - 8h ahead
View GitHub Profile
@mason-larobina
mason-larobina / rc.lua.patch
Created September 5, 2012 04:59
Patch to style luakit follow hints with CSS
diff --git a/config/rc.lua b/config/rc.lua
index c03a6bd..aa3a781 100644
--- a/config/rc.lua
+++ b/config/rc.lua
@@ -109,6 +109,20 @@ require "downloads_chrome"
-- Add vimperator-like link hinting & following
require "follow"
+follow.stylesheet = follow.stylesheet .. [===[
+
@mason-larobina
mason-larobina / new_bashrc.sh
Created August 11, 2012 13:46 — forked from josephwecker/new_bashrc.sh
Replace .bashrc, .bash_profile, .profile, etc. with something much more clean, consistent, and meaningful.
#!/bin/bash
# License: Public Domain.
# Author: Joseph Wecker, 2012
#
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile?
# Are you tired of trying to remember how darwin/mac-osx treat them differently from linux?
# Are you tired of not having your ~/.bash* stuff work the way you expect?
#
# Symlink all of the following to this file:
# * ~/.bashrc
@mason-larobina
mason-larobina / rc.lua
Created August 6, 2012 15:19 — forked from johntyree/webview.lua
Set jQuery animation speed for all luakit:// pages from your luakit rc.lua
function webview.init_funcs.set_jquery_speed(view, w)
view:add_signal("load-status", function (view, status)
if status == "finished" and string.match(view.uri, "^luakit://") then
view:eval_js [=[ if ($) $.fx.speeds._default = 70; ]=]
end
end)
end
@mason-larobina
mason-larobina / pgp-merge-drv
Created April 25, 2012 17:36 — forked from ewa/pgp-merge-drv
Git merge driver to decrypt (and re-encrypt) files before merging.
#!/bin/bash
# WARNING: This creates and manipulates clear text copies of the
# encrypted files. It tries to clean up afterwards, but lots can go
# wrong. If you are seriously worried about the secrecy of the files,
# don't trust this!
ANCESTOR=$1
MINE=$2
OTHER=$3
@mason-larobina
mason-larobina / gist:1180520
Created August 30, 2011 09:18
Patch to add a clock widget to luakit (for the fullscreeners)
diff --git a/config/rc.lua b/config/rc.lua
index 839310e..88b43be 100644
--- a/config/rc.lua
+++ b/config/rc.lua
@@ -130,6 +130,30 @@ require "go_input"
require "go_next_prev"
require "go_up"
+------------------
+-- Add a clock! --
@mason-larobina
mason-larobina / cookie_filtering.lua
Created July 22, 2011 06:05
Cookie filtering by cookie domain, path & key (was cookie-filtering branch)
@mason-larobina
mason-larobina / noscript.lua
Created June 15, 2011 02:05
NoScript plugin for luakit
--------------------------------------------------------
-- NoScript plugin for luakit --
-- (C) 2011 Mason Larobina <mason.larobina@gmail.com> --
--------------------------------------------------------
-- Get Lua environment
local os = require "os"
local tonumber = tonumber
local assert = assert
local table = table
@mason-larobina
mason-larobina / luakit-2011.05.06
Created May 7, 2011 13:30
AUR pkgbuilds for luakit
# Maintainer: J. W. Birdsong <jwbirdsong AT gmail DOT com>
pkgname=luakit
pkgver=2011.05.06
pkgrel=1
pkgdesc="luakit is a fast, small, webkit-gtk based browser extensible by Lua. Stable release."
arch=('i686' 'x86_64')
url="http://www.luakit.org/projects/luakit"
license=('GPL3')
depends=('libwebkit' 'luafilesystem')
@mason-larobina
mason-larobina / db_clean.lua
Created April 13, 2011 16:13
clean all luakit sqlite3 databases
----------------------------------------------------------
-- :dbclean command to vacuum all open sqlite databases --
-- (C) 2011 Mason Larobina <mason.larobina@gmail.com> --
----------------------------------------------------------
-- Note: this needs to be required in your config before any databases
-- are created (i.e. before the history and cookies libs)
require "coroutine"
require "lfs"
@mason-larobina
mason-larobina / auto_insert.lua
Created April 11, 2011 14:24
Auto enter insert mode when input field focused on page load in luakit
------------------------------------------------------------------
-- Auto enter insert mode when input field focused on page load --
-- (C) 2011 Mason Larobina <mason.larobina@gmail.com> --
------------------------------------------------------------------
local is_editable = [=[
(function () {
var e = document.activeElement;
// we might get a window object if the main frame was focused
if (!e || !e.tagName) {