Skip to content

Instantly share code, notes, and snippets.

View ericdodds's full-sized avatar

Eric Dodds ericdodds

View GitHub Profile
@ericdodds
ericdodds / emacs_hammerspoon.lua
Last active August 24, 2022 16:29 — forked from justintanner/emacs_hammerspoon.lua
Updated so that Control + Shift + [f/b/n/p] selects one cell (Google Sheets) or line (Google Docs)
-- Emacs Hammerspoon Script
-- Author: Justin Tanner
-- Email: work@jwtanner.com
-- License: MIT
-- What does this script do?
-- Allows you to have *most* Emacs keybindings in other apps.
-- Ctrl-Space space be used to mark and cut text just like Emacs. Also enables Emacs prefix keys such as Ctrl-xs (save).
-- Installation
@ericdodds
ericdodds / emacs_hammerspoon.lua
Created June 21, 2022 14:14 — forked from hacker0limbo/emacs_hammerspoon.lua
Emacs Hammerspoon Script
--- Emacs Hammerspoon Script
-- Author: Justin Tanner
-- Email: work@jwtanner.com
-- License: MIT
--- What does this thing do?
-- Allows you to have Emacs *like* keybindings in apps other than Emacs.
-- You can use Ctrl-Space to mark and cut text just like Emacs. Also enables Emacs prefix keys such as Ctrl-xs (save).
--- Installation
@ericdodds
ericdodds / README.md
Created January 29, 2019 10:43 — forked from hofmannsven/README.md
Increase key repeat rate on macOS

Increase key repeat rate on macOS

Settings: System Preferences » Keyboard » Key Repeat/Delay Until Repeat

Use the commands below to increase the key repeat rate on macOS beyond the possible settings via the user interface. The changes aren't applied until you restart your computer.

Source: https://apple.stackexchange.com/a/83923

@ericdodds
ericdodds / mac-key-repeat-speed.txt
Created January 23, 2019 13:42
Mac key repeat speed
Everybody knows that you can get a pretty fast keyboard repeat rate by changing a slider on the Keyboard tab of the Keyboard & Mouse System Preferences panel. But you can make it even faster! In Terminal, run this command:
defaults write NSGlobalDomain KeyRepeat -int 0
Then log out and log in again. The fastest setting obtainable via System Preferences is 2 (lower numbers are faster), so you may also want to try a value of 1 if 0 seems too fast. You can always visit the Keyboard & Mouse System Preferences panel to undo your changes.
You may find that a few applications don't handle extremely fast keyboard input very well, but most will do just fine with it.
[robg adds: We originally ran a very similar hint back in 2003. However, that hint had the order of the values reversed, and made the change via editing a preferences file instead of via a defaults write command. So I felt it worth re-running this version as it's simpler and more correct. If anyone knows what service to restart to skip the logout/log
@ericdodds
ericdodds / nativefier-create-app
Created January 9, 2019 11:45
Nativefier - create app with name and icon
nativefier --name "Hootsuite" --icon /Users/ericdodds/Desktop/hootsuite.png "https://hootsuite.com/dashboard"
@ericdodds
ericdodds / hardy-additional-css.css
Created August 28, 2018 00:33
ericdodds.com WordPress - extra CSS in Hardy theme
/*
Welcome to Custom CSS!
CSS (Cascading Style Sheets) is a kind of code that tells the browser how
to render a web page. You may delete these comments and get started with
your customizations.
By default, your stylesheet will be loaded after the theme stylesheets,
which means that your rules can take precedence and override the theme CSS
rules. Just write here what you want to change, you don't need to copy all
@ericdodds
ericdodds / citepro-hide-footnotes-homepage.php
Created August 28, 2018 00:30
Citepro Wordpress Plugin - Hide Footers from Homepage Feed
add_filter( 'citepro_load_homepage', '__return_false' );
@ericdodds
ericdodds / url-parameters-pardot-iframe.js
Last active August 4, 2020 20:33
Pass URL parameters to Pardot form iframe
<noscript>
<iframe src="PARDOT_FORM_URL" width="100%" height="500" type="text/html" frameborder="0" allowTransparency="true" style="border: 0"></iframe>
</noscript>
<script type="text/javascript">
var form = 'PARDOT_FORM_URL';
var params = window.location.search;
var thisScript = document.scripts[document.scripts.length - 1];
var iframe = document.createElement('iframe');
var userChoice = prompt("Do you choose rock, paper, scissors or rope?");
var computerChoice = Math.random();
if (computerChoice <= 0.25)
{
computerChoice = "rock";
}
else if (0.26 <= computerChoice <= 0.50)
{
computerChoice = "paper";
}
var userChoice = prompt("Do you choose rock, paper, scissors or rope?");
var computerChoice = Math.random();
if (computerChoice <= 0.25)
{
computerChoice = "rock";
}
else if (0.26 <= computerChoice <= 0.50)
{
computerChoice = "paper";
}