- treeish: anything which references a commit (e.g. branch, HEAD, HEAD
10, master15, SHA)
Displays file from a specific commit
Checkout a file from a specific commit
e.g.
| gifify() { | |
| if [[ -n "$1" ]]; then | |
| if [[ $2 == '--good' ]]; then | |
| ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
| time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
| rm out-static*.png | |
| else | |
| ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
| fi | |
| else |
| <%# | |
| # Renders Google Analytics tracking script | |
| # | |
| # Example | |
| # | |
| # <%= render 'shared/analytics', ua_code: 'UA-XXXXXX-X' %> | |
| # | |
| #%> | |
| <% if Rails.env.production? %> | |
| <script type="text/javascript"> |
| def donate_to_charity(args = {}) | |
| # Set valid options that can be supplied. All others will be cut. | |
| valid_args = [:user_id, :charity_id, :amount] | |
| # Set default options if none are supplied | |
| defaults = { :user_id => nil, | |
| :charity_id => 1, | |
| :amount => 25 } | |
| # Raise ArgumentError if invalid keys are passed |
| #!/bin/sh | |
| USERNAME=shostakovich | |
| mkdir ~/tmp | |
| cd ~/tmp | |
| # Install GCC + Git | |
| curl https://github.com/downloads/kennethreitz/osx-gcc-installer/GCC-10.7-v2.pkg > GCC-10.7-v2.pkg | |
| sudo installer -pkg GCC-10.7-v2.pkg -target / |
| # http://ruby-doc.org/stdlib-1.9.2/libdoc/csv/rdoc/CSV.html#method-c-load | |
| # http://ruby-doc.org/stdlib-1.9.2/libdoc/csv/rdoc/CSV.html#method-c-dump | |
| # https://github.com/JEG2/faster_csv/blob/master/test/tc_serialization.rb | |
| require 'csv' | |
| class Person | |
| attr_accessor :id, :name, :email | |
| def self.csv_load(meta, headers, row) | |
| person = Person.new |
| # Usage: redis-cli publish message hello | |
| require 'sinatra' | |
| require 'redis' | |
| conns = [] | |
| get '/' do | |
| erb :index | |
| end |
A GUI, or rather a CMS interface for DocPad is the big next step. It was also one of the first proof of concepts I used to ensure DocPad would be able to scale into the web development platform of the future.
Back in the first early months of DocPad, I created three plugins:
| --- | |
| #### | |
| #### THIS IS OLD AND OUTDATED | |
| #### LIKE, ANSIBLE 1.0 OLD. | |
| #### | |
| #### PROBABLY HIT UP https://docs.ansible.com MY DUDES | |
| #### | |
| #### IF IT BREAKS I'M JUST SOME GUY WITH | |
| #### A DOG, OK, SORRY | |
| #### |
| class ActionDispatch::Routing::Mapper | |
| def draw(routes_name) | |
| instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb"))) | |
| end | |
| end | |
| BCX::Application.routes.draw do | |
| draw :api | |
| draw :account | |
| draw :session |