Skip to content

Instantly share code, notes, and snippets.

View messutied's full-sized avatar
🎯
Focusing

Eduardo Messuti messutied

🎯
Focusing
View GitHub Profile
@messutied
messutied / jquery.basicPlugin.js
Last active August 29, 2015 14:02
jQuery Plugin Boilerplate
(function( $ ) {
var settings = {};
// private methods
var somePrivateMethod = function() {
}
// public methods
var methods = {
init: function(options) {
@messutied
messutied / gist:4965443
Created February 16, 2013 03:43
YQL Queries
select * from yahoo.finance.historicaldata where symbol = "BMPS.MI" and startDate = "2009-09-11" and endDate = "2010-03-10"

Fix problems with pg gem on mac os and the postgres App

The problem

I was getting the following error on rails server:

 Library not loaded: /usr/lib/libpq.5.dylib (LoadError)
  Referenced from: /Users/messutiEdd/.rvm/gems/ruby-1.9.3-p362/gems/pg-0.14.1/lib/pg_ext.bundle
  Reason: image not found - /Users/messutiEdd/.rvm/gems/ruby-1.9.3-p362/gems/pg-0.14.1/lib/pg_ext.bundle
// Usage:
// var bgcolor = $("#element-id").css("background-color");
// var darker_bgcolor = addRGB(bgcolor, -50);
function addRGB(rgb, n) {
var spl = rgb.split(",");
var r = spl[0].replace("rgb(", "");
var g = spl[1].replace(" ", "");
var b = spl[2].replace(" ", "").replace(")", "");
r = r * 1 + n;