Hey!
I tried to make a video :): http://cloud.mikeasaur.us/2Y2I2x3h0O0v
As I write this, I'm realizing it's super confusing at first. So I hope this makes sense.
From a new terminal, I first start a new tmux session
tmux new -s mike
| require "httparty" | |
| # Retrieve your user id and api key from the Dashboard https://htmlcsstoimage.com/dashboard | |
| auth = { username: 'user_id', password: 'api_key' } | |
| html = "<div class='ping'>Pong ✅</div>" | |
| css = ".ping { padding: 20px; font-family: 'sans-serif'; }" | |
| image = HTTParty.post("https://hcti.io/v1/image", | |
| body: { html: html, css: css }, | |
| basic_auth: auth) |
| language: ruby | |
| rvm: | |
| - 2.4.1 | |
| env: | |
| - DB=postgresql | |
| script: | |
| - RAILS_ENV=test bundle exec rake --trace db:create | |
| - RAILS_ENV=test bundle exec rake --trace db:migrate | |
| - bundle exec rake db:test:prepare | |
| - bundle exec rspec |
| AllCops: | |
| Exclude: | |
| - db/**/* | |
| - Gemfile | |
| - vendor/**/* | |
| - config/environments/* | |
| - bin/**/* | |
| Rails: | |
| Enabled: true |
| email = Premailer::Rails::Hook.perform(YourMailer.some_email(blah_blah)) | |
| # get the body | |
| email.html_part.body.to_s | |
| # text | |
| email.text_part.body.to_s | |
| # usage: Set env variable IMGIX_API_KEY to your api key | |
| # Need to add httparty to your gemfile | |
| # | |
| # Cdn::Purge.cache.call('urlhere') | |
| class Cdn::PurgeCache | |
| include HTTParty | |
| API_KEY = ENV.fetch('IMGIX_API_KEY'.freeze) | |
| base_uri 'https://api.imgix.com/v2'.freeze | |
| class << self |
| language: ruby | |
| rvm: | |
| - 2.2.4 | |
| before_install: gem update --remote bundler | |
| install: | |
| - bundle install --retry=3 | |
| script: | |
| - bundle exec rspec | |
| - bundle exec rubocop --config .rubocop.yml | |
| services: "-postgresql" |
Hey!
I tried to make a video :): http://cloud.mikeasaur.us/2Y2I2x3h0O0v
As I write this, I'm realizing it's super confusing at first. So I hope this makes sense.
From a new terminal, I first start a new tmux session
tmux new -s mike
If you need to create a Stripe token for testing. Do this.
Stripe::Token.create(
:card => {
:number => "4242424242424242",
:exp_month => 9,
:exp_year => 2017,
:cvc => "314"
},| some_data = [{ type: 'dog', name: 'Fido' }, | |
| { type: 'dog', name: 'Ruby' }, | |
| { type: 'cat', name: 'Fuzzy' }] | |
| some_data.partition { |pet| pet[:type] == 'cat' } | |
| => [[{:type=>"cat", :name=>"Fuzzy"}], | |
| [{:type=>"dog", :name=>"Fido"}, {:type=>"dog", :name=>"Ruby"}]] | |
| require 'csv' | |
| require 'pry' | |
| orders = CSV.read('orders.csv', headers: true) | |
| output = open('output.csv', 'w') | |
| output.truncate(0) | |
| output.write("order_id, quantity, shipping_address\n") |