Skip to content
Browse files

Switching from 3 space indenting to 2. Sorry this will be a bitch to …

…merge...
  • Loading branch information...
1 parent dbcbdcf commit 564fcb46f04b8b26a1348fec0a37392b8fa4587b @icco committed May 11, 2012
Showing with 333 additions and 334 deletions.
  1. +56 −56 Rakefile
  2. +10 −11 config.yaml
  3. +111 −111 public/print.less
  4. +104 −105 public/style.less
  5. +26 −25 resume.rb
  6. +26 −26 views/index.erb
View
112 Rakefile
@@ -4,88 +4,88 @@ task :default => [:github, :heroku]
desc "Run your resume locally."
task :local do
- exec('./resume.rb')
+ exec('./resume.rb')
end
# Based off of http://railspikes.com/2010/2/13/rake-task-for-deploying-to-heroku
desc "Deploy to Heroku."
task :heroku do
- [ 'heroku', 'heroku/command', 'git' ].each {|gem|
- begin
- require gem
- rescue LoadError
- puts "The gem #{gem} is not installed.\n"
- exit
- end
- }
+ [ 'heroku', 'heroku/command', 'git' ].each {|gem|
+ begin
+ require gem
+ rescue LoadError
+ puts "The gem #{gem} is not installed.\n"
+ exit
+ end
+ }
- puts 'Deploying to Heroku. If you haven\'t run heroku create before, this will fail.'
+ puts 'Deploying to Heroku. If you haven\'t run heroku create before, this will fail.'
- # Get users credentials
- user, pass = File.read(File.expand_path("~/.heroku/credentials")).split("\n")
- heroku = Heroku::Client.new(user, pass)
+ # Get users credentials
+ user, pass = File.read(File.expand_path("~/.heroku/credentials")).split("\n")
+ heroku = Heroku::Client.new(user, pass)
- cmd = Heroku::Command::BaseWithApp.new([])
- remotes = cmd.git_remotes '.'
- remote, app = remotes.detect {|key, value| value == (ENV['APP'] || cmd.app)}
+ cmd = Heroku::Command::BaseWithApp.new([])
+ remotes = cmd.git_remotes '.'
+ remote, app = remotes.detect {|key, value| value == (ENV['APP'] || cmd.app)}
- if remote.nil?
- raise "Could not find a git remote for the '#{ENV['APP']}' app"
- end
+ if remote.nil?
+ raise "Could not find a git remote for the '#{ENV['APP']}' app"
+ end
- g = Git.open('.')
- g.push(g.remote(remote))
+ g = Git.open('.')
+ g.push(g.remote(remote))
- heroku.rake(app, "db:migrate")
- heroku.restart(app)
+ heroku.rake(app, "db:migrate")
+ heroku.restart(app)
- puts '--> Heroku Push successful.'
+ puts '--> Heroku Push successful.'
end
# TODO: Make this dynamically figure out all of the files needed from Sinatra.
desc "Deploy to remote defined in config.yaml"
task :github do
- require File.expand_path('../resume',__FILE__)
- require 'rubygems'
+ require File.expand_path('../resume',__FILE__)
+ require 'rubygems'
- # Nice Error checking for gems.
- [ 'git', 'rack/test', 'logger' ].each {|gem|
- begin
- require gem
- rescue LoadError
- puts "The gem #{gem} is not installed.\n"
- exit
- end
- }
+ # Nice Error checking for gems.
+ [ 'git', 'rack/test', 'logger' ].each {|gem|
+ begin
+ require gem
+ rescue LoadError
+ puts "The gem #{gem} is not installed.\n"
+ exit
+ end
+ }
- remote = YAML.load_file('config.yaml')['github']['remote']
+ remote = YAML.load_file('config.yaml')['github']['remote']
- browser = Rack::Test::Session.new(Rack::MockSession.new(Sinatra::Application))
+ browser = Rack::Test::Session.new(Rack::MockSession.new(Sinatra::Application))
- files = [
- 'index.html',
- 'resume.txt',
- ]
+ files = [
+ 'index.html',
+ 'resume.txt',
+ ]
- files = files + Dir.entries("public").keep_if {|file| File.file? "public/#{file}"}
+ files = files + Dir.entries("public").keep_if {|file| File.file? "public/#{file}"}
- root = "/tmp/checkout-#{Time.now.to_i}"
- g = Git.clone(remote, root, :log => Logger.new(STDOUT))
+ root = "/tmp/checkout-#{Time.now.to_i}"
+ g = Git.clone(remote, root, :log => Logger.new(STDOUT))
- # Make sure this actually switches branches.
- g.checkout(g.branch('gh-pages'))
+ # Make sure this actually switches branches.
+ g.checkout(g.branch('gh-pages'))
- files.each {|file|
- browser.get file
- content = browser.last_response.body
- File.open("#{root}/#{file}", 'w') {|f| f.write(content) }
- g.add(File.basename(file))
- }
+ files.each {|file|
+ browser.get file
+ content = browser.last_response.body
+ File.open("#{root}/#{file}", 'w') {|f| f.write(content) }
+ g.add(File.basename(file))
+ }
- g.commit('Regenerating Github Pages.')
+ g.commit('Regenerating Github Pages.')
- # PUSH!
- g.push(g.remote('origin'), g.branch('gh-pages'))
+ # PUSH!
+ g.push(g.remote('origin'), g.branch('gh-pages'))
- puts '--> GitHub Pages Commit and Push successful.'
+ puts '--> GitHub Pages Commit and Push successful.'
end
View
21 config.yaml
@@ -2,21 +2,20 @@
# Stuff about you.
user_config:
- # Your Name. This will be used for the page title
- name: 'Nathaniel Welch'
+ # Your Name. This will be used for the page title
+ name: 'Nathaniel Welch'
- # The file you want to parse to be your resume
- # Must be a format supported by github-markup
- file: 'resume.md'
+ # The file you want to parse to be your resume
+ # Must be a format supported by github-markup
+ file: 'resume.md'
- # A picture of you. Should be a complete url
- pic: 'http://farm5.static.flickr.com/4044/4529365975_dd958b4ba1.jpg'
+ # A picture of you. Should be a complete url
+ pic: 'http://farm5.static.flickr.com/4044/4529365975_dd958b4ba1.jpg'
- # The google analytics key you wish to use.
- gkey: 'UA-333449-7'
+ # The google analytics key you wish to use.
+ gkey: 'UA-333449-7'
# For github pages to work, this needs to be the GitHub repository this file is
# stored in.
github:
- remote: 'git@github.com:icco/Resume.git'
-
+ remote: 'git@github.com:icco/Resume.git'
View
222 public/print.less
@@ -4,125 +4,125 @@
*/
* {
- margin: 0;
- padding: 0;
+ margin: 0;
+ padding: 0;
}
body {
- background: white;
- color: black;
- font-family: serif;
+ background: white;
+ color: black;
+ font-family: serif;
}
.download {
- display: none;
+ display: none;
}
#resume {
- font-size: 8pt;
-
- a, a:visited {
- color: black;
- text-decoration: none;
- }
-
- h1, h2, h3, h4, h5, h6 {
- border: 0 !important;
- }
-
- h1 {
- font-size: 170%;
- }
-
- h1:first-child {
- font-size: 210%;
- }
-
- h2 {
- font-size: 150%;
- }
-
- h3 {
- margin-top: 0.6em;
- font-size: 130%;
+ font-size: 8pt;
+
+ a, a:visited {
+ color: black;
+ text-decoration: none;
+ }
+
+ h1, h2, h3, h4, h5, h6 {
+ border: 0 !important;
+ }
+
+ h1 {
+ font-size: 170%;
+ }
+
+ h1:first-child {
+ font-size: 210%;
+ }
+
+ h2 {
+ font-size: 150%;
+ }
+
+ h3 {
+ margin-top: 0.6em;
+ font-size: 130%;
+ margin-bottom: 0;
+ }
+
+ p {
+ margin: 0.6em 0;
+ line-height: 1.5em;
+ }
+
+ blockquote {
+ border: 0 !important;
+ margin: 0.5em 0 !important;
+ padding-left: 0.6em !important;
+
+ p {
+ margin: 0.2em 0;
+ }
+ }
+
+ ul, ol {
+ margin: 1em 0 1em 2em;
+
+ li {
+ margin-top: .5em;
+ margin-bottom: .5em;
+ }
+
+ ul, ol {
+ margin-top: 0;
margin-bottom: 0;
- }
-
- p {
- margin: 0.6em 0;
- line-height: 1.5em;
- }
-
- blockquote {
- border: 0 !important;
- margin: 0.5em 0 !important;
- padding-left: 0.6em !important;
-
- p {
- margin: 0.2em 0;
- }
- }
-
- ul, ol {
- margin: 1em 0 1em 2em;
-
- li {
- margin-top: .5em;
- margin-bottom: .5em;
- }
-
- ul, ol {
- margin-top: 0;
- margin-bottom: 0;
- }
- }
-
- a, a:visited {
- text-decoration: none;
- }
-
- a:hover {
- text-decoration: underline;
- }
-
- pre {
- margin: 1em 0;
- font-size: 12px;
- border: 1px solid #dedede;
- padding: .5em;
- line-height: 1.5em;
- overflow: auto;
- }
-
- pre code {
- padding: 0;
- font-size: 12px;
- border: none;
- }
-
- code {
- font-size: 12px;
- padding: 0 .2em;
- border: 1px solid #dedede;
- }
-
- img {
- max-width: 100%;
- }
-
- blockquote {
- margin: 1em 0;
- border-left: 5px solid #ddd;
- padding-left: .6em;
- }
-
- dt {
- font-weight: bold;
- margin-left: 1em;
- }
-
- dd {
- margin-left: 2em;
- margin-bottom: 1em;
- }
+ }
+ }
+
+ a, a:visited {
+ text-decoration: none;
+ }
+
+ a:hover {
+ text-decoration: underline;
+ }
+
+ pre {
+ margin: 1em 0;
+ font-size: 12px;
+ border: 1px solid #dedede;
+ padding: .5em;
+ line-height: 1.5em;
+ overflow: auto;
+ }
+
+ pre code {
+ padding: 0;
+ font-size: 12px;
+ border: none;
+ }
+
+ code {
+ font-size: 12px;
+ padding: 0 .2em;
+ border: 1px solid #dedede;
+ }
+
+ img {
+ max-width: 100%;
+ }
+
+ blockquote {
+ margin: 1em 0;
+ border-left: 5px solid #ddd;
+ padding-left: .6em;
+ }
+
+ dt {
+ font-weight: bold;
+ margin-left: 1em;
+ }
+
+ dd {
+ margin-left: 2em;
+ margin-bottom: 1em;
+ }
}
View
209 public/style.less
@@ -9,125 +9,124 @@
@border: #E0E0E0;
* {
- margin: 0;
- padding: 0;
+ margin: 0;
+ padding: 0;
}
body {
- color: @fg;
- line-height: 1.4em;
- background-color: @bg;
- font-family: serif;
- font-size: 0.9em;
+ color: @fg;
+ line-height: 1.4em;
+ background-color: @bg;
+ font-family: serif;
+ font-size: 0.9em;
}
/**
* Fix float problem.
* http://www.positioniseverything.net/easyclearing.html
*/
.clearfix:after {
- content: ".";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden;
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
}
.download {
- margin-top: 100px;
- display: block;
- text-align: right;
+ margin-top: 100px;
+ display: block;
+ text-align: right;
}
#resume {
- width: 800px;
- margin-left: auto;
- margin-right: auto;
- margin-bottom: 30px;
- padding: 10px;
-
- h1, h2, h3, h4, h5, h6 {
- border: 0;
- }
-
- h1 {
- font-size: 170%;
- border-top: 4px solid @border;
- padding-top: 0.5em;
- margin-top: 1.5em;
- }
-
- h1:first-child {
- margin-top: 30px;
- padding-top: 0.25em;
- border-top: none;
- font-size: 200%;
- }
-
- h2 {
- font-size: 150%;
- margin-top: 1.5em;
- border-top: 4px solid @border;
- padding-top: 0.5em;
- }
-
- h3 {
- margin-top: 1em;
- }
-
- p {
- margin: 1em 0;
- line-height: auto;
- }
-
- ul, ol {
- margin: 1em 0 1em 2em;
-
- li {
- margin-top: 0.3em;
- margin-bottom: 0.3em;
- }
-
- ul, ol {
- margin-top: 0;
- margin-bottom: 0;
- }
- }
-
- blockquote {
- border-left: 5px solid @border;
- margin: 1em 0;
- padding-left: 0.6em;
- }
-
- a, a:visited {
- color: @link;
- text-decoration: none;
- }
-
- a:hover {
- text-decoration: underline;
- }
-
- img {
- max-width: 100%;
- }
-
- blockquote {
- margin: 1em 0;
- border-left: 5px solid @border;
- padding-left: 0.6em;
- color: @fg;
- }
-
- dt {
- font-weight: bold;
- margin-left: 1em;
- }
-
- dd {
- margin-left: 2em;
- margin-bottom: 1em;
- }
+ width: 800px;
+ margin-left: auto;
+ margin-right: auto;
+ margin-bottom: 30px;
+ padding: 10px;
+
+ h1, h2, h3, h4, h5, h6 {
+ border: 0;
+ }
+
+ h1 {
+ font-size: 170%;
+ border-top: 4px solid @border;
+ padding-top: 0.5em;
+ margin-top: 1.5em;
+ }
+
+ h1:first-child {
+ margin-top: 30px;
+ padding-top: 0.25em;
+ border-top: none;
+ font-size: 200%;
+ }
+
+ h2 {
+ font-size: 150%;
+ margin-top: 1.5em;
+ border-top: 4px solid @border;
+ padding-top: 0.5em;
+ }
+
+ h3 {
+ margin-top: 1em;
+ }
+
+ p {
+ margin: 1em 0;
+ line-height: auto;
+ }
+
+ ul, ol {
+ margin: 1em 0 1em 2em;
+
+ li {
+ margin-top: 0.3em;
+ margin-bottom: 0.3em;
+ }
+
+ ul, ol {
+ margin-top: 0;
+ margin-bottom: 0;
+ }
+ }
+
+ blockquote {
+ border-left: 5px solid @border;
+ margin: 1em 0;
+ padding-left: 0.6em;
+ }
+
+ a, a:visited {
+ color: @link;
+ text-decoration: none;
+ }
+
+ a:hover {
+ text-decoration: underline;
+ }
+
+ img {
+ max-width: 100%;
+ }
+
+ blockquote {
+ margin: 1em 0;
+ border-left: 5px solid @border;
+ padding-left: 0.6em;
+ color: @fg;
+ }
+
+ dt {
+ font-weight: bold;
+ margin-left: 1em;
+ }
+
+ dd {
+ margin-left: 2em;
+ margin-bottom: 1em;
+ }
}
-
View
51 resume.rb
@@ -1,51 +1,52 @@
#!/usr/bin/env ruby
+#
# An app for displaying one's resume
-# @author Nat Welch - https://github.com/icco/Resume
+# @author Nat Welch - https://github.com/icco/resume
begin
- require "rubygems"
+ require "rubygems"
rescue LoadError
- puts "Please install Ruby Gems to continue."
- exit
+ puts "Please install Ruby Gems to continue."
+ exit
end
# Check all of the gems we need are there.
[ "sinatra", "less", "github/markup", "yaml" ].each {|gem|
- begin
- require gem
- rescue LoadError
- puts "The gem #{gem} is not installed.\n"
- exit
- end
+ begin
+ require gem
+ rescue LoadError
+ puts "The gem #{gem} is not installed.\n"
+ exit
+ end
}
# Include our configurations from config.yaml
configure do
- set :config, YAML.load_file('config.yaml')['user_config']
+ set :config, YAML.load_file('config.yaml')['user_config']
end
# Render the main page.
get '/index.html' do
- rfile = settings.config['file']
- name = settings.config['name']
- title = "#{name}'s Resume"
- resume = GitHub::Markup.render(rfile, File.read(rfile))
- erb :index, :locals => {
- :title => title,
- :resume => resume,
- :author => name,
- :key => settings.config['gkey'],
- :filename => rfile
- }
+ rfile = settings.config['file']
+ name = settings.config['name']
+ title = "#{name}'s Resume"
+ resume = GitHub::Markup.render(rfile, File.read(rfile))
+ erb :index, :locals => {
+ :title => title,
+ :resume => resume,
+ :author => name,
+ :key => settings.config['gkey'],
+ :filename => rfile
+ }
end
# We do this for our static site rendering.
get '/' do
- redirect '/index.html'
+ redirect '/index.html'
end
# For the plain text version of our resumes
get '/resume.txt' do
- content_type 'text/plain', :charset => 'utf-8'
- File.read(settings.config['file'])
+ content_type 'text/plain', :charset => 'utf-8'
+ File.read(settings.config['file'])
end
View
52 views/index.erb
@@ -12,34 +12,34 @@
'-''-'
-->
<html>
- <head>
- <title><%= title %></title>
- <meta name="author" content="<%= author %>">
- <meta charset="utf-8">
- <link rel="shortcut icon" href="favicon.ico">
+ <head>
+ <title><%= title %></title>
+ <meta name="author" content="<%= author %>">
+ <meta charset="utf-8">
+ <link rel="shortcut icon" href="favicon.ico">
- <!-- http://lesscss.org/ -->
- <link href="print.less" media="print" rel="stylesheet/less" type="text/css" />
- <link href="style.less" media="screen" rel="stylesheet/less" type="text/css" />
- <script src="less-1.1.3.min.js" type="text/javascript"></script>
+ <!-- http://lesscss.org/ -->
+ <link href="print.less" media="print" rel="stylesheet/less" type="text/css" />
+ <link href="style.less" media="screen" rel="stylesheet/less" type="text/css" />
+ <script src="less-1.1.3.min.js" type="text/javascript"></script>
- <script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', '<%= key %>']);
- _gaq.push(['_trackPageview']);
+ <script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', '<%= key %>']);
+ _gaq.push(['_trackPageview']);
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
- </script>
- </head>
- <body>
- <div id="resume">
- <%= resume %>
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+ </script>
+ </head>
+ <body>
+ <div id="resume">
+ <%= resume %>
- <small class="download">Download as <a href="resume.txt">plain text</a>.</small>
- </div>
- </body>
+ <small class="download">Download as <a href="resume.txt">plain text</a>.</small>
+ </div>
+ </body>
</html>

2 comments on commit 564fcb4

@mgius
mgius commented on 564fcb4 May 11, 2012

Why 2 spaces?

@icco
Owner
icco commented on 564fcb4 May 11, 2012

It's what I'm using for everything else these days (it's Google code style) and it was frustrating me.

Please sign in to comment.
Something went wrong with that request. Please try again.