Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / ways_to_use_vcr.rb
Created February 19, 2016 21:27 — forked from myronmarston/ways_to_use_vcr.rb
Ways to use VCR for a request made by a let block
# 1) Use VCR.use_cassette in your let block. This will use
# the cassette just for requests made by creating bar, not
# for anything else in your test.
let(:foo) { VCR.use_cassette("foo") { create(:bar) } }
it "uses foo" do
foo
end
# 2) Wrap the it block that uses #foo in VCR.use_cassette.
"{\"status\":500,\"body\":\"\\n\\u003c!DOCTYPE html\\u003e\\n\\u003c!--[if lt IE 7 ]\\u003e \\u003chtml lang=\\\"en\\\" class=\\\"no-js ie6\\\"\\u003e \\u003c![endif]--\\u003e\\n\\u003c!--[if IE 7 ]\\u003e \\u003chtml lang=\\\"en\\\" class=\\\"no-js ie7\\\"\\u003e \\u003c![endif]--\\u003e\\n\\u003c!--[if IE 8 ]\\u003e \\u003chtml lang=\\\"en\\\" class=\\\"no-js ie8\\\"\\u003e \\u003c![endif]--\\u003e\\n\\u003c!--[if IE 9 ]\\u003e \\u003chtml lang=\\\"en\\\" class=\\\"no-js ie9\\\"\\u003e \\u003c![endif]--\\u003e\\n\\u003c!--[if (gt IE 9)|!(IE)]\\u003e\\u003c!--\\u003e \\u003chtml lang=\\\"en\\\" class=\\\"no-js\\\"\\u003e\\u003c!--\\u003c![endif]--\\u003e\\n\\u003chtml\\u003e\\n\\u003chead\\u003e\\n \\u003ctitle\\u003eError\\u003c/title\\u003e\\n \\u003cmeta charset=\\\"utf-8\\\"\\u003e\\n \\u003cmeta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=UTF-8\\\"\\u003e\\n \\u003cmeta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=edge,chrome=1\\\"\\u003e\\n \\u003cmeta na
@MrCoffey
MrCoffey / generateDFP.js
Last active February 3, 2016 22:46
Codigo de credibanco para Generar FingerPrint
var InvocarDFP, initDFP;
InvocarDFP = function(e, t, n) {
var a, f, l, o, str, u;
console.log('https://h.online-metrix.net/fp/clear.png?org_id=' + n + '&session_id=' + t + e + '&m=1');
o = document.createElement('p');
str = 'background:url(\'https://h.online-metrix.net/fp/clear.png?org_id=\'' + n + '&session_id=' + t + e + '&m=1)';
o.styleSheets = str;
o.height = '0';
o.width = '0';
@MrCoffey
MrCoffey / gist:3a6fe552364a2bab9c95
Created January 24, 2016 16:54 — forked from learncodeacademy/gist:5850f394342a5bfdbfa4
SSH Basics - Getting started with Linux Server Administration

###SSH into a remote machine###

ssh [email protected]
#or by ip address
ssh [email protected]

exit: exit ###Install Something###

#If it's a new server, update apt-get first thing
@MrCoffey
MrCoffey / deployment.md
Last active September 20, 2015 19:38
Descripcion de como hacer el deploy en servidores remotos

Guia de deployment

`cd /home/toor/apps/sercappital-odd/releases/20150920183427

Paso 1 - Conexion al servidor remoto

La conexion debe efectuarse, via SSH proveida por el administrador del servidor, por medio del siguiente comando.

  $ ssh -i ruta_a_la_llave -p puerto usuario@ip
@MrCoffey
MrCoffey / product-hunter.coffee
Created August 27, 2015 20:25
Product hunter
Slack = require('slack-node')
os = require('os')
jsonHttp = require('json-http')
#Slack stuff
webhookUri = 'https://hooks.slack.com/services/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'
slack = new Slack
slack.setWebhook webhookUri
#Kimono uri
CREATE TABLE IF NOT EXISTS `mydb`.`galleta` (
`id` INT NOT NULL COMMENT '',
`name` VARCHAR(45) NULL COMMENT '',
`price` VARCHAR(45) NULL COMMENT '',
PRIMARY KEY (`id`) COMMENT '')
ENGINE = InnoDB
CREATE TABLE IF NOT EXISTS `mydb`.`venta` (
`id` INT NOT NULL COMMENT '',
`total` VARCHAR(45) NULL COMMENT '',