Skip to content

Commit

Permalink
final version
Browse files Browse the repository at this point in the history
  • Loading branch information
schacon committed Apr 1, 2011
1 parent c052176 commit d110dc9
Show file tree
Hide file tree
Showing 9 changed files with 207 additions and 3 deletions.
18 changes: 18 additions & 0 deletions custom.css
Expand Up @@ -110,6 +110,15 @@ table.rdata {
font-size: 1.5em; font-size: 1.5em;
} }


.rvc h2 {
font-size: 60px;
font-weight: bold;
}
.rvc h3 {
font-size: 40px;
color: #0b98b4;
}

table.rdata tr.level { table.rdata tr.level {
color: #0b98b4; color: #0b98b4;
background: #def; background: #def;
Expand Down Expand Up @@ -155,3 +164,12 @@ table.rdata tr td.no-wd {
.backup pre code { .backup pre code {
font-size: 25px; font-size: 25px;
} }

.tiny {
line-height: 19px;
}

.tiny pre code {
font-size: 25px;
color: #000;
}
16 changes: 16 additions & 0 deletions final/01_final.md
@@ -1,5 +1,18 @@
!SLIDE title !SLIDE title


# CODA #
## Let's Review ##

!SLIDE bullets list incremental

# Tree Roles #

* **HEAD** last commit, next parent
* **Index** proposed next commit
* **Work Dir** sandbox

!SLIDE title

### Hi, you've reached Jimmy ### ### Hi, you've reached Jimmy ###
## If you can dream it, you can do it! ## ## If you can dream it, you can do it! ##


Expand All @@ -16,3 +29,6 @@
# questions? # # questions? #


### threetrees.heroku.com ### ### threetrees.heroku.com ###
### schacon.github.com/resetvcheckout.html ###
### github.com/schacon/tale_of_three_trees ###
### gist.github.com/582888 ###
70 changes: 70 additions & 0 deletions timer.js
@@ -0,0 +1,70 @@
var timerSetUp = false;
var timerRunning = false;
var intervalRunning = false;
var seconds = 0;
var totalMinutes = 35;

function setUpTimer()
{
if (timerSetUp) { return; }

timerSetUp = true;

$("#slideInfo").after(' <span id="timerInfo"></span> &nbsp; <img id="progressIcon"/>');

$(document).keydown(function(event) {
var key = event.keyCode;
if (event.ctrlKey || event.altKey || event.metaKey) { return; }

if (key == 89) // y for timer
{
toggleTimer();
}
});
}

function toggleTimer()
{
if (!timerRunning) {
timerRunning = true
$("#timerInfo").text(timerStatus(0));
seconds = 0
if (!intervalRunning) {
intervalRunning = true
setInterval(function() {
if (!timerRunning) { return; }
seconds++;
$("#timerInfo").text(timerStatus(seconds));
}, 1000); // fire every minute
}
} else {
seconds = 0
timerRunning = false
$("#timerInfo").text('')
}
}

function timerStatus(seconds) {
var minutes = Math.round(seconds / 60);
var left = (totalMinutes - minutes);
var percent = Math.round((minutes / totalMinutes) * 100);
var progress = getSlidePercent() - percent;
setProgressIcon(progress);
return ' - (' + minutes + '/' + left + ':' + percent + '%)';
}

function setProgressIcon(progress) {
if(progress > 10) {
$('#progressIcon').attr('src', '/image/timer/flag_blue.png')
} else if (progress > 0) {
$('#progressIcon').attr('src', '/image/timer/flag_green.png')
} else if (progress > -10) {
$('#progressIcon').attr('src', '/image/timer/flag_yellow.png')
} else {
$('#progressIcon').attr('src', '/image/timer/flag_red.png')
}
}

$(function(){
setUpTimer();
});
Binary file added timer/flag_blue.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added timer/flag_green.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added timer/flag_red.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added timer/flag_yellow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 70 additions & 0 deletions treefun/01_treefun.md
Expand Up @@ -12,6 +12,40 @@
* git reset --patch (commit) [file] * git reset --patch (commit) [file]
* git checkout --patch (commit) [file] * git checkout --patch (commit) [file]


!SLIDE code

# git read-tree #

!SLIDE code

# git write-tree #

!SLIDE commandline incremental

$ ls
README Rakefile lib

$ git init
Initialized empty Git repository in /private/tmp/gt/.git/
nothing added to commit but untracked files present (use "git add" to track)

$ git log
fatal: bad default revision 'HEAD'

$ git add --all

$ git write-tree
4b8ad0172510761cb0e07d2c4220932bf41bbd07

$ git ls-tree 4b8ad0172510761cb0e07d2c4220932bf41bbd07
100644 blob 45dc653de6860... README
100644 blob ea3fe2ac46e92... Rakefile
040000 tree 99f1a6d12cb4b... lib

!SLIDE code

# git commit-tree #

!SLIDE !SLIDE


# Environment Variables # # Environment Variables #
Expand Down Expand Up @@ -181,3 +215,39 @@
Date: Thu Mar 31 13:45:56 2011 -0700 Date: Thu Mar 31 13:45:56 2011 -0700


back back

!SLIDE

# Freeze Submodules Before Push #

!SLIDE tiny

@@@ ruby
current_commit = `git rev-parse HEAD`
current_tree = `git rev-parse HEAD^{tree}`

# get a list of submodules
status = `git submodule status`.chomp
subdata = status.split("\n")
subdata.each do |subline|
sharaw, path = subline.split(" ")
sha = sharaw[1, sharaw.size - 1]
remote = path.gsub('/', '-')
`git remote add #{remote} #{path} 2>/dev/null` # fetch each submodule into a remote
`git fetch #{remote}`
`git read-tree --prefix=#{path} #{sha}` # for each submodule/sha, read-tree the sha into the path
end

# find heroku parent
prev_commit = `git rev-parse heroku 2>/dev/null`.chomp
pcommit = (prev_commit != "heroku") ? "-p #{prev_commit}" : ''

# write-tree/commit-tree with message of what commit sha it's based on
tree_sha = `git write-tree`.chomp
commit_sha = `echo "deploy at #{current_commit}" | git commit-tree #{tree_sha} #{pcommit}`

# update-ref
`git update-ref refs/heads/heroku #{commit_sha}`

# reset
`git reset HEAD`
36 changes: 33 additions & 3 deletions treework/01_treework.md
Expand Up @@ -256,7 +256,13 @@


!SLIDE code !SLIDE code


## git reset HEAD -- file ## ## git reset ##

!SLIDE code

# OR #

## git reset [file] ##


!SLIDE !SLIDE


Expand All @@ -283,6 +289,29 @@


!SLIDE !SLIDE


# undo last commit #
## but keep the stage ##

!SLIDE smaller

# `git reset --soft HEAD~` #

## moves HEAD back but keeps index ##

!SLIDE

![](reset1.png)

!SLIDE

![](reset-soft.png)

!SLIDE

![](reset-mixed.png)

!SLIDE

# squash the last 2 commits into one # # squash the last 2 commits into one #


!SLIDE small !SLIDE small
Expand Down Expand Up @@ -337,9 +366,10 @@


![](reset-checkout.png) ![](reset-checkout.png)


!SLIDE center !SLIDE center rvc


# Reset v. Checkout # ## Reset v. Checkout ##
### schacon.github.com/resetvcheckout.html ###


<table class="rdata"> <table class="rdata">
<tr> <tr>
Expand Down

0 comments on commit d110dc9

Please sign in to comment.