Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/ruby
require 'net/imap'
class ExchangeCalendar
def initialize(servername, user, password)
@imap = Net::IMAP.new(servername)
@imap.login(user, password)
@imap.examine('Calendar')
end
[alias]
st = status
ci = commit
co = checkout
br = branch
ca = commit -av
lo = log --graph
undo = reset --hard
[color]
branch = auto
# Now to pimp out our prompt
NOCOLOR="\[\033[0m\]"
BAR="----"
BLK="\[\033[0;30m\]" ; BLK1="\[\033[1;30m\]" #dark grey
RED="\[\033[0;31m\]" ; RED1="\[\033[1;31m\]"
GRN="\[\033[0;32m\]" ; GRN1="\[\033[1;32m\]"
YEL="\[\033[0;33m\]" ; YEL1="\[\033[1;33m\]"
BLU="\[\033[0;34m\]" ; BLU1="\[\033[1;34m\]"
PUR="\[\033[0;35m\]" ; PUR1="\[\033[1;35m\]"
[{"name":"playback","filename":"1"},
{"name":"playback","filename":"3"}]
if (i == 5)
handleIEqualToFive();
doSomethingElseCompletelyUnrelated();
doYetAnotherUnrelatedThing();
...
...
backend
=======
while true do
select(listener, 1s)
if commands
send them
end
if get_button
send beep down button pipe
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initializing new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
}
class FrameProfiler {
// The root frame is the top-most frame in this trace. It is an error to try and pop it.
private $frameStack;
function FrameProfiler() {
$this->frameStack = array();
$this->enterSection("root");
}
function enterSection($name) {
I have a nested set of hashes like:
[A]
[B]
[C]
[D]
[E]
[F]
[A']
[B']
I have a nested set of hashes like:
[A]
[B]
[C]
[D]
[E]
[F]
[A']
[B']