This file contains 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(websocketClient, $, undefined) { | |
var PING_INTERVAL = 42000, | |
RECONNECT_INTERVAL = 10000, | |
WEBSOCKET_URL = window.location.host + '/websocket'; | |
var config, reconnectInterval, keepAliveInterval, dispatcher; | |
websocketClient.init = function(websocketConfig) { | |
config = websocketConfig; | |
setupDispatcher(); | |
}; |
This file contains 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
################### | |
# Prefix key setup | |
################### | |
set -g prefix C-a # remap prefix to Control + a --> i'm old that way. | |
# bind 'C-a C-a' to type 'C-a' | |
bind a send-prefix # send 'C-a' into terminal app by typing: 'C-a a' | |
bind C-a last-window # bounce between windows just by typing 'C-a C-a' | |
unbind C-b # get rid of C-b as prefix | |
######################## |
This file contains 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
hardstatus alwayslastline | |
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]' | |
# Default screens | |
screen -t shell1 0 | |
screen -t shell2 1 | |
screen -t server 2 ssh me@myserver |
This file contains 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
number = rand(10) | |
puts 'Guess the number!' | |
input = 'input number' | |
while input != number | |
input = gets.to_i # keep getting more numbers | |
# give out hints to the user | |
if input > number | |
puts 'Too high' | |
end |
This file contains 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
GUESS_RANGE = 100 | |
guessNumber = rand(GUESS_RANGE) | |
puts "Guess the number! (Hint: between 0 and #{GUESS_RANGE})" | |
guessCount = 0 | |
while (userGuess = gets.to_i) != guessNumber # keep getting more numbers | |
# give out hints to the user | |
puts 'Too high' if userGuess > guessNumber |
NewerOlder