Skip to content

Instantly share code, notes, and snippets.

View bjeanes's full-sized avatar
🕊️

Bo Jeanes bjeanes

🕊️
View GitHub Profile
sudo gem install ParseTree RedCloth Shoulda Text ZenTest abstract acts_as_paranoid ghost bjeanes-twibot bones capistrano cheat color cucumber datamapper defunkt-github deprec diff-lcs duration echoe engineyard-eycap erubis eventmachine extlib ezcrypto faker find_gem gbarcode gemedit gemify gemjour haml highline hoe hpricot httparty httpclient josevalim-rails-footnotes json json_pure juggernaut libxml-ruby lockfile markaby mash mbleigh-subdomain-fu mechanize memcache-client mime-types meow mocha money mongrel mysql newjs nokogiri oauth open4 passenger pdf-writer plist polyglot postgres prawn rack rake randexp rb-appscript rcov rdiscount redgreen rfeedparser right_aws rr rspec rspec-rails rspec_hpricot_matchers ruby-debug rubyforge rubyist-aasm ruport schacon-git sake scruffy selenium-client sequel sinatra soap4r sprinkle starling syntax technicalpickles-jeweler term-ansicolor thin thoughtbot-shoulda timcharper-calendar_date_select tlsmail treetop twitter-auth uuidtools webrat wirble wycats-textmate
Dear Mr Bodaniel Jeanes
Later today Exetel will commence a short (5 day) trial of what is claimed to be a non-intrusive internet site filtering system. By 'non-intrusive' is meant something that a user will not notice in terms of any browsing or file downloading speed differences.
The reason that Exetel is doing this trial is that our belief to date is that any future mandatory internet site 'filtering' will impose significant costs on Exetel and significant slow downs on our customers. Since the current Labor Federal Government announced its intentions to impose some form of internet censorship we have looked at various ways that we could implement it (should it ever become necessary) at the lowest possible cost and with the lowest possible speed degradation. To date, our view has been that no such solution exists.
We are trialing the one possible solution that, while certainly costing an ISP a significant amount of money, claims to have almost zero/actually zero affect on a user's speeds of service. Havi
# If it is going to make it a UTC time, it should
# at least convert it but it just assumes it is
# UTC without even looking at the time zone
time = "2007-08-05T20:00:00-04:00"
Time.parse(time) # => Mon Aug 06 10:00:00 1000 2007
time.to_time # => Sun Aug 05 20:00:00 UTC 2007
# Fix:
def human_factor
- # tripping the captain fantastic
- "#{factor/100}#{".#{factor%100/10}" unless factor%100 == 0}x"
+ # tripping the admiral fantastic
+ "%0.2fx" % (factor / 100.0)
end
# Log to STDOUT if in Rails
if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER')
require 'logger'
RAILS_DEFAULT_LOGGER = Logger.new(STDOUT)
end
Failed to connect to Twitter. It's likely down for a bit:
HTTP 400: Bad Request at
Failed to connect to Twitter. It's likely down for a bit:
HTTP 400: Bad Request at
irb(main):001:0> gem 'RedCloth', '= 4.1.1'
=> true
irb(main):002:0> require 'RedCloth'
=> true
irb(main):003:0> RedCloth::VERSION
=> 4.1.1
irb(main):004:0> RedCloth.new("@[Ruby]I::am(:some => 'ruby')@").to_html
=> "<p><code lang=\"Ruby\">I::am(:some =&gt; 'ruby')</code></p>"
bjeanes@Maccy ~/S/secret_project (master) ☠ $ > du -cs vendor/ features/
4120 vendor/
680 features/
4800 total
code = Uv.parse(code, "xhtml", "ruby", false, "sunburst")
# semantics (add <code> tag)
code = code.gsub(/^<pre class="([a-zA-Z_-]+)">/,%Q[<pre><code lang="\1">])
code = code.gsub(/<\/pre>$/,'</code></pre>')
# Add line numbers using a table (so they aren't included in selections!
lines = code.split(/\n/).size
%Q[<table cellpadding="0" cellspacing="0">
<tbody>
function newin() {
/bin/pwd | /usr/bin/pbcopy
/usr/bin/open -a Terminal
/usr/bin/osascript -e 'tell application "Terminal" to do script with command "cd \"$(/usr/bin/pbpaste)\"; echo \" \" | /usr/bin/pbcopy; /usr/bin/clear"'
return 0
}