Skip to content

Instantly share code, notes, and snippets.

View kevin-ashton's full-sized avatar

Kevin Ashton kevin-ashton

  • Greater Salt Lake Area, Ut
View GitHub Profile
# See https://www.linuxquestions.org/questions/linux-newbie-8/complicated-key-remap-multiple-keys-at-once-4175485671/
# Also https://unix.stackexchange.com/questions/55076/what-is-the-mode-switch-modifier-for
# use `xev` to see what keys maps to (kind of verbose)
xset -r 133
# Super_L mapped to switching mode
xmodmap -e "keycode 133 = Mode_switch"
xmodmap -e "keycode 30 = u U Page_Down Page_Down"
xmodmap -e "keycode 31 = i I Page_Up Page_Up"
@kevin-ashton
kevin-ashton / a.js
Created September 4, 2015 16:54
arrayTransform
//Transforms array a into the value of b while maintaining the original reference of a. Useful for updating synced arrays
function arrayTransform(a,b){
var old = a.slice();
b.forEach(function(i){
if(a.indexOf(i) === -1){
a.push(i);
}
});
@kevin-ashton
kevin-ashton / foundatoin-media-queries.scss
Last active August 29, 2015 14:19
Foundation Media Queries
//Media query logic modifed from Zurbs Foundation framework
$breakpoint-small-max: 600;
$breakpoint-medium-max: 1000;
$breakpoint-large-max: 1339;
$breakpoint-xlarge-max: 1600;
$breakpoint-xxlarge-max: 9999999999;
@function lower-bound($range){
@if length($range) <= 0 {
@return 0;
}
@kevin-ashton
kevin-ashton / gist:b8987b9b081ff8ffbf69
Last active March 13, 2018 07:24
Rsync chmod permissions from windows
You can set the perms using the --chmod parameter e.g.
rsync --verbose --delete --recursive -p --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r /cygdrive/c/src/ user@host:~/src/
will force the permissions to be set to 755 for Directories and 644 for Files.
See https://serverfault.com/questions/233567/how-to-set-file-folder-permissions-using-rsync-from-windows-to-linux/233586#233586 though his code didn't work correctly for me. Needed to specify the directory and folder (F & D) on the group and others (go).
@kevin-ashton
kevin-ashton / gist:99cef1e876376e735128
Created October 8, 2014 16:48
Bearify (replace all images with images of bears)
var jQueryScriptOutputted = false;
function initJQuery() {
//if the jQuery object isn't available
if (typeof(jQuery) == 'undefined') {
if (! jQueryScriptOutputted) {
//only output the script once..
jQueryScriptOutputted = true;
@kevin-ashton
kevin-ashton / ka1.sh
Created May 26, 2014 06:26
Encrypt a file using gpg with shell wrappers (parameters into shell)
#!/bin/bash
#First we make sure they have input a parameter for the program to encrypt
if [ "$1" = "" ]; then
echo Must have a file to encrypt
exit
fi
echo Please, enter your password
#stty turns on and off a type of output. We don't want the password to be in clear text so we disable it with "stty -echo". Aftwards we return the output to it's orginal state with "stty $stty_orig".
stty_orig=`stty -g`
stty -echo
@kevin-ashton
kevin-ashton / findk.sh
Last active August 29, 2015 14:01
Linux Search Command (simple version)
#!/bin/bash
#
find . -type f -exec grep -i "$1" {} \; -print
@kevin-ashton
kevin-ashton / media-query-scss-mixin.scss
Created February 25, 2014 18:06
Media Query Scss Mixin
//Based off of http://css-tricks.com/media-queries-sass-3-2-and-codekit/
@mixin bp-min-width($point) {
@media (min-width: $point) { @content; }
}
@mixin bp-max-width($point) {
@media (max-width: $point) { @content; }
}
//Order matters for this plugin as it is currently written
@mixin bp($point) {
@kevin-ashton
kevin-ashton / Group CSS ClearFix
Created September 3, 2013 22:00
CSS Clear Fix
.group:before,
.group:after {
content: "";
display: table;
}
.group:after {
clear: both;
}
[
{ "keys": ["ctrl+shift+e"], "command": "open_folder_in_explorer" }
]