Skip to content

Instantly share code, notes, and snippets.

Luis Borjas Reyes lfborjas

Block or report user

Report or block lfborjas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
lfborjas / mens.sql
Last active Nov 14, 2015
Flipping: M Nov 2015
View mens.sql
(rebillable_id int(10) unsigned,
bh_id int(10) unsigned,
billing_frequency tinyint(3) unsigned,
prev_cycle_status int(10) unsigned,
unique index (rebillable_id),
unique index (bh_id));
INSERT INTO boxes_to_restore (rebillable_id, bh_id, billing_frequency, prev_cycle_status)
SELECT rs.rebillable_id as rebillable_id, as bh_id, rs.billing_frequency as billing_frequency, COALESCE(SUM(ctl.result='success')*100 - SUM(ctl.result='failure'),0) as prev_cycle_status
View luis.vim
syntax on
autocmd Filetype html setlocal ts=2 sw=2 expandtab
autocmd Filetype ruby setlocal ts=2 sw=2 expandtab
autocmd Filetype javascript setlocal ts=2 sw=2 expandtab
autocmd Filetype cucumber setlocal ts=2 sw=2 expandtab
set noswapfile
au BufRead,BufNewFile *.md set filetype=markdown
au BufRead,BufNewFile *.md.html set filetype=markdown
View ejemplo.js
function activarFormulario(){
var form = document.querySelector("form");
form.addEventListener("submit", function(event) {
var r = document.getElementById("result");
var n = document.getElementById("GET-nombre");
r.textContent = n.value;
View composition.rb
class Dog < Animal
def pet
def dog_petter
lfborjas / application.rb
Created Jul 31, 2013
inspect the rack env before it hits the rails app
View application.rb
config.middleware.use "Peekaboo"
lfborjas / Gemfile
Last active Dec 15, 2015
prueba de concepto de app
View Gemfile
gem 'sinatra'
gem 'rest-client'
gem 'json' #probablemente innecesaria
lfborjas / fake_endpoints.rb
Created Mar 18, 2013
Serves a rack app based on paths/responses defined in a cucumber feature
View fake_endpoints.rb
require 'gherkin/parser/parser'
require 'gherkin/formatter/json_formatter'
#This is intended to be mounted on top of a rails app with
#mount FakeEndpoints => "/fake_api"
#this allows clients to play around with an intended implementation of the API without it being actually coded at all
#the features look like
# Given I GET /an/endpoint; Then the JSON response is:
class FakeEndpoints
def initialize
@routes = gather_routes
View ugh.rb
1 0
1 0 0
o d
e v n
]).map{ |(to, fro)|
#{to}.upto(9) do |#{fro}|
View fun.js
//The fun solution: using array methods
var ary = [];
for(var i = 1; i <= 1000; i++){ ary.push(i); }
return (item % 3 == 0 || item % 5 == 0)
}).reduce(function(memo, current){
return memo + current
}, 0)
View yodawg.html
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript" charset="utf-8">
Google HTML5 slides template
Authors: Luke Mahé (code)
You can’t perform that action at this time.