- Install homebrew.
brew install rbenv ruby-build
echo 'eval "$(rbenv init -)"' >> $HOME/.bash_profile
rbenv install 2.2.0
rbenv global 2.2.0
rbenv rehash
gem install bundler rails
My IP 199.66.67.83 | |
traceroute to media.alfredapp.com (205.186.187.196), 64 hops max, 72 byte packets | |
1 router (192.168.0.1) 2.565 ms 2.380 ms 2.226 ms | |
2 10.194.48.3 (10.194.48.3) 8.981 ms 11.225 ms 7.986 ms | |
3 10.192.0.4 (10.192.0.4) 8.239 ms 9.902 ms * | |
4 69.174.129.30 (69.174.129.30) 11.136 ms 8.505 ms 7.980 ms | |
5 66.62.16.9 (66.62.16.9) 13.233 ms 17.418 ms 15.681 ms | |
6 lax1-core-02.360.net (66.62.3.5) 55.225 ms 13.259 ms 15.662 ms |
[alias] | |
co = checkout | |
tagsbydate = for-each-ref --sort=-taggerdate --format='%(refname:short)' refs/tags | |
previoustag = !sh -c 'git tagsbydate --count 2 | cut -f2 | sed -n 2p' | |
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -- | |
markdownlog = log --color --pretty=format:'* %s `%Cred%h%Creset` - %C(bold blue)[%an](mailto:%ae)%Creset' --abbrev-commit --dense --no-merges --reverse | |
releasenotes = !sh -c 'git markdownlog ...`git previoustag`' | |
tree = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --decorate" | |
fix = "commit --amend -C HEAD" | |
di = "diff --color" |
require 'net/ping' | |
@icmp = Net::Ping::ICMP.new('142.40.81.34') | |
rtary = [] | |
pingfails = 0 | |
repeat = 5 | |
puts 'starting to ping' | |
(1..repeat).each do | |
if @icmp.ping |
<!doctype html> | |
<html lang=en> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="verify-v1" content="91yIG+EaOdwKuPX+R9ChHEWVXJ6wdQsq0gqD1c1sbaY="/> | |
<title>David Shapiro, Resume- Web Developer</title> | |
<style type="text/css"> | |
body{font-family:Geneva, Arial, Helvetica, sans-serif;font-size:12px;font-weight:normal;color:#000000;text-align:center;margin:0;padding:0;line-height:1.5em;} | |
header, section, article{display:block;} | |
header{text-align:center;position:relative;z-index:1;} |
Simple Dashing widget to countdown until a certain moment. Flashes the widget when finished.
##Usage
To use this widget, copy countdown.html
, countdown.coffee
, and countdown.scss
into the /widgets/countdown
directory.
To include the widget in a dashboard, add the following snippet to the dashboard layout file:
##Description Simple Dashing widget (and associated job) to display general puppetdb status. Pulled the API calls from Puppetboard.
WARNING: This only works if puppetdb is listening on HTTP. I have not gotten around to getting this to work with SSL client certificates yet. If you know how, please leave them at the comments below.
##Dependencies None
function doubleInteger(i) { | |
// i will be an integer. Double it and return it. | |
i = i*2 | |
return i; | |
} |
In this article, I'll walk through a basic Rails (3.2.x) setup for creating a nested resource for two models. Nested resources work well when you want to build out URL structure between two related models, and still maintain a RESTful convention. This code assumes you are running RVM to manage Ruby/Gem versions, and Git for version control.
$ mkdir family # create rvm gemset
$ echo "rvm use --create ruby-1.9.2@family" > family/.rvmrc
$ cd family # install rails
$ gem install rails # create new rails project
$ rails new . # version control