Skip to content

Instantly share code, notes, and snippets.

View feload's full-sized avatar

Felipe feload

View GitHub Profile
@feload
feload / time_elapsed_string
Last active August 29, 2015 14:09
Human readable elapsed time.
<?php
function time_elapsed_string($ptime){
$etime = time() - $ptime;
if ($etime < 1)
return '0 seconds';
$a = array( 12 * 30 * 24 * 60 * 60 => 'año',
30 * 24 * 60 * 60 => 'meses',
24 * 60 * 60 => 'día',
@feload
feload / edo_gto_svg1.1
Created November 24, 2014 18:29
Estado de Guanajuato SVG 1.1
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Grupo_1_1_" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="752px" height="621px" viewBox="0 0 752 621" enable-background="new 0 0 752 621" xml:space="preserve">
<g id="Manuel_Doblado_xA0_Imagen_1_">
<g>
<g>
<!-- A -->
<path class="abasolo" fill-rule="evenodd" clip-rule="evenodd" fill="#DEDEDC" d="M156,345c0.541,3.541-3.541,2.459-3,6
c2.245,0.989,10.633-1.473,13,2c3.719,1.053,1.961-3.372,4-4c2.409-0.409,2.174,1.826,5,1c-5.166,4.57,1.498,9.9-3,16
@feload
feload / .htaccess
Created December 2, 2014 04:45
Laravel .htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
function getGetOrdinal(n) {
var s=["th","st","nd","rd"],
v=n%100;
return n+(s[(v-20)%10]||s[v]||s[0]);
}
@feload
feload / SassMeister-input-HTML.html
Created October 30, 2015 03:38
Generated by SassMeister.com.
<header>
<h1>Demo</h1>
</header>
<section class="content">
<p>Hello There!</p>
<a href="#">Click me!</a>
</section>
<footer>
<p>This is a footer</p>
</footer>
@feload
feload / template.js
Last active July 24, 2017 18:35
Basic templating function.
/**
* t().
* Converts a template into text by replacing placeholders based on an object properties.
*
* @param String template.
* @param Object params.
*
* @return String.
*/
const t = (template, params) => {
@feload
feload / Vagrantfile
Created June 30, 2016 02:14
Multiple vagrant machines configuration
Vagrant.configure("2") do |config|
config.vm.define "webserver" do |webserver|
webserver.vm.box = "hashicorp/precise64"
webserver.vm.network "private_network", ip: "192.168.0.2"
webserver.vm.hostname = "webserver"
end
@feload
feload / breakpoints.scss
Created August 16, 2016 17:15
Screen breakpoints SASS
// Breakpoints
$break360: 22.500em;
$break479: 29.938em;
$break480: 30em;
$break600: 37.500em;
$break640: 40em;
$break641: 40.063em;
$break767: 47.938em;
$break768: 48em;
$break769: 48.063em;
@feload
feload / delete_git_branches.txt
Last active December 9, 2016 18:32
Delete git branches except master.
git branch | grep -v "master" | xargs git branch -D
@feload
feload / thatguy.js
Created October 7, 2016 20:47
¯\_(ツ)_/¯
console.log(
String.fromCharCode(175,92,95,40,12484,41,95,47,175)
);