Skip to content

Instantly share code, notes, and snippets.

@gwash
gwash / CHM viewer
Last active August 29, 2015 14:05
Shell CHM file handler using Archmage
#!/bin/sh
#by M Rawash <mrawash@gmail.com>
#requires archmage
[[ $BROWSER ]] || BROWSER='w3m -F'
if test "$1" = "-l"; then
shift
PORT=$((10000+$RANDOM))
archmage -p $PORT "$@" &
@gwash
gwash / notsubtle.lua
Last active September 28, 2015 15:17
Subtle-like window management for notion
-- Copyright (c) 2011, M Rawash <mrawash@gmail.com>
--
-- Released under the most recent GPL <http://www.gnu.org/licenses/gpl.html>
--
-- Subtle(wm)-like window management
--
function notsubtle(cf,pos)
local cmx = assert(cf:mx_current())
local cws = notioncore.find_manager(cf,'WGroupWS')
@gwash
gwash / tabcloseduplicates.penta
Created October 8, 2012 08:44
pentadactyl command to close duplicate tabs
com -d "Delete duplicate tabs" tabcloseduplicates,tabclosed -js let seen={},vtabs=tabs.visibleTabs,i=vtabs.length;while(i--){let loc=vtabs[i].linkedBrowser.contentDocument.location.href||"";if(Object.prototype.hasOwnProperty.call(seen, loc)){config.tabbrowser.removeTab(vtabs[i]);}else{seen[loc]=true;}}
@gwash
gwash / gist:1685143
Created January 26, 2012 21:14
relinker command for ranger
class relink(Command):
"""
:relink <newpath>
Changes the linked path of the currently highlighted symlink to <newpath>
"""
def execute(self):
from ranger.fsobject import File
@gwash
gwash / keymap.c
Last active August 26, 2017 21:32
qmk gwash kemap gist
#include "ergodox.h"
#include "debug.h"
#include "action_layer.h"
#include "version.h"
#define _______ KC_TRNS
//linux keycodes
#define KC_FILEMANAGER KC_MY_COMPUTER
#define KC_TOOLS KC_F13
#include "gwash.h"
#include "mousekey.h"
const uint16_t PROGMEM fn_actions[] = {
[FN_SWP_HNDS] = ACTION_SWAP_HANDS_TAP_TOGGLE(),
[1] = ACTION_LAYER_TAP_TOGGLE(1)
};
qk_tap_dance_action_t tap_dance_actions[] = {
[TD_SCOLON_COLON] = ACTION_TAP_DANCE_DOUBLE(KC_SCOLON,KC_COLN),