This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name anti key-grabber | |
| // @description Prevent web apps from capturing and muting vital keyboard shortcuts | |
| // @grant none | |
| // @version 1.1 | |
| // ==/UserScript== | |
| (function(){ | |
| var isMac = unsafeWindow.navigator.oscpu.toLowerCase().contains("mac os x"); | |
| unsafeWindow.document.addEventListener('keydown', function(e) { | |
| if (e.keyCode === 116) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import sys | |
| NR_LAYER = 10 | |
| def get_n_plus_1(weights): | |
| length = len(weights) | |
| lower_weights = [[1 for col in range(length+1)] for row in range(length+1)] | |
| print "---- %d -----" % len(weights) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| list=($(echo file?)) | |
| max=${#l[@]} | |
| i=0 | |
| while (( i < max )) | |
| do | |
| j=0 | |
| while (( j < max-i-1)) | |
| do | |
| echo ${list[$j]} ${list[$i]} | |
| let j++ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # screen-saver wrapper to fix/modify xflock4 behavior | |
| # It also logs when it's activated. | |
| #logfile="$HOME/.screensaver.log" | |
| logfile="$HOME/usr/var/log/screensaver.log" | |
| control_command () { | |
| #gnome-screensaver-command "$@" | |
| /usr/bin/xscreensaver-command "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| . /etc/skel/.bashrc | |
| set -o noclobber | |
| PS1='$ ' | |
| ######## aliases ####### | |
| if type lv >/dev/null 2>&1 | |
| then | |
| alias lv=less | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # | |
| # clean cache and zerofill unused filesystem space for VirtualBox *.vdi image files | |
| # | |
| set -ue | |
| set -x | |
| sudo apt-get clean | |
| if ! type pv > /dev/null 2>&1 | |
| then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # | |
| # print list of Debian/Ubuntu packages sorted in installed-size. | |
| # | |
| dpkg --get-selections | | |
| awk '{print $1}' | | |
| xargs apt-cache show | | |
| egrep '^(Package|Installed-Size): ' | | |
| tr '\n' ',' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Use https://chrome.google.com/webstore/detail/shortcut-manager/mgjjeipcdnnjhgodgjpfkffcejoljijf | |
| //to assign key-shortcut to this JS snippet | |
| function moveCaret(win, charCount) { | |
| var sel; | |
| sel = win.getSelection(); | |
| if (sel.rangeCount > 0) { | |
| var textNode = sel.focusNode; | |
| console.log(textNode) | |
| var newOffset = sel.focusOffset + charCount; | |
| sel.collapse(textNode, Math.min(textNode.length, newOffset)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function disableCtrlKeyCombination(e) | |
| { | |
| var key; | |
| var isCtrl; | |
| key = e.which; | |
| if( e.ctrlKey ){ | |
| console.log('Ctrl+ASCII shortcut hooked.') | |
| if (String.fromCharCode(key).toLowerCase() == 'b') { //debug | |
| console.log('Ctrl+b') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name DontStealMyShurtcut | |
| // @namespace http://ryo1kato.github.com/ | |
| // @version 0.1 | |
| // @description enter something useful | |
| // @match https://docs.google.com/spreadsheet/* | |
| // @require http://code.jquery.com/jquery-latest.min.js | |
| // ==/UserScript== | |
| function disableCtrlKeyCombination(e) |