Skip to content

Instantly share code, notes, and snippets.

View hookio-helloworld.js
// A simple hello world microservice
// Click "Deploy Service" to deploy this code
// Service will respond to HTTP requests with a string
module['exports'] = function helloWorld (hook) {
// hook.req is a Node.js http.IncomingMessage
var host = hook.req.host;
// hook.res is a Node.js httpServer.ServerResponse
// Respond to the request with a simple string
hook.res.end(host + ' says, "Hello there world!"');
};
@noahcoad
noahcoad / ResolutionHotkeys.ahk
Last active October 12, 2015 17:17
Hotkey to Change Screen Resolutions w AutoHotkey
View ResolutionHotkeys.ahk
; 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
View cliptext.ahk
;
; 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
View createkeys.txt
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
View cliptext.rb
#!/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.
View Preferences.sublime-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.
View cliptext.rb
#!/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 / delicious.css
Created January 3, 2013 19:12
Changed Delicious links page styling, see CSS below for before and after images.
View delicious.css
/* 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 / 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.
View openclip.rb
#!/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 / manpow-homeland-hubspot-proxy-hookio.js
Last active August 3, 2016 17:28
ManPow Homeland Hubspot Proxy hook.io
View manpow-homeland-hubspot-proxy-hookio.js
module['exports'] = function echoHttp (hook) {
var request = require('request');
var mongodb = require('mongodb');
paths = {
'requestbin': hook.env['manpow-homeland-hubspot-proxy-requestbin-url'],
'moneybug': "http://homeland2.nwaoftexas.com/hubspot/money-bug-hook",
'nwa': 'https://homeland.nwaoftexas.com/nwa/import/investor-lead-data',
'testnwa': 'http://heartland.nwaoftexas.com/money-bug/collect-newwestern',
'testmb': "http://heartland.nwaoftexas.com/money-bug/collect" }