Skip to content

Instantly share code, notes, and snippets.

View jordinebot's full-sized avatar
👋
Hi! I'm Jordi.

Jordi Nebot jordinebot

👋
Hi! I'm Jordi.
View GitHub Profile
@jordinebot
jordinebot / gist:3e8ebf032884379f3a99
Created August 22, 2014 10:35
Medium.com .is-languageTier3 styles
.is-languageTier3 .graf--h3 {
font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif
}
.is-languageTier3 .postContent {
font-family: Georgia, Cambria, "Times New Roman", Times, serif
}
@jordinebot
jordinebot / String::contains
Created January 22, 2015 11:29
CoffeeScript 'contains' String prototype
###*
* String prototype to check the presence of a substring
* @param {String} needle to look for
* @return {Bool} Presence of needle in String
###
if typeof String::contains isnt 'function'
String::contains = (needle) ->
(@.match new RegExp needle.replace(/[-[\](){}*+?.,\\^$|#\s]/g, "\\$&"))?
function array_reorder( $array, $index_from, $index_to ) {
array_splice(
$array,
$index_to,
count( $array ),
array_merge(
array_splice( $array, $index_from, 1 ),
array_slice( $array, $index_to, count( $array ) )
)
);
@jordinebot
jordinebot / mod.coffee
Last active September 10, 2015 08:58
Number::mod
if typeof Number::mod isnt 'function'
Number::mod = (n) ->
( ( @ % n ) + n ) % n
@jordinebot
jordinebot / grid.scss
Last active January 11, 2016 17:55
So Simple SCSS Grid
/* Clearfix */
@mixin clearfix {
&:after {
content: "";
display: table;
clear: both;
}
}
/* Media Queries */
@jordinebot
jordinebot / load-wordpress.php
Created January 25, 2016 16:59
Load Wordpress
/* Load Wordpress in any file inside wp-content/ */
defined('ABSPATH') or define('ABSPATH', preg_replace('/\/wp-content\/.*/', '', __DIR__) . '/');
require_once ABSPATH . 'wp-load.php';
@jordinebot
jordinebot / patterns.coffee
Last active March 11, 2016 12:14
Regular Expressions object for form validation
patterns =
name:
/// ^
[a-z|A-Z|àáèéíòóúÀÁÈÉÍÒÓÚïÏüÜçÇñÑ\-ºª\s]{2,}
$ ///i
email:
/// ^
([\w-\.]+@([\w-]+\.)+[\w-]{2,4})
$ ///i
date:
@jordinebot
jordinebot / api.coffee
Created March 22, 2016 10:10
API Caller
class API
constructor: (url) ->
@url ?= apiURL
@status =
OK: 200,
DONE: 4
@cache = {}
@cacheExpiration = 0 #seconds
@jordinebot
jordinebot / .htaccess
Last active November 16, 2023 12:32
Optimized .htaccess for Google PageSpeed Insights
# ########################
# Leverage browser caching
# ########################
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/png A2592000
@jordinebot
jordinebot / me.js
Last active November 28, 2016 14:32
let jordiNebot = {
type: 'Full Stack Web Developer',
employer: 'Self-employed',
from: {
city: 'Barcelona',
coordinates: {
lat: 41.3891006,
lng: 2.1333274999999503
}
},