Skip to content

Instantly share code, notes, and snippets.

View resand's full-sized avatar

René Sandoval resand

View GitHub Profile
@resand
resand / web.config
Last active August 29, 2015 14:20 — forked from jatubio/web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<!-- Quitar los slash '/' del final de la ruta -->
<rule name="RewriteRequestsToPublic">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
</conditions>
@resand
resand / gist:bf7c39c01384d1f8c9d6
Created October 22, 2015 01:01 — forked from rdgutierrez/gist:b06fae22348cd0376836
Fechas en español con Carbon en Laravel 5
Using a library as Laravel-Date you will just need to set the language of the app in the Laravel app config file and use its functions to format the date as you want.
Set the language in /app/config/app.php
...
'locale' => 'es',
...
I've found this library pretty useful and clean. To use it, you can write something like the example in the library readme file. I leave the results in spanish.
...
echo Date::now()->format('l j F Y H:i:s'); // domingo 28 abril 2013 21:58:16
echo Date::parse('-1 day')->diffForHumans(); // 1 día atrás
@resand
resand / CarbonLocale.php
Created October 22, 2015 01:36 — forked from IsraelOrtuno/CarbonLocale.php
Carbon Locale - Use Carbon diffForHuman in different languages with Laravel Lang class
<?php
/**
- * Carbon diffForHumans multi-language.
- * Inspired in a code made by Meroje (https://gist.github.com/Meroje/7783731)
- * This code has been improved as in that original version was only showing
- * past date differences. Not it's able to show differences in past and future.
- *
- * Use it this way:
- *
@resand
resand / reset.css
Created November 19, 2015 20:16 — forked from marulango/reset.css
Hoja de estilo para eliminar inconsistencias a través de navegadores
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@resand
resand / Operaciones-Git
Created April 24, 2016 22:50 — forked from jelcaf/Operaciones-Git
Git Tips - Mini-trucos de Git para facilitarme la tarea
#############################################
# Push de la rama actual
git push origin $rama_actual
#############################################
# Volver a un commit anterior, descartando los cambios
git reset --HARD $SHA1
#############################################
# Ver y descargar Ramas remotas
@resand
resand / RBResizer.swift
Created June 16, 2016 20:52 — forked from HamptonMakes/RBResizer.swift
Swift Image Resizer
//
// RBResizer.swift
// Locker
//
// Created by Hampton Catlin on 6/20/14.
// Copyright (c) 2014 rarebit. All rights reserved.
//
import UIKit
@resand
resand / gist:eb394e7e564a14a64812b605de08a477
Created July 28, 2016 16:32 — forked from shadcn/gist:de147c42d7b3063ef7bc
Convert a Hex string to UIColor in Swift
// Creates a UIColor from a Hex string.
func colorWithHexString (hex:String) -> UIColor {
var cString:String = hex.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()).uppercaseString
if (cString.hasPrefix("#")) {
cString = cString.substringFromIndex(1)
}
if (countElements(cString) != 6) {
return UIColor.grayColor()
@resand
resand / whatsapp-image-compression
Created September 1, 2016 02:12 — forked from akshay1188/whatsapp-image-compression
Whatsapp like image compression
- (UIImage *)compressImage:(UIImage *)image{
float actualHeight = image.size.height;
float actualWidth = image.size.width;
float maxHeight = 600.0;
float maxWidth = 800.0;
float imgRatio = actualWidth/actualHeight;
float maxRatio = maxWidth/maxHeight;
float compressionQuality = 0.5;//50 percent compression
if (actualHeight > maxHeight || actualWidth > maxWidth) {
@resand
resand / RBResizer.swift
Created September 1, 2016 02:40 — forked from iroller/RBResizer.swift
Swift Image Resizer
//
// RBResizer.swift
// Locker
//
// Created by Hampton Catlin on 6/20/14.
// Copyright (c) 2014 rarebit. All rights reserved.
//
import UIKit
@resand
resand / Alert with fabric
Created September 2, 2016 17:06 — forked from yoman07/Alert with fabric
Display alert view with settings button
//
// AlertControllerFabric.swift
// Mapa Turystyczna
//
// Created by Roman Barzyczak on 05.04.2016.
//
import Foundation
class AlertHelper {