Skip to content

Instantly share code, notes, and snippets.

@noahcoad
noahcoad / ResolutionHotkeys.ahk
Last active October 12, 2015 17:17
Hotkey to Change Screen Resolutions w AutoHotkey
; Requires DisplayChanger, http://12noon.com/?page_id=80
; #=Win ^=Ctrl +=Shift !=Alt
; Set this path to your tools directory
tools := "c:\tools"
; Set screen resolutions
#^0:: Run "%tools%\DisplayChanger\dccmd.exe" -max
#^1:: Run "%tools%\DisplayChanger\dccmd.exe" -width=1024 -height=768
#^2:: Run "%tools%\DisplayChanger\dccmd.exe" -width=1280 -height=1024
@noahcoad
noahcoad / cliptext.ahk
Last active October 12, 2015 17:48
Opens Notepad with hotkeys
;
; Hotkey to opens text editor with clipboard contents
;
; Win+W Open text editor with empty temp file
; Win+Shift+W Open text editor with clipboard contents in an temp file
;
; See blog post for more info:
; http://noahcoad.com/post/411/hotkey-to-open-clipboard-contents-in-text-editor
;
@noahcoad
noahcoad / createkeys.txt
Created November 14, 2012 19:49
Create ssh ID key on Windows
1. install git, http://git-scm.com/downloads
2. reboot (or log out and back in) so PATH environment variable takes effect
3. on cmd.exe prompt, run these commands, do not enter a pass phrase when ssh-keygen prompts, leave it blank, the whole point is to use this file instead of a password or passphrase with every git operation
cd "%UserProfile%"
md .ssh
cd .ssh
ssh-keygen -t rsa -C "your_email@youremail.com"
4. then you can share you your id_rsa.pub public key file (never share private id_rsa file) with your repository, like GitHub or company
@noahcoad
noahcoad / cliptext.rb
Created November 30, 2012 06:54
Ruby script that places the clipboard contents into a new temp text file and opens the text file
#!/usr/bin/env ruby
# Places the clipboard contents into a new temp text
# file and opens the text file in the default text editor
require 'ftools'
# find an unused file name
a = 1
folder = File.expand_path "~/Documents/texts/temp"
@noahcoad
noahcoad / Preferences.sublime-settings
Last active October 14, 2015 02:08
Some of my favorite Sublime Text 2 options. Just click Preferences menu > Settings - User to open settings.
{
// Save files when focus changes,
// like to a new file or another program
"save_on_focus_lost": true,
// Make tabs small
"tab_size": 2,
// Keep tabs. Tabs are used to indent the start of lines
// and different devs like different indention levels.
@noahcoad
noahcoad / cliptext.rb
Created December 17, 2012 04:53
Places the clipboard contents into a text file then launches the text file to open it in the default editor.
#!/usr/bin/env ruby
# Places the clipboard contents into a new temp text
# file and opens the text file in the default text editor
require 'ftools'
# find an unused file name
a = 1
folder = File.expand_path "~/Documents/texts/temp"
@noahcoad
noahcoad / openclip.rb
Last active March 15, 2016 04:40
Ruby script to open the contents of the clipboard. Just assign it to a global hotkey, like Ctrl+O, using Sparkle, Quicksilver, Alfred Powerpack, or your favorite hotkey app. Copy something to the clipboard, hit the hotkey, and it's opened up.
#!/usr/bin/env ruby
# Opens the clipboard contents
# 1. Is it a file or folder?
# 2. Is it obviously a URL?
# 3. Google It
# clipboard contents
clip = IO.popen('pbpaste', 'r+').read
@noahcoad
noahcoad / delicious.css
Created January 3, 2013 19:12
Changed Delicious links page styling, see CSS below for before and after images.
/* Before: http://screencast.com/t/k62jNx1fWkp6 */
/* After: http://screencast.com/t/9CDy57GK0yeu */
/* Styles saved using using Stylebot Chrome plugin http://goo.gl/9sw7F */
/* _After_ doing this I notice Delicious is rolling out a new theme soon */
.body .title { font-size: 1.4em; }
.body .sub { display: none; }
.body .taglist .tag { margin-left: 0; border: none; }
.body .taglist .tag .ar { display: none; }
.body .taglist .tag .co { border: none; font: 8pt verdana; color: #888; }
@noahcoad
noahcoad / GoAwayModalDialogs.ahk
Created January 3, 2013 21:04
Automates away pesky modal dialogs.
; ==========================================================================================
; == Modal Dialog Automation
; ==
; == Automates away pesky modal dialogs by applying a default response when they pop up
; == Helper functions are at the bottom
; ==========================================================================================
; Defaults to fast no-regex title matching
SetTitleMatchMode, 2
@noahcoad
noahcoad / openSublimeProject.ahk
Last active April 16, 2018 23:20
Fixes Sublime Text 2 open project odd behavior on Windows by making sure the selected project receives focus. Will also open files in a specific project window.
;
; Opens Sublime Text 2 and makes the wanted project have focus
; If additional files are specified, they'll be opened in the specified project
; Useful for scripting, global hotkeys, command launchers, etc
;
; Example:
; openSublimeProject.ahk c:\sites\blog\blog.sublime-project c:\sites\blog\.gitignore c:\sites\blog\Gemfile
;
; Problems this script fixes:
; 1. If sublime is already open with the requested project, it creates an empty window and makes that active