Skip to content

Instantly share code, notes, and snippets.

View pootsbook's full-sized avatar

Philip Poots pootsbook

  • ClubCollect
  • Alphen aan den Rijn, NL
View GitHub Profile
@pootsbook
pootsbook / stripe_account.rb
Last active August 29, 2015 14:17
A Hash of the Stripe::Account attributes for Connect managed accounts (26 Mar 15)
stripe_account = {
country: 'US',
display_name: 'string',
email: 'string',
business_name: 'string',
business_url: 'string',
managed: true,
bank_account: 'stripe.js token',
legal_entity: {
address: {
@pootsbook
pootsbook / ember-uploader-env
Last active August 29, 2015 14:13
Install environment for ember-uploader
# Install Node.js
# https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager
$ curl -sL https://deb.nodesource.com/setup | sudo bash -
$ sudo apt-get install nodejs
$ npm install -g phantomjs
$ npm install -g bower
$ npm install -g ember-cli
$ npm install
# Solve cache issue "Cannot find module"
@pootsbook
pootsbook / account_creation.rb
Last active August 29, 2015 14:13
Balanced ACH Account Creation
# gem 'balanced', '1.2.1'
# BalancedPayments API v1.1
# ACH Payments only
# Three parties: marketplace (you), merchant (Balanced::Customer), buyer (Balanced::Customer)
bank_account_href = "" # from balanced.js
bank_account = Balanced::BankAccount.fetch(bank_href)
# it seems a customer requires dob_month, dob_year & address.postal_code in order to be verified
# cf. https://docs.balancedpayments.com/1.1/overview/resources/#customer-identity-verification
@pootsbook
pootsbook / gist:229d5264390d1849c7e9
Created December 22, 2014 09:28
output of fsck_hfs
Philips-MacBook-Pro:~ pootsbook$ sudo fsck_hfs -r -d /dev/disk1s1
Password:
journal_replay(/dev/disk1s1) returned 0
** /dev/rdisk1s1 (NO WRITE)
Using cacheBlockSize=32K cacheTotalBlock=65536 cacheSize=2097152K.
Executing fsck_hfs (version hfs-226.1.1).
Block 2 is not an MDB or Volume Header
Block 1953525164 is not an MDB or Volume Header
volumeType is 0
0000: eb58 9042 5344 2020 342e 3400 0240 2000 |.X.BSD..4.4.....|
@pootsbook
pootsbook / jekyll_sort.rb
Created August 13, 2014 14:21
Sorting custom collections in Jekyll
# Two files, default sort order is alphabetical ascending on file name.
# _config.yml
collections:
albums:
output: true
# _albums/audio_video_disco.md
---
@pootsbook
pootsbook / url.rb
Created October 12, 2013 19:14
URL
class Url
attr_reader :url
def initialize(url)
raise(ArgumentError, "url not specified") unless url
@url = url
end
def to_uri
URI.parse(url)
@pootsbook
pootsbook / gist:6548972
Last active December 22, 2015 23:49
Sass-Rails Asset Helpers
asset-path($relative-asset-path, $asset-class)
asset-path("rails.png", image) => "/assets/rails.png"
image-path($relative-asset-path)
font-path($relative-asset-path)
video-path($relative-asset-path)
audio-path($relative-asset-path)
javascript-path($relative-asset-path)
stylesheet-path($relative-asset-path)
@pootsbook
pootsbook / gist:6220792
Created August 13, 2013 12:53
Assets Performance in Rails
# Rails Asssets Configuration
http://upstre.am/blog/2011/10/http-caching-assets-in-rails-3-1/
# EngineYard Asset Tips
https://support.cloud.engineyard.com/entries/21009802-Rails-3-1-Asset-Pipeline-Tips
# Cloudinary Static Assets
http://cloudinary.com/blog/how_to_deliver_your_static_images_through_a_cdn_in_ruby_on_rails