Skip to content

Instantly share code, notes, and snippets.

@MrCoffey
MrCoffey / gist:87a7a07347cd28a8ab6e
Created February 22, 2016 21:26 — forked from hpjaj/gist:ef5ba70a938a963332d0
RSpec - List of available Expectation Matchers - from Lynda.com course 'RSpec Testing Framework with Ruby'
## From Lynda.com course 'RSpec Testing Framework with Ruby'
describe 'Expectation Matchers' do
describe 'equivalence matchers' do
it 'will match loose equality with #eq' do
a = "2 cats"
b = "2 cats"
expect(a).to eq(b)
@MrCoffey
MrCoffey / Preferences.json
Created March 8, 2016 15:26
Sublime text configuration example, it should be placed at preferences > Settings-user
{
"always_prompt_for_file_reload": false,
"always_show_minimap_viewport": true,
"animation_enabled": true,
"atomic_save": true,
"auto_close_tags": true,
"auto_complete": true,
"auto_complete_commit_on_tab": false,
"auto_complete_delay": 50,
"auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin",
@MrCoffey
MrCoffey / 0000_packages.config
Created March 28, 2016 18:19 — forked from gcarrion-gfrmedia/0000_packages.config
AWS Elastic Beanstalk Ruby 2.0/Puma Environment - .ebextensions tweaks and Sidekiq configuration. This is known to work fine with AWS Elastic Beanstalk 's 64bit Amazon Linux 2014.03 v1.0.1 running Ruby 2.0 (Puma) stack. Later stack versions might not work, but for that specific version works fine.
# Install Git needed for Git based gems
packages:
yum:
git: []
@MrCoffey
MrCoffey / sidekiq.config
Last active April 4, 2016 21:04 — forked from RobertoSchneiders/sidekiq.config
Sidekiq Config for Elastic Beanstalk
# Sidekiq interaction and startup script
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_sidekiq.sh":
mode: "000755"
content: |
#!/bin/bash
. /opt/elasticbeanstalk/hooks/common.sh
. /opt/elasticbeanstalk/support/envvars
@MrCoffey
MrCoffey / create_tpaga_customer.php
Created May 25, 2016 19:55
Basic example of customer creation using PHP
<?php
// Get cURL resource
$ch = curl_init();
// Set url
curl_setopt($ch, CURLOPT_URL, 'https://sandbox.tpaga.co/api/customer');
// Set method
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
@MrCoffey
MrCoffey / ExampleTpagaCustomer.java
Created May 26, 2016 21:20
Tpaga Card Tokenize
import java.io.IOException;
import org.apache.http.client.fluent.*;
import org.apache.http.entity.ContentType;
public class SendRequest
{
public static void main(String[] args) {
sendRequest();
}
@MrCoffey
MrCoffey / upgrate_button.html
Created May 31, 2016 16:07
Suscription 80000
<form method="post" action="https://webcheckout.tpaga.co/checkout" accept-charset="UTF-8">
<input type="image" value="Pagar" style="width:200px; border: 0 none; border-radius: 24px; padding: 12px 12px; margin: 9px; cursor: pointer; display: flex; justify-content: center; align-items: center; flex: 0 0 160px; text-align: center; line-height: 1.3; font-size: 1em; color: #fff; text-transform: none; font-weight: 500; background: #4E1971;" onclick="this.form.urlOrigen.value = window.location.href;">
<input name="purchase[merchant_token]" value="⁠⁠⁠ij7uea3mqv5klkkp1822ukbqicl8ter4" type="hidden">
<input name="purchase[purchase_description]" value="Upgrade Suscripción Mensual" type="hidden">
<input name="purchase[purchase_amount]" value="80000" type="hidden">
<input name="purchase[purchase_tax]" value="12800" type="hidden">
<input name="purchase[purchase_currency]" value="COP" type="hidden">
<input name="purchase[purchase_order_id]" value="UPGRD01" type="hidden">
<input name="purch
@MrCoffey
MrCoffey / css-media-queries-cheat-sheet.css
Created June 13, 2016 23:06 — forked from bartholomej/css-media-queries-cheat-sheet.css
CSS Media Query Cheat Sheet (with Foundation)
/*------------------------------------------
Responsive Grid Media Queries - 1280, 1024, 768, 480
1280-1024 - desktop (default grid)
1024-768 - tablet landscape
768-480 - tablet
480-less - phone landscape & smaller
--------------------------------------------*/
@media all and (min-width: 1024px) and (max-width: 1280px) { }
@media all and (min-width: 768px) and (max-width: 1024px) { }
@MrCoffey
MrCoffey / refound.php
Created July 8, 2016 18:32
Ejemplo de como crear un reembolso con Tpaga
<?php
// Get cURL resource
$ch = curl_init();
// Set url
curl_setopt($ch, CURLOPT_URL, 'https://sandbox.tpaga.co/api/refund/credit_card');
// Set method
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* STYLES GO HERE */
}
/* Smartphones (landscape) ----------- */
@media only screen