Skip to content

Instantly share code, notes, and snippets.

@jackinloadup
jackinloadup / gist:3978944
Created October 30, 2012 08:20
Bookmarklet Ace edior w/ vim keybindings loaded
javascript:(function inject(callback){var baseUrl="http://ajaxorg.github.com/ace-builds/textarea/src/";var load=window.__ace_loader__=function(path,module,callback){var head=document.getElementsByTagName('head')[0];var s=document.createElement('script');s.src=baseUrl+path;head.appendChild(s);s.onload=function(){window.__ace_shadowed__.require([module],callback);};};load('ace-bookmarklet.js',"ace/ext/textarea",function(){var ace=window.__ace_shadowed__;ace.options={mode:'javascript',theme:'monokai',gutter:'true',fontSize:'12px',softWrap:'off',showPrintMargin:'false',useSoftTabs:'true',showInvisibles:'true'};var Event=ace.require("ace/lib/event");baseUrl='';load('http://pastebin.com/raw.php?i=rP7LJZHD',"ace/keyboard/vim",function(){var vim=ace.require('ace/keyboard/vim').handler;var areas=document.getElementsByTagName("textarea");for(var i=0;i<areas.length;i++){Event.addListener(areas[i],"click",function(e){if(e.detail==3){var editor=ace.transformTextarea(e.target,load);editor.setKeyboardHandler(vim);}});}call
@jackinloadup
jackinloadup / resources.md
Created November 12, 2012 17:26 — forked from carwin/resources.md
DrupalCamp Chicago - Resources
@jackinloadup
jackinloadup / SearchBox.css
Last active January 3, 2016 04:39
Below is a sample of various works I have created. Not all the files relate to each other. The included works are from: https://github.com/seanstar12/mittens https://drupal.org/sandbox/Jackinloadup/1216584 https://github.com/jackinloadup/Sproutcore-Drupal
.search-box {
flex: 1;
-webkit-flex: 1;
width: 100%;
max-width: 40em;
min-width: 14em;
margin: 1rem;
box-sizing: border-box;
transition: margin 0.2s linear;
margin: auto;
@jackinloadup
jackinloadup / main.css
Last active June 8, 2016 00:40
Dark developers.mozilla.org
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("mozilla.org"),
domain("mozilla.net"),
domain("mozdev.org"),
domain("mozillazine.org"),
domain("seamonkey-project.org"),
domain("drumbeat.org"),
domain("mozillapopcorn.org"),
domain("mozillalabs.com"),
@jackinloadup
jackinloadup / rofi-custom
Created January 1, 2017 20:05
rofi-custom bash script
#!/bin/bash
#rofi -modi "run,ssh" -show run -auto-select
# ampersands at the end of the line will fork the application laucnhed so it
# shows init as its owner instead of this script.
j4-dmenu-desktop --dmenu="/usr/bin/rofi -m -2 -dmenu -i -p '' -modi "run,ssh" -show run" &
@jackinloadup
jackinloadup / mpd
Created January 3, 2017 05:21
mpd for i3blocks
#!/bin/bash
# Pass the password in the block instance
if [[ -n $BLOCK_INSTANCE ]]; then
password=("-h" "$BLOCK_INSTANCE@localhost")
fi
filter() {
echo -n '['
tr '\n' ' ' | grep -Po '.*(?= \[playing\])|paused' | tr -d '\n'
@jackinloadup
jackinloadup / mopidy
Created January 3, 2017 05:21
mopidy for i3blocks
#!/bin/bash
#
# Author: Raphael P. Ribeiro <raphaelpr01@gmail.com>
MPCSTAT=`mpc | grep -v '^volume:'`
if [ -z "${MPCSTAT}" ]; then # if not playing, exit
echo "$line" || exit 1
else
if [ $1 == '1' ]; then # if arg = 1, show music symbols
MPCSTAT2=`echo "${MPCSTAT}" | sed 's, *, ,g; 1h;1d;2G' | head -n1 | cut -d ']' -f 1 | tr -d [`
@jackinloadup
jackinloadup / vpn
Created January 3, 2017 05:51
vpn i3block
#!/bin/sh
usage() { echo "Usage: $0 [-i enable icon]" 1>&2; exit 1; }
lock=" "
unlock=" "
icon=" " #rocket
text="VPN"
while getopts "d:i" o;
#!/bin/bash
# Xorg window id
ID=$(xdpyinfo | grep focus | cut -f4 -d " ")
# SHELL id
PID=$(xprop -id $ID | grep -m 1 PID | cut -d " " -f 3)
# TERM id
TERM_ID=$(pgrep -P $PID)
#echo "ID: $ID"
#echo "PID: $PID"
@jackinloadup
jackinloadup / gist:c46aa8751925bc8845524602ae544f56
Last active November 15, 2017 21:12
open-here - for use with uxrvt and x11. will open a terminal in the same directory as the terminal you have focused
#!/bin/bash
# Get the focused window ID
ID=$(xdpyinfo | grep focus | cut -f4 -d " ")
# Get the SHELL id
PID=$(xprop -id "$ID" | grep -m 1 PID | cut -d " " -f 3)
# get the TERM id that is running the SHELL
TERM_ID=$(pgrep -P "$PID")
# if there is a current working directory navigate to it