Skip to content

Instantly share code, notes, and snippets.

View gomayonqui's full-sized avatar

Jean Pierre gomayonqui

  • Medellin, Colombia
View GitHub Profile
@camilonova
camilonova / script.js
Last active June 4, 2016 22:53
Utilizando la sucursal virtual de bancolombia es frustrante tener que escribir la clave con el teclado virtual y ver esa alerta del navegador. Pega el contenido de este script en la consola del navegador para que puedas escribir la clave con el teclado. Ver en acción: http://giphy.com/gifs/l0K4hGF22s2AojfAA
function blockEnter(evt) {return true;}
function validarNoUsarTecladoReal_OnKeyPress(_object){return false;}
@tenderlove
tenderlove / h2_puma.rb
Last active August 14, 2024 06:10
Demo HTTP/2 server with Puma
require 'socket'
require 'openssl'
require 'puma/server'
require 'ds9'
class Server < DS9::Server
def initialize socket, app
@app = app
@read_streams = {}
@write_streams = {}
@pond
pond / gist:5eaec0c30c0b4477f234
Last active August 29, 2015 14:05
PostgreSQL "active?" Rails adapter check async patch
# This monkey patches the PostgreSQL adapter to use asynchronous
# communication when doing its "SELECT 1" check for is-connection-active.
# One symptom of this problem is stalled processing queues in Sidekiq.
# See also:
#
# https://github.com/rails/rails/issues/12867
#
# At the time of writing we have seen indefinite blocking down in the C
# library's "poll()" method due to the out-of-box Rails code using blocking
# I/O, in multithreaded environments - one thread gets stuck in the I/O and
@markbates
markbates / abstract_interfaces.rb
Last active December 27, 2015 23:08
Code and slides from my RubyConf 2013 talk, "Mangling Ruby with TracePoint". Slides: http://www.slideshare.net/markykang/mangling-ruby-withtracepoint
require 'singleton'
tracer = TracePoint.new(:end) do |tp|
ancestors = tp.self.ancestors.dup
ancestors.delete(tp.self)
missing_methods = []
ancestors.each do |ancestor|
methods = AbstractMethodManager.instance.methods[ancestor]
if methods
methods.each do |m|
@jaryl
jaryl / chosen.rb
Created February 6, 2012 08:56 — forked from thijsc/gist:1391107
Select item from chosen js select with Capybara-Webkit
def select_from_chosen(item_text, options)
field_id = find_field(options[:from])[:id]
within "##{field_id}_chzn" do
find('a.chzn-single').click
input = find("div.chzn-search input")
item_text.each_char do |char|
input.base.invoke('keypress', false, false, false, false, char.ord, nil);
end
find('ul.chzn-results').click
input.base.invoke('keypress', false, false, false, false, 40, nil); # down arrow
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt