Check out the February Code Genius Intro
Go get your RSVP to next week's Code Genius
Check out the Genius Engineering Blog
| #!/bin/sh | |
| if [ ! $# -gt 0 ]; then echo "Usage: $0 <Name>"; exit 1; fi | |
| curl "http://antarcticabar.com/NameNight.html" 2> /dev/null | grep -oi "$1" | wc -l | awk '{ if ($1 > 0) { print "Your month" } else {print "Nope"} }' |
| #!/usr/bin/env sh | |
| # Title: Ruby development environment for OS X (Lion) | |
| # Author: Rogelio J. Samour | |
| # Warning: | |
| # While it is unlikely any code below might damage your system, | |
| # it’s always a good idea to back up everything that matters to you | |
| # before running this script! Just in case. I am not responsible for | |
| # anything that may result from running this script. Proceed at | |
| # your own risk. |
| # | |
| # Ideas stolen from lograge and brought to Rails 2.3 | |
| # https://github.com/mattmatt/lograge/blob/master/lib/lograge/log_subscriber.rb | |
| # | |
| module ImprovedControllerLogging | |
| def self.included(base) | |
| base.alias_method_chain :log_processing, :fixup | |
| base.inject_alias_method_chain :perform_action, | |
| :perform_action_with_benchmark, |
| node default { | |
| # This is required to apply some manifests since these are not using | |
| # appropriate user, group or full path to the command. | |
| Exec { | |
| group => "staff", | |
| user => $boxen_user, | |
| path => [ | |
| "/usr/local/bin", | |
| "/usr/bin", | |
| "/bin", |
| require 'nokogiri' | |
| require 'octokit' | |
| require 'open-uri' | |
| github = Octokit::Client.new(:access_token => ENV['GH_TOKEN']) | |
| doc = Nokogiri::HTML.fragment(open('https://github.com/imathis/octopress/wiki/3rd-Party-Octopress-Themes').read) | |
| doc.search('table tr td:first a:first').map do |a| | |
| a['href'] =~ %r{https?://github.com/([^/]+)/([^?/]+)(\?|$|/)} && [$1, $2] |
Check out the February Code Genius Intro
Go get your RSVP to next week's Code Genius
Check out the Genius Engineering Blog
Custom format for displaying bytes as kb, mb, gb or tb.
Response to a few places on the internet: https://productforums.google.com/forum/#!topic/docs/x_T_N-yRUYg And here: https://stackoverflow.com/questions/1533811/how-can-i-format-bytes-a-cell-in-excel-as-kb-mb-gb-etc
Here is one that I have been using:
[<1000000]0.00," KB";[<1000000000]0.00,," MB";0.00,,," GB"