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
# Geocode a postcode & find councils/wards via uk-postcodes.com API | |
require 'rubygems' | |
require 'json' | |
require 'rest_client' | |
require 'pp' | |
postcode = "SW1A 0AA" | |
endpoint = "http://www.uk-postcodes.com/postcode/" |
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
==> dyno-1482316-crashlog.log <== | |
BigDecimal is deprecated, use Decimal instead at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' | |
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- postgres_adapter (LoadError) | |
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' | |
from /home/slugs/204849_09fa171_a1c7/mnt/.gems/gems/dm-core-1.0.0/lib/dm-core/adapters.rb:165:in `load_adapter' | |
from /home/slugs/204849_09fa171_a1c7/mnt/.gems/gems/dm-core-1.0.0/lib/dm-core/adapters.rb:133:in `adapter_class' | |
from /home/slugs/204849_09fa171_a1c7/mnt/.gems/gems/dm-core-1.0.0/lib/dm-core/adapters.rb:13:in `new' | |
from /home/slugs/204849_09fa171_a1c7/mnt/.gems/gems/dm-core-1.0.0/lib/dm-core.rb:257:in `setup' | |
from ./lib/models.rb:90 | |
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' |
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
<?php | |
/* | |
SutMobLib API server-side example | |
by Adrian Short [email protected] | |
6 March 2010 | |
There are four possible outcomes of the API call: | |
1. The library is not running today due to an "exception", eg. a bank holiday. The API returns the reason for this exception in $result->exception. | |
2. The library is visiting various housebound readers at home. This is on the schedule so the times of this activity are specified but the location is not. |
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
$ sudo gem install mysql | |
Password: | |
Building native extensions. This could take a while... | |
ERROR: Error installing mysql: | |
ERROR: Failed to build gem native extension. | |
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb | |
extconf.rb:4: warning: Insecure world writable dir /usr/local/git in PATH, mode 040777 | |
extconf.rb:4: warning: Insecure world writable dir /usr/local/git in PATH, mode 040777 | |
extconf.rb:7: warning: Insecure world writable dir /usr/local/git in PATH, mode 040777 |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
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
9780006281436 | |
9780006281443 | |
9780006499152 | |
9780006499480 | |
9780006532286 | |
9780006547747 | |
9780006547754 | |
9780007117536 | |
9780007134724 | |
9780007139842 |
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
- @last_date = '' | |
- @results.each do |row| | |
- if row.election_d != @last_date | |
- @last_date = row.election_d | |
%h2= row.election_d | |
%table | |
%tr |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'json' | |
require 'httpclient' | |
require 'uri' | |
require 'time' | |
def backup(query, since_id = nil) |
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
Computer literacy is a very misleading term. Generally it means learning to use a computer, that is, learning to use programs that other people have written for computers. But if we take the analogy with literacy seriously, computer literacy is learning to read but not learning to write. Real computer literacy means learning to write our own programs as well as to use other people's. Programmability is the definition of a computer, a device that can be taught to do different things, one that's malleable rather than rigid. | |
Yet we have millions of people, intelligent people, skilful people, ambitious people, spending hundreds of hours a year sitting in front of these immensely powerful machines whether at home or at work, and all they can do with them is use them to run software that other people have created. Software that reflects the values and imperatives of the people who made that software which don't necessarily coincide with the desires of the people who use it. That's a waste of the equipment in front |
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
class Post | |
include MongoMapper::Document | |
key :title, String | |
key :url, String | |
key :author, String | |
key :summary, String | |
key :content, String | |
key :published, Time | |
key :loc, Hash # { lng, lat } |
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
$ gem install bson_ext | |
Building native extensions. This could take a while... | |
ERROR: Error installing bson_ext: | |
ERROR: Failed to build gem native extension. | |
/Users/adrian/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb | |
checking for asprintf()... *** extconf.rb failed *** | |
Could not create Makefile due to some reason, probably lack of | |
necessary libraries and/or headers. Check the mkmf.log file for more | |
details. You may need configuration options. |
OlderNewer