This gist is part of a blog post. Check it out at here.
This file contains hidden or 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
# coding: utf-8 | |
require 'sinatra' | |
set server: 'thin', connections: [] | |
get '/' do | |
halt erb(:login) unless params[:user] | |
erb :chat, locals: { user: params[:user].gsub(/\W/, '') } | |
end | |
get '/stream', provides: 'text/event-stream' do |
This file contains hidden or 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
function! ChromeReload() | |
let applescript = "-e \"tell application \\\"Google Chrome\\\" to tell the active tab of its first window \r | |
\reload \r | |
\end tell \r | |
\tell application \\\"Google Chrome\\\" to activate\"" | |
silent exec "!osascript " . applescript | |
endfunction | |
command! ChromeReload call ChromeReload() |
This file contains hidden or 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
#################################### Keyboard #################################### | |
# Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs) | |
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 | |
#################################### Trackpad #################################### | |
# Enable tap to click on a Magic Trackpad | |
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true |
NewerOlder