First create a Ubuntu 13.04 x64 droplet on DigitalOcean Control Panel
Then ssh with root account, run this in termianl:
$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash| import sys | |
| from PIL import Image, ImageDraw | |
| try: | |
| import cv | |
| except ImportError: | |
| print 'Could not import cv, trying opencv' | |
| import opencv.cv as cv |
| import re | |
| import logbook | |
| from pprint import pprint | |
| import time | |
| import sys | |
| import threading | |
| import Queue | |
| import multiprocessing |
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.
| module Rubinius | |
| class CompiledMethod | |
| def _dump(depth) | |
| Marshal.dump([@scope, Rubinius::CompiledFile::Marshal.new.marshal(self)]) | |
| end | |
| def self._load(string) | |
| scope, dump = Marshal.load(string) | |
| cm = Rubinius::CompiledFile::Marshal.new.unmarshal(dump) | |
| cm.scope = scope |
| # hopefully a temporary patch so HireFire will run on the Heroku Cedar stack | |
| # NB: the worker type is hard-coded as "worker" below, this must correlate to the type in Procfile | |
| # NB: ENV['APP_NAME'] must be defined (e.g. 'heroku config:add APP_NAME=myherokuappname') | |
| # using ps & ps_scale instead of info & set_workers | |
| class HireFire::Environment::Heroku | |
| private | |
| def workers(amount = nil) |
| # autoload concerns | |
| module YourApp | |
| class Application < Rails::Application | |
| config.autoload_paths += %W( | |
| #{config.root}/app/controllers/concerns | |
| #{config.root}/app/models/concerns | |
| ) | |
| end | |
| end |
| #!/usr/bin/env ruby | |
| ignore_patterns = ["db/","test","log","reports","server","vendor/","Gemfile","tmp",".idea","config/",".DS_Store", ".xml", '.zip'] | |
| ignore_statuses = ['!','D','?'] | |
| changed_files = (`svn status`).split("\n").collect do |e| | |
| p = e.split(/\s+/) | |
| ignore_statuses.include?(p[0]) ? nil : p[p.size - 1] | |
| end.compact |
| # 523 : ~/Projects/runfatboy2 $ rails runner ~/factories_from_db.rb Exercise 1 2 3 | |
| # | |
| # Factory.define :exercise_incline press do |r| | |
| # r.name 'Incline Press' | |
| # r.url 'http://video.google.com/googleplayer.swf?docId=-5762262560903802111&hl=en' | |
| # r.verb 'Lift' | |
| # r.measurement_type_id 3 | |
| # r.exercise_type_id 1 | |
| # r.user_id 2 | |
| # r.start_weight 0.8 |