A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
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.
| #config/initializers/carrierwave.rb | |
| CarrierWave.configure do |config| | |
| if Rails.env.production? or Rails.env.development? | |
| config.storage :cloud_files | |
| config.cloud_files_username = "your_username" | |
| config.cloud_files_api_key = "your_key" | |
| config.cloud_files_container = "test" | |
| config.cloud_files_cdn_host = "c0012345.cdnn.cloudfiles.rackspacecloud.com" | |
| def store_dir |
| // geo-location shim | |
| // currentely only serves lat/long | |
| // depends on jQuery | |
| // doublecheck the ClientLocation results because it may returning null results | |
| ;(function(geolocation){ | |
| if (geolocation) return; |