Skip to content

Instantly share code, notes, and snippets.

View messutied's full-sized avatar

Eduardo Messuti messutied

View GitHub Profile
// 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;

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
messutied / gist:4965443
Created February 16, 2013 03:43
YQL Queries
select * from where symbol = "BMPS.MI" and startDate = "2009-09-11" and endDate = "2010-03-10"
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 / gist:32c2e740caf124673f1e
Created January 21, 2016 01:01 — forked from ryansobol/gist:5252653
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

messutied / server.js
Last active April 1, 2017 08:42
react-hot-reloader with custom server proxying to webpack-dev-server
const express = require('express');
const url = require('url');
const path = require('path');
const app = express();
if (process.env.NODE_ENV !== 'production') {
app.use('/assets', require('proxy-middleware')(url.parse('http://localhost:8080/assets')));
} else {
app.use('/assets', express.static(path.resolve(__dirname, '../www/assets')));
"name": "react-hot-loader-test",
"version": "1.0.0",
"scripts": {
"dev:frontend": "webpack-dev-server --hot",
"server": "node server/server.js",
"dev": "concurrently --kill-others \"npm run dev:frontend\" \"npm run server\"",
"dependencies": {
"express": "^4.15.2"
messutied / share_to_whatsapp.js
Last active February 19, 2022 22:54
Share to whatsapp bookmarklet
// Following this guide:
const YOUR_PHONE='';`${YOUR_PHONE}&text=${encodeURIComponent(location.href)}`);
messutied / custom_footer.html
Last active February 13, 2020 12:08
Statuspal Custom Header & Footer Example
messutied / en.yaml
Created June 4, 2020 10:49
Statuspal english localization file
subscribe_to_updates_1: Subscribe
subscribe_to_updates_2: to Updates
subscribe_to_updates_confirmation: You have been subscribed!
operational: All Systems Operational
issue_singular: There is an ongoing Incident
issue_plural: There are ongoing Incidents
maintenance_singular: There is an ongoing Maintenance
maintenance_plural: There are ongoing Maintenances
about: This is {{name}}'s status page, here you'll find the current status and incident history of {{name}}