“A Circuit Court judge has ruled that a criminal defendant can be compelled to give up his fingerprint, but not his pass code, to allow police to open and search his cellphone.”
“Officers tried to clear the streets and re-establish order in the face of chaos. But now a video emerges that shows who the real hero was: an everywoman pleading for our god-given right to get to our ride-sharing car.”
“We pave the sunlit path toward justice together, brick by brick. This is my brick.”
Here’s my take on the U2 thing: It’s not that I don’t like music. It’s not that I don’t like free things. I even like a couple of U2 songs.
It’s that my various document libraries, and especially my iTunes library, are sacred. You DO NOT touch them. If I entrust them to your cloud service, you double-triple especially DO NOT touch them.
This “free gift” could have just as easily been issued as a redemption code, and nobody would have minded. Instead it was pushed into everyone’s library apparently just so the band could brag about having the most widely-“owned” album of all time. It had that layer of marketing slime on it that most Apple promotions do not. THAT’S what made it so upsetting to me.
“When you rode a horse, we simply put the horse inside the player, and spawned a pair of pants that looked like your horse, which you then equipped and wore.
When we first did this, however, we forgot to make the horse stop acting like a horse. Pretty soon there was a rash of server crashes because the horse inside the player was wandering around, picking up the stuff it found inside the player, rifling through the player’s backpack and eating things it thought were edible”
“Dossier” is an open-source proof-of-concept of an idea I have been exploring recently, best described as “structured notes” or “database meets wiki”.
At the moment what I have is about two hours worth of hurriedly slapped-together PHP, but I think it demonstrates that the idea has some merit.
Conceptually, it’s similar to a relational database, except each record can have any number of fields, and they do not have to be the same fields from record to record. You can even repeat fields on a single record. (Say, for a example if you have a record of a person who has been married multiple times, you could just repeat the “Spouse” property on that record.)
Like a wiki, you do not have to worry about manually creating links between records. Those will be discovered for you automatically based on properties and property values.
I doubt that the idea is completely original, but after much searching, I’ve not found anything that implements it this particular way, and certainly not so simply.
I hope it is interesting to other info-nerds. There are plenty of feature possibilities up for grabs if you want to fork and contribute such as: user accounts, authentication, write access to the database, improved design, and so on.
“LifeLock CEO Todd Davis, whose [social security] number is displayed in the company’s ubiquitous advertisements, has [...] been a victim of identity theft at least 13 times, according to the Phoenix New Times.”
“Over the course of one weekend, the organizers took $17,000 from conventiongoers as part of an emergency fundraising drive, failed to pay any of their high-profile guests, and attempted to compensate disappointed ticket-holders by offering them an ‘extra’ hour in a children’s ball pit.”
“One of the most common complaints on review sites against us and many restaurants in the area is that the service was slow and or they needed to wait a bit long for a table.
Given in most cases the customers are constantly busy on their phones it took an average of 20 minutes more from when they were done eating until they requested a check. Furthermore once the check was delivered it took 15 minutes longer than 10 years ago for them to pay and leave.”
(Take this with a grain of salt, since the source is an anonymous Craigslist posting, and the “finding a surveillance tape from 2005″ strains belief.)
I spent hours today trying different ways of quickly and reproducibly provisioning a Mac for Rails + Postgresql development that could be deployed to Heroku. What follows is, believe it or not, the easiest method I came up with.
This is a cheatsheet, not a tutorial. I’m not going into much depth on what each command does, but if you’re just looking for a list of commands to get running quickly, you’re at the right place.
I tested these instructions against a stock installation of OS X Mavericks 10.9 in VMWare Fusion that had been patched up to 10.9.4 with Software Update. Mavericks 10.9.4 ships with ruby 2.0.0p451.
This cheatsheet was compiled with information from https://devcenter.heroku.com/articles/getting-started-with-rails4 and other sources.
• First, create an account on Heroku, if you don’t have one already.
• Trigger the OS to install Developer Tools if you don’t already have them:
$ git (Click Install) (Agree to license agreement)
Installing just the Developer Tools is faster than installing Xcode if you don’t have/need it.
• Visit this page in Safari:
• Click “Download Heroku Toolbelt for Mac OS X” and run the installer pkg file that it downloads.
• Install Homebrew:
$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" $ brew doctor
• Log in to Heroku:
$ heroku login (Enter Heroku email) (Enter Heroku password)
• Install postgresql:
$ brew install postgresql
• Install pg (postgresql) gem:
$ sudo ARCHFLAGS="-arch x86_64" gem install pg
• Start postgresql:
$ postgres -D /usr/local/var/postgres &
• Install Bundler:
$ sudo gem install bundler
• Install Rails:
$ sudo gem install rails --no-ri --no-rdoc (When warned about conflicting rails executable, allow overwrite)
• Create a new postgresql-backed Rails app:
$ rails new myapp -d postgresql
• Create a barebones ‘welcome’ route in the app:
$ cd myapp $ rails generate controller welcome
• Create app/views/welcome/index.html/erb with the editor of your choice, and insert the following content:
<h2>Hello World</h2> <p> The time is now: <%= Time.now %> </p>
• Edit config/routes.rb and uncomment this line:
• Add this line to the end of Gemfile:
gem 'rails_12factor', group: :production
• Run Bundler to get the rails_12factor gem installed (required by Heroku):
$ bundle install
• Create a default database named after your username (a convenience for if you want to use a postgresql GUI like PG Commander later):
• Create dev and test databases for the Rails app:
$ createdb myapp_development $ createdb myapp_test
• Edit config/database.yml and change the “production” section at the bottom to read like this:
production: url: <%= ENV['DATABASE_URL'] %>
Delete the database, username, and password lines from this section. You can delete the line that begins with << too.
• At this point you should be able to run the app locally on the built-in server:
$ rails server (visit url http://localhost:3000/) (^C to stop the server)
• Create a git repo for the project:
$ git init $ git add . $ git commit -m "init"
• Create a Heroku app:
$ heroku create
Heroku will automatically assign your app a name consisting of a couple of words and a number.
• If you already have an SSH keypair, you can upload the public key through the Heroku dashboard, then, on your Mac, use ssh-add to make the private key available to ssh-agent.
If you don’t already have an SSH keypair, or would rather use a new one, let Heroku generate one:
$ heroku keys:add (it asks if you want to generate one, say yes)
• Push git repository to Heroku:
$ git push heroku master (if you get a warning that the authenticity of the host cannot be established, enter yes to continue)
• Confirm your app is now running on Heroku:
$ heroku open
At this point, Heroku is running the app on webrick, which is not suitable for production.
• To switch to the unicorn web server, add this line to the end of Gemfile:
$ bundle install
• Create config/unicorn.rb with the following content (watch out for word-wrapping on the blog here):
worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3) timeout 15 preload_app true before_fork do |server, worker| Signal.trap 'TERM' do puts 'Unicorn master intercepting TERM and sending myself QUIT instead' Process.kill 'QUIT', Process.pid end defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect! end after_fork do |server, worker| Signal.trap 'TERM' do puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT' end defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection end
• Inform Heroku that you wish to use unicorn by creating a file called Procfile with this content:
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
• To test with the unicorn server locally, install Foreman:
$ sudo gem install foreman (answer yes if it asks if you want to overwrite the existing executable)
• You can now start the unicorn web server with:
$ foreman start
Note that unicorn runs by default on port 5000 instead of webrick’s port 3000, so to test, visit http://localhost:5000/
• Stop unicorn with ^C.
• Commit changes to git repo:
$ git add . $ git commit -m "added unicorn"
• Deploy to Heroku again:
$ git push heroku master
• Verify that Heroku is still serving a working app:
$ heroku open
• If you’d like extra confirmation that the app is now running atop unicorn, the server log should show something that looks like unicorn output:
$ heroku logs
And it’s just THAT EASY. ;)