This file contains 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
{ | |
"description": "Maps button 5 and 4 as modifiers for button 1 and 2 to switch spaces and desktops", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"pointing_button": "button4", | |
"modifiers": { | |
"mandatory": [], | |
"optional": [ |
This file contains 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 | |
until docker-compose exec mysql mysql -h 127.0.0.1 -u $DB_USERNAME -p$DB_PASSWORD -D $DB_DATABASE --silent -e "show databases;" | |
do | |
echo "Waiting for database connection..." | |
sleep 5 | |
done |
This file contains 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
// Inspired in http://www.johneday.com/422/time-based-gmail-filters-with-google-apps-script | |
// Deletes old marked conversations | |
function cleanUp() { | |
var delayDays = 5; // # of days before messages are moved to trash | |
var label = "Delete me"; // label to identify the messages | |
var maxDate = new Date(Date.now() - delayDays * 24 * 60 * 60 * 1000); | |
var userLabel = GmailApp.getUserLabelByName(label); | |
if (!userLabel) { | |
return; |
This file contains 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
// Code modified from: http://www.johneday.com/422/time-based-gmail-filters-with-google-apps-script | |
// This is code for a Google Apps Script. You can add the code and give it permissions at script.google.com | |
// Archive every thread in your Inbox that is older than two days, and not starred. | |
function archiveInbox() { | |
var threads = GmailApp.search('label:inbox older_than:2d -in:starred'); | |
for (var i = 0; i < threads.length; i++) { | |
threads[i].moveToArchive(); | |
} |
This file contains 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
<?php | |
/** | |
* Show users with a Job Title "'WP Plugin developer " only | |
**/ | |
add_filter('um_prepare_user_query_args', 'um_my_custom_query_args', 99, 2); | |
function um_my_custom_query_args( $query_args, $args ) { | |
if( $args["form_id"] == "1" ) { // you can validate the current member directory form ID | |
$query_args['meta_query'][] = array( |
This file contains 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
// reference https://drewnoakes.com/code/javascript/bubbles.html | |
/* | |
Drew Noakes 6 Apr 2002 http://drewnoakes.com | |
- Images now can go up and down (allowing bubbles, as well as snow) | |
- Images move into the screen and move out smoothly, without disappearing or | |
appearing suddenly | |
- Scrolling the page doesn't effect the appearance of the snow/bubbles | |
- renamed variables to be more meaningful | |
- refactored common code out to functions, replacing different repeating | |
functions for each browser with a single function (moveFloatingImages) |
This file contains 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
-- Inspired by Linux alt-drag or Better Touch Tools move/resize functionality | |
function get_window_under_mouse() | |
-- Invoke `hs.application` because `hs.window.orderedWindows()` doesn't do it | |
-- and breaks itself | |
local _ = hs.application | |
local my_pos = hs.geometry.new(hs.mouse.getAbsolutePosition()) | |
local my_screen = hs.mouse.getCurrentScreen() |
This file contains 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 | |
# Are you using Mac OS X? | |
# You need to install coreutils for this to work. | |
# try `brew install coreutils` | |
# or `sudo port install coreutils` | |
# set a part size that works with FAT32 drives | |
PART_SIZE=3999 | |
# nice little intro |
This file contains 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 | |
# NOTE: Brackets are not supported and '$' in values will break the script. | |
mkdir /etc/nginx/sites-enabled 2> /dev/null | |
for file in /etc/nginx/sites-available/*.conf | |
do | |
TPL=$(cat $file) | |
for row in $(env) | |
do |
This file contains 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
if [ ! -f .env ] | |
then | |
export $(cat .env | xargs) | |
fi |
NewerOlder