Skip to content

Instantly share code, notes, and snippets.

View deekayen's full-sized avatar
🏡
Working from home

David Norman deekayen

🏡
Working from home
View GitHub Profile
@deekayen
deekayen / klausler.js
Created January 23, 2013 18:08
Klausler keyboard layout for importing to http://patorjk.com/keyboard-layout-analyzer/
{"label":"Klausler","fingerStart":{"1":29,"2":30,"3":31,"4":32,"5":56,"6":56,"7":35,"8":36,"9":37,"10":38,"11":56},"keyboardType":"standard","keys":[{"primary":96,"shift":126,"finger":1,"id":0},{"primary":49,"shift":33,"finger":1,"id":1},{"primary":50,"shift":64,"finger":2,"id":2},{"primary":51,"shift":35,"finger":3,"id":3},{"primary":52,"shift":36,"finger":4,"id":4},{"primary":53,"shift":37,"finger":4,"id":5},{"primary":54,"shift":94,"finger":7,"id":6},{"primary":55,"shift":38,"finger":7,"id":7},{"primary":56,"shift":42,"finger":8,"id":8},{"primary":57,"shift":40,"finger":9,"id":9},{"primary":48,"shift":41,"finger":10,"id":10},{"primary":45,"shift":95,"finger":10,"id":11},{"primary":61,"shift":43,"finger":10,"id":12},{"primary":8,"finger":10,"id":13},{"primary":9,"finger":1,"id":14},{"primary":107,"shift":75,"finger":1,"id":15,"altGr":-1,"shiftAltGr":-1},{"primary":44,"shift":60,"finger":2,"id":16,"altGr":-1,"shiftAltGr":-1},{"primary":117,"shift":85,"finger":3,"id":17,"altGr":-1,"shiftAltGr":-1},{"primary":
@deekayen
deekayen / arensito.js
Created January 23, 2013 18:09
Arensito keyboard layout for importing to http://patorjk.com/keyboard-layout-analyzer/
{"label":"Arensito","fingerStart":{"1":29,"2":30,"3":31,"4":32,"5":56,"6":56,"7":35,"8":36,"9":37,"10":38,"11":56},"keyboardType":"standard","keys":[{"primary":96,"shift":126,"finger":1,"id":0},{"primary":49,"shift":33,"finger":1,"id":1},{"primary":50,"shift":64,"finger":2,"id":2},{"primary":51,"shift":35,"finger":3,"id":3},{"primary":52,"shift":36,"finger":4,"id":4},{"primary":53,"shift":37,"finger":4,"id":5},{"primary":54,"shift":94,"finger":7,"id":6},{"primary":55,"shift":38,"finger":7,"id":7},{"primary":56,"shift":42,"finger":8,"id":8},{"primary":57,"shift":40,"finger":9,"id":9},{"primary":48,"shift":41,"finger":10,"id":10},{"primary":45,"shift":95,"finger":10,"id":11,"altGr":-1,"shiftAltGr":-1},{"primary":61,"shift":43,"finger":10,"id":12,"altGr":-1,"shiftAltGr":-1},{"primary":8,"finger":10,"id":13},{"primary":9,"finger":1,"id":14},{"primary":113,"shift":81,"finger":1,"id":15,"altGr":-1,"shiftAltGr":-1},{"primary":108,"shift":76,"finger":2,"id":16,"altGr":-1,"shiftAltGr":-1},{"primary":44,"shift":60,"fin
@deekayen
deekayen / QGMLWY.js
Created January 23, 2013 18:09
QGMLWY keyboard layout for importing to http://patorjk.com/keyboard-layout-analyzer/
{"label":"QGMLWY","fingerStart":{"1":29,"2":30,"3":31,"4":32,"5":56,"6":56,"7":35,"8":36,"9":37,"10":38,"11":56},"keyboardType":"standard","keys":[{"primary":96,"shift":126,"finger":1,"id":0},{"primary":49,"shift":33,"finger":1,"id":1},{"primary":50,"shift":64,"finger":2,"id":2},{"primary":51,"shift":35,"finger":3,"id":3},{"primary":52,"shift":36,"finger":4,"id":4},{"primary":53,"shift":37,"finger":4,"id":5},{"primary":54,"shift":94,"finger":7,"id":6},{"primary":55,"shift":38,"finger":7,"id":7},{"primary":56,"shift":42,"finger":8,"id":8},{"primary":57,"shift":40,"finger":9,"id":9},{"primary":48,"shift":41,"finger":10,"id":10},{"primary":45,"shift":95,"finger":10,"id":11},{"primary":61,"shift":43,"finger":10,"id":12},{"primary":8,"finger":10,"id":13},{"primary":9,"finger":1,"id":14},{"primary":113,"shift":81,"finger":1,"id":15},{"primary":119,"shift":87,"finger":2,"id":16},{"primary":102,"shift":70,"finger":3,"id":17,"altGr":-1,"shiftAltGr":-1},{"primary":112,"shift":80,"finger":4,"id":18,"altGr":-1,"shiftAltG
@deekayen
deekayen / generate_thumbnails.sh
Last active December 14, 2015 08:29
Convert a directory full of targa, gif, jpeg, and tiff images to jpg thumbnails.
#!/bin/sh
# Proper function of this script on Mac requires:
# install tiff 3.6.1 or newer http://www.libtiff.org/
# brew install ghostscript
# brew install imagemagick
timer()
{
if [[ $# -eq 0 ]]; then
@deekayen
deekayen / comment_percent_counter.php
Created February 28, 2013 17:37
Count all the lines of programming vs comments in a file after all the files within a directory have been concatenated together.
<?php
// find . -type f -exec cat {} > ../results.txt \;
$data = file_get_contents('/Users/davidnorman/Sites/lowescat.txt');
$original = count(explode("\n", $data));
print "Original lines: ". $original;
print "<br />\n";
@deekayen
deekayen / CHANGES-mysql.patch
Created May 31, 2013 20:56
One approach to adding MySQL SSL support to Drupal 6.
49,78d48
< * Returns the MySQL client flag based on the defined constant
< *
< * @return integer
< */
< function db_get_client_flag($client_flags = 0) {
< $flags = array(
< 'CLIENT_LONG_PASSWORD' => 1, /* New more secure passwords */
< 'CLIENT_FOUND_ROWS' => 2, /* Found instead of affected rows */
< 'CLIENT_LONG_FLAG' => 4, /* Get all column flags */
@deekayen
deekayen / d8_uninstall.sh
Created June 19, 2013 11:59
D8 reinstallation script by patrickd http://dropbucket.org/node/657. Resets settings.php, removes config and php cache, deletes all tables of a database.
#!/bin/bash
# Put this into your drupal root as uninstall.sh
# Make it executable with $ chmod +x uninstall.sh
# Add it to your .gitignore $ echo uninstall.sh >> .gitignore
# To disable sudo to demand a password for executing this script:
# execute $ visudo
# and add the following lines with the correct paths and your own username:
# Cmnd_Alias D8_UNINSTALL_SCRIPT = /var/www/drupal/uninstall.sh
@deekayen
deekayen / behat-dl.txt
Last active December 18, 2015 18:28
Behat composer -dl output without the drupal-extension options.
deekayen-macbook Sites/drupal-blackbox » bin/behat -dl 255 ↵
Given /^(?:|I )am on (?:|the )homepage$/
When /^(?:|I )go to (?:|the )homepage$/
Given /^(?:|I )am on "(?P<page>[^"]+)"$/
When /^(?:|I )go to "(?P<page>[^"]+)"$/
When /^(?:|I )reload the page$/
When /^(?:|I )move backward one page$/
When /^(?:|I )move forward one page$/
When /^(?:|I )press "(?P<button>(?:[^"]|\\")*)"$/
When /^(?:|I )follow "(?P<link>(?:[^"]|\\")*)"$/
@deekayen
deekayen / behat-dl-drupal-extension.txt
Created June 20, 2013 19:04
Behat -dl with the drupal-extension feature options.
deekayen-macbook Sites/lowessigns-blackbox ‹master*› » bin/behat -dl
Given /^(?:that I|I) am at "(?P[^"]*)"$/
When /^I visit "(?P[^"]*)"$/
When /^I click "(?P<link>[^"]*)"$/
Given /^for "(?P<field>[^"]*)" I enter "(?P<value>[^"]*)"$/
Given /^I enter "(?P<value>[^"]*)" for "(?P<field>[^"]*)"$/
When /^I press the "(?P<button>[^"]*)" button$/
Then /^I should see the link "(?P<link>[^"]*)"$/
Then /^I should not see the link "(?P<link>[^"]*)"$/
Then /^I (?:|should )see the heading "(?P<heading>[^"]*)"$/
@deekayen
deekayen / fix-ssh-agent.sh
Created June 21, 2013 03:59
Fix ssh-agent key agent forwarding on a new Mac OS X install.
#!/bin/sh
sudo touch /var/db/useLS
reboot