Skip to content

Instantly share code, notes, and snippets.

View geronimod's full-sized avatar
🇦🇷
Working from home

Geronimo Diaz geronimod

🇦🇷
Working from home
View GitHub Profile
@geronimod
geronimod / zombie-issue.log
Created May 8, 2012 00:53
zombie issue loading google javascript
Zombie: GET https://apis.google.com/_/apps-static/_/js/gapi/gcm_ppb,googleapis_client,plusone/rt=j/ver=_EB9y0TbRG4.es./sv=1/am=!5VdQ9Ii80V-IH20oNg/d=1/rs=AItRSTMtiokHtiPDMBBIGo9wVqHzlhwnUQ/cb=gapi.loaded0 => 200
Zombie: Object #<Object> has no method 'U' TypeError: Object #<Object> has no method 'U'
at Object.U (/_/apps-static/_/js/gapi/gcm_ppb,googleapis_client,plusone/rt=j/ver=_EB9y0TbRG4.es./sv=1/am=!5VdQ9Ii80V-IH20oNg/d=1/rs=AItRSTMtiokHtiPDMBBIGo9wVqHzlhwnUQ/cb=gapi.loaded0:212:106)
at Object.<anonymous> (/_/apps-static/_/js/gapi/gcm_ppb,googleapis_client,plusone/rt=j/ver=_EB9y0TbRG4.es./sv=1/am=!5VdQ9Ii80V-IH20oNg/d=1/rs=AItRSTMtiokHtiPDMBBIGo9wVqHzlhwnUQ/cb=gapi.loaded0:212:282)
at Object.<anonymous> (/js/plusone.js:26:131)
at Object.<anonymous> (/_/apps-static/_/js/gapi/gcm_ppb,googleapis_client,plusone/rt=j/ver=_EB9y0TbRG4.es./sv=1/am=!5VdQ9Ii80V-IH20oNg/d=1/rs=AItRSTMtiokHtiPDMBBIGo9wVqHzlhwnUQ/cb=gapi.loaded0:1:6)
at Object._evaluate (/home/geronimo/projects/nbb/gwt-scraper/nod
@geronimod
geronimod / zombie-new-issue.log
Created May 16, 2012 22:25
zombie new issue loading google javascript
TypeError: Object #<Object> has no method 'T'
at Object.T (/_/apps-static/_/js/gapi/plusone/rt=j/ver=2vaqVKF526s.es./sv=1/am=!m0CwlI_oWP6Izkh5SA/d=1/rs=AItRSTM9coAfZRtH0cYqDGehGVdnjzrBqw/cb=gapi.loaded_0:212:106)
at /_/apps-static/_/js/gapi/plusone/rt=j/ver=2vaqVKF526s.es./sv=1/am=!m0CwlI_oWP6Izkh5SA/d=1/rs=AItRSTM9coAfZRtH0cYqDGehGVdnjzrBqw/cb=gapi.loaded_0:212:282
at /js/plusone.js:4:26
at /js/plusone.js:4:218
at Object.<anonymous> (/js/plusone.js:4:262)
at /_/apps-static/_/js/gapi/plusone/rt=j/ver=2vaqVKF526s.es./sv=1/am=!m0CwlI_oWP6Izkh5SA/d=1/rs=AItRSTM9coAfZRtH0cYqDGehGVdnjzrBqw/cb=gapi.loaded_0:1:6
at Object.run (/home/geronimo/projects/nbb/gwt-scraper/node_modules/zombie/node_modules/jsdom/node_modules/contextify/lib/contextify.js:10:24)
at /home/geronimo/projects/nbb/gwt-scraper/node_modules/zombie/lib/zombie/browser.coffee:137:28
at Object.javascript (/home/geronimo/projects/nbb/gwt-scraper/node_modules/zombie/lib/zombie/jsdom_patches.coffee:85:23)
@geronimod
geronimod / foo.conf
Created July 13, 2012 20:35
virtual host with passenger
### apache.conf
Listen *:80
NameVirtualHosts *:80
....
LoadModule passenger_module /somewhere/passenger-x.x.x/ext/apache2/mod_passenger.so
PassengerRuby /usr/bin/ruby
PassengerRoot /somewhere/passenger/x.x.x
...
@geronimod
geronimod / .htaccess
Created July 13, 2012 22:30
Passenger configuration
PassengerAppRoot /path_to_fooapp_document_root
PassengerEnabled On
@geronimod
geronimod / foo_controller.rb
Created September 8, 2012 17:28
Authorization by ip
# foo controller
AUTHORIZED_IPS = [127.0.0.1, ...]
before_filter :authorize_by_ip
def authorize_by_ip
redirect_to login_path, :warning => "access denied" unless AUTHORIZED_IPS.include? request.remote_ip
end
...
@geronimod
geronimod / gist:4005700
Created November 3, 2012 03:27
Route handler
ActionController::Routing::Routes.draw do |map|
...
map.connect ':route', :controller => 'route_handler', :action => 'rewrite'
...
end
class RouteHandlerController < ApplicationController
def rewrite
# suponiendo una estructura RewriteRule(short_uri, uri, ...) ie:
# "things-to-do-in-buenos-aires", "/aaa/bbbb/argentina/buenos-aires"
@geronimod
geronimod / array_ex.rb
Created December 20, 2012 17:22
Snippet to translate a array of paths into a nested hash map
# ["home/folder1", "home/folder2", "home/folder1/folderA", "home/folder2/folderB"].as_paths_to_map
# => {"home"=>{"folder1"=>{"folderA"=>{}}, "folder2"=>{"folderB"=>{}}}}
class Array
def as_paths_to_map
auto_hash = Hash.new { |h,k| h[k] = Hash.new &h.default_proc }
self.each do |path|
sub = auto_hash
path.split( "/" ).each do |dir|
next if dir.empty?
@geronimod
geronimod / icb.js
Created January 25, 2013 15:30
ICB resources
var ICB = {
apiUri: '/hcd',
cache: {},
parents: {
industry : undefined,
sup_sector : "industry",
sector : "sup_sector",
sub_sector : "sector"
},
@geronimod
geronimod / html5.html
Created January 27, 2013 14:49
HTML5 base
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The HTML5 base</title>
<meta name="description" content="HTML5 base">
<meta name="author" content="SitePoint">
<link rel="stylesheet" href="css/styles.css?v=1.0">
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
@geronimod
geronimod / td.html
Created January 31, 2013 00:18
td of price
<td id="pa_ST1569-200UL">
<img src="/is-bin/intershop.static/WFS/Merck-US-Site/-/en_CA/portal=merck4biosciences/images/content/master/loader.gif" /> loading
<script type="text/javascript">
if (isIE6())
{
$(window).load(function () {
updateAvailability('pa_ST1569-200UL','EMD_BIO-ST1569-200UL@Merck-US','0','quantity_ST1569-200UL','http://www.emdmillipore.com/is-bin/INTERSHOP.enfinity/WFS/Merck-US-Site/en_CA/-/USD/ViewProductInformation-UpdatePriceAndAvailability?PortalCatalogUUID=4_6b.s1OricAAAEg3cd6cjOt','false');