Skip to content

Instantly share code, notes, and snippets.

View lporras's full-sized avatar
🏠
Working from home

Luis Alfredo Porras Páez lporras

🏠
Working from home
View GitHub Profile
@lporras
lporras / ocr.rb
Created October 3, 2016 14:54 — forked from jyunderwood/ocr.rb
require 'base64'
require 'open-uri'
require 'net/http'
require 'net/https'
require 'json'
class OCR
attr_reader :api_key, :image_url
def self.scan(api_key:, image_url:)
@lporras
lporras / test
Created September 7, 2016 22:10
test malo
it 'renders the receiver email' do
expect(mail.to).to eq(visit.email_recipients)
end
@lporras
lporras / pokemons.js
Created August 25, 2016 18:45 — forked from coldcue/pokemons.js
Pokemons
[{id:1,name:'Bulbasaur'},
{id:2,name:'Ivysaur'},
{id:3,name:'Venusaur'},
{id:4,name:'Charmander'},
{id:5,name:'Charmeleon'},
{id:6,name:'Charizard'},
{id:7,name:'Squirtle'},
{id:8,name:'Wartortle'},
{id:9,name:'Blastoise'},
{id:10,name:'Caterpie'},
import React from "react";
import { render } from "react-dom";
const ParentComponent = React.createClass({
getDefaultProps: function() {
console.log("ParentComponent - getDefaultProps");
},
getInitialState: function() {
console.log("ParentComponent - getInitialState");
return { text: "" };
@lporras
lporras / git bash prompt
Created June 1, 2016 01:24 — forked from hintjens/git bash prompt
git bash prompt, by Pieter Hintjens
export PROMPT_COMMAND=__git_prompt
__git_prompt ()
{
txtblk='\e[0;30m' # Black - Regular
txtred='\e[0;31m' # Red
txtgrn='\e[0;32m' # Green
txtylw='\e[0;33m' # Yellow
txtblu='\e[0;34m' # Blue
txtpur='\e[0;35m' # Purple
txtcyn='\e[0;36m' # Cyan
@lporras
lporras / .vimrc
Created October 22, 2015 21:02 — forked from gosukiwi/.vimrc
.vimrc
" ---------------------- USABILITY CONFIGURATION ----------------------
" Basic and pretty much needed settings to provide a solid base for
" source code editting
" don't make vim compatible with vi
set nocompatible
" turn on syntax highlighting
syntax on
" and show line numbers
@lporras
lporras / backbone-validation-bootstrap.js.coffee
Created September 27, 2015 23:50 — forked from driehle/backbone-validation-bootstrap.js.coffee
Render error messages of Backbone.Validation for Twitter Bootstrap
# --------------------------------------------
# This code is for Twitter Bootstrap 2!
# --------------------------------------------
#
# The MIT License (MIT)
# Copyright (c) 2012-2015 Dennis Riehle
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@lporras
lporras / bootstrap_errors.rb
Created September 27, 2015 23:22
Rails bootstrap error forms Initializer
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
html = %(<div class="field_with_errors">#{html_tag}</div>).html_safe
# add nokogiri gem to Gemfile
form_fields = [
'textarea',
'input',
'select'
]
@lporras
lporras / Rack Basics.md
Last active August 29, 2015 14:27
Rack Basics

Rack Basics

Objective

Understand Rack, an essential component of Rails.

Rack

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew install rbenv ruby-build
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
rbenv install 2.2.2
rbenv global 2.2.2