Skip to content

Instantly share code, notes, and snippets.

View fabiancarlos's full-sized avatar
🚀
Go!

Fabian Carlos fabiancarlos

🚀
Go!
View GitHub Profile
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);
@fabiancarlos
fabiancarlos / set-value.md
Created July 28, 2012 22:04 — forked from JeffreyWay/set-value.md
PHP: Set value if not exist

You know how, in JavaScript, we can set a value to a variable if one doesn't, like this:

name = name || 'joe';

This is quite common and very helpful. Another option is to do:

name || (name = 'joe');
@fabiancarlos
fabiancarlos / espresso_libre.css
Created October 17, 2012 00:55 — forked from mreinhardt/espresso_libre.css
Espresso Libre CSS translation for Chrome Inspector
/*
Espresso Libre by Mike Reinhardt 2011
based on Espresso Libre - by zolli -
http://www.eclipsecolorthemes.org/?view=theme&id=45
Inspired by Ben Truyman's IR_Black translation
and Darcy Clarke's blog post:
http://darcyclarke.me/design/skin-your-chrome-inspector/
*/
@fabiancarlos
fabiancarlos / style.css
Last active January 2, 2016 15:49 — forked from mwbrooks/style.css
* {
-webkit-touch-callout:none; /* prevent callout to copy image, etc when tap to hold */
-webkit-text-size-adjust:none; /* prevent webkit from resizing text to fit */
-webkit-tap-highlight-color:rgba(0,0,0,0); /* prevent tap highlight color / shadow */
-webkit-user-select:none; /* prevent copy paste, to allow, change 'none' to 'text' */
}
// or to use on specific template add a class on body
// <body class="mobile-higlight-off">
// <!-- html stuff -->
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
@fabiancarlos
fabiancarlos / gist:8c9b216c57e14696c10e4f52ff08a492
Created January 2, 2019 22:11 — forked from rolo/gist:1481128
Install Postgres 9.1, PostGIS and create PostGIS template on Ubuntu 11.10 Oneiric Ocelot
#!/bin/bash
#
# Install Postgres 9.1, PostGIS and create PostGIS template on a clean Ubuntu 11.10 Oneiric Ocelot box
# http://wildfish.com
# add the ubuntu gis ppa
sudo apt-get -y install python-software-properties
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
@fabiancarlos
fabiancarlos / rails http status codes
Created April 10, 2019 23:21 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
defmodule MailService.SendAdapters.SendGrid do
@mailer_url "https://api.sendgrid.com/v3/mail/send"
@doc """
Send a mail to a list of persons (recipients)
* from from address
* recipients array of email addresses
* subject subject text