>> ps.cancel_at
=> Fri, 05 Oct 2012 00:00:00 UTC +00:00
>> ps.cancel_at.class
=> ActiveSupport::TimeWithZone
>> ps.cancel_at = DateTime.new 2012, 11, 05
=> Mon, 05 Nov 2012 00:00:00 +0000
>> ps.save
(0.2ms) BEGIN
Entity Load (0.5ms) SELECT "entities".* FROM "entities" WHERE "entities"."id" = 2485 LIMIT 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.9.3-p327 → rspec spec/requests/ | |
WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8 | |
Rack::File headers parameter replaces cache_control after Rack 1.5. | |
...^CF^C | |
An error occurred in an after hook | |
Errno::EPIPE: Broken pipe | |
occurred at /Users/cjolly/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/poltergeist-1.0.2/lib/capybara/poltergeist/web_socket_server.rb:144:in `write' | |
F | |
An error occurred in an after hook |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# file: /etc/xdg/lxsession/LXDE/autostart | |
# sudo raspi-config # Enable Boot To Desktop | |
# idea via: http://lokir.wordpress.com/2012/09/16/raspberry-pi-kiosk-mode-with-chromium/ | |
@lxpanel --profile LXDE | |
@pcmanfm --desktop --profile LXDE | |
# @xscreensaver -no-splash | |
@xset s off |
After reading Code Climate's Rails' Insecure Defaults I realized I was guilty of breaking rule 3. Versioned Secret Tokens. Here's how I fixed it.
Use dotenv in development and test environments:
# Gemfile
gem 'dotenv-rails', groups: [:development, :test]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#= require support/jasmine-given | |
class Geolocation | |
getCurrentPosition: -> | |
options = | |
maximumAge: 0 | |
timeout: 1*10*1000 | |
enableHighAccuracy: true | |
navigator.geolocation.getCurrentPosition(@success, @failure, options) |
When dealing with legacy data it's been pretty common to run into malformed / illegal byte sequences in files. Figuring out what's causing the issue is often really difficult, especially when the file has thousands of rows.
Here's a trick I pretty much stumpbled upon:
nl file.txt | sort
sort: string comparison failed: Illegal byte sequence
sort: Set LC_ALL='C' to work around the problem.
When running specs I often see this output before the specs start to run.
> rspec spec
Time: 0.288 ms
Time: 0.110 ms
Time: 0.084 ms
Time: 0.095 ms
Time: 0.105 ms
Time: 0.115 ms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# A Ruby HTTP Client Library | |
# https://github.com/jnunemaker/httparty | |
require 'httparty' | |
## | |
# "Getting Started" ServeManager API Client | |
# | |
# Our API is accessible from any language, of course. Hopefully a concrete | |
# working code example helps you get the basics built in the language of your |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<a href="http://www.mysite.com/">Home</a><!-- Why?! --> | |
<a href="/">Home</a><!-- How is this not the default?! --> | |
</body> | |
</html> |
OlderNewer