Skip to content

Instantly share code, notes, and snippets.

View calvincorreli's full-sized avatar

Calvin Correli calvincorreli

View GitHub Profile
{% include 'section_style' %}
{% capture large_size_class %}{% if section.settings.columns == '2' %}half{% elsif section.settings.columns == '3' %}third{% elsif section.settings.columns == '4' %}quarter{% else %}fifth{% endif %}{% endcapture %}
{% include 'opening_section_tag', section_type: 'features' %}
<div class="wrapper wrapper--padded">
{% include 'section_header_text' %}
<div class="grid grid--margins">
{% for block in section.blocks %}
@calvincorreli
calvincorreli / bluesmart.md
Last active July 13, 2016 13:16
Bluesmart suitcase feedback
  • I don't trust the lock via the app, so I keep the key in the front pocket of the suitcase, defeating the purpose of the lock. Why? What if the suitcase is dead becasue I forgot to charge it? Also, I've often experienced that the app doesn't connect with the suitcase, or takes a long time to connect. Then what? I don't have the patience to wait for that.

  • Right now: Suitcase has been charging overnight, is plugged in, I press the button behind the handle, nothing happens, the app is still searching for the app and can't connect. I can't risk this in a situation where I'm stuck at the airport. Maybe my suitcase is just broken?

  • Closing the suitcase is finicky. You have to close it at exactly the right angle for it to work.

  • Getting my 15" MacBook Pro down in the laptop holder is often problematic. The sides are too soft, I have to hold out one side while I put it down, or it catches one side and won't go in.

  • It cause problems in Copenhagen airport. They needed to call in a supervisor to make sure it

Keybase proof

I hereby claim:

  • I am calvincorreli on github.
  • I am calvincorreli (https://keybase.io/calvincorreli) on keybase.
  • I have a public key ASBnKrZ3pSonmmTeqYIHewYlHVvHsH7at2ia7ujr3Af2hwo

To claim this, I am signing this object:

@calvincorreli
calvincorreli / kill-adobe-updater.sh
Created July 17, 2014 20:46
Kill the stupid annoying Adobe updater icon in the menu bar
cd ~/Library/LaunchAgents
launchctl remove com.adobe.AAM.Scheduler-1.0
rm com.adobe.AAM.*
pkill "AAM Updates"
@calvincorreli
calvincorreli / post-commit
Created February 7, 2014 13:14
Improved it a bit, so it says what it's doing, and defaults to master when there's no branch-specific setting
#! /bin/zsh
branch_name=${$(git symbolic-ref HEAD)#refs/heads/}
function switch {
echo "Switching to database.yml.branch.${1}"
cp config/database.yml config/database.yml.branch.bak
cp config/database.yml.branch.${1} config/database.yml
}
@calvincorreli
calvincorreli / middleware.rb
Created March 19, 2013 05:31
Middleware to fix the problem with Sendgrid sending webhook POSTs with an incorrect application/json content type even though the content is actually a sequence of JSON structures separated by line breaks. Rails will try to parse the contents as a JSON document and fail. This middleware changes the content type to application/sendgrid-json, thus…
Billing::Application.configure do
config.middleware.insert_before "ActionDispatch::ParamsParser", SendgridWebhookMiddleware
end
@calvincorreli
calvincorreli / model.rb
Created October 17, 2012 01:20
Code to render a view from inside a model
def render_to_string
I18n.with_locale(locale) do
Renderer.render(
file: "purchase_mailer/invoice",
layout: nil,
assigns: { charge: self, purchase: purchase, product: product, account: account, payments: payments }
)
end
end
@calvincorreli
calvincorreli / pusher.js.coffee
Created October 14, 2012 14:52
Simple wrapper library for Pusher with the ability to replay recent events (< 2 minutes ago)
class window.ZenPusher
@pusher: null
@channel: []
constructor: ->
setupPusher: _.once ->
@pusher = new Pusher($('body').data('pusher-key'))
channel: (channel) ->
@calvincorreli
calvincorreli / spreedly-core-api.txt
Created September 4, 2012 13:48 — forked from ntalbott/spreedly-core-api.txt
Overview of Spreedly Core API endpoints
OPTIONS https://spreedlycore.com/v1/gateways.xml => list supported gateways
POST https://spreedlycore.com/v1/gateways.xml => add a gateway
GET https://spreedlycore.com/v1/gateways.xml => list all added gateways
PUT https://spreedlycore.com/v1/gateways/token.xml => Update gateway
PUT https://spreedlycore.com/v1/gateways/token/redact.xml => Remove sensitive gateway data
POST https://spreedlycore.com/v1/gateways/token/purchase.xml => purchase - supply a payment method token also
POST https://spreedlycore.com/v1/gateways/token/authorize.xml => authorize - supply a payment method token also
POST https://spreedlycore.com/v1/payment_methods => Capture credit card from form - transparent redirect magic
GET https://spreedlycore.com/v1/payment_methods.xml => list all retained credit cards
@calvincorreli
calvincorreli / spreedly-core-api.txt
Created September 2, 2012 02:18
Overview of Spreedly Core API endpoints
OPTIONS https://spreedlycore.com/v1/gateways.xml => list supported gateways
POST https://spreedlycore.com/v1/gateways.xml => add a gateway
GET https://spreedlycore.com/v1/gateways.xml => list all added gateways
POST https://spreedlycore.com/v1/gateways/token/purchase.xml => purchase - supply a payment method token also
POST https://spreedlycore.com/v1/gateways/token/authorize.xml => authorize - supply a payment method token also
POST https://spreedlycore.com/v1/payment_methods => Capture credit card from form - transparent redirect magic
GET https://spreedlycore.com/v1/payment_methods.xml => list all retained credit cards
POST https://spreedlycore.com/v1/payment_methods/token/retain.xml => Store credit card info
POST https://spreedlycore.com/v1/payment_methods/token/redact.xml => Remove credit card info