Skip to content

Instantly share code, notes, and snippets.

View iign's full-sized avatar

Ignacio iign

View GitHub Profile
@iign
iign / demo
Created January 19, 2015 18:20
class DynamicLayoutHandler(object):
def _check_layout(self):
if self.layout is None:
raise FormHelpersException("You need to set a layout in your FormHelper")
def _check_layout_and_form(self):
self._check_layout()
if self.form is None:
raise FormHelpersException("You need to pass a form instance to your FormHelper")
$rules = array(
‘username’ => ‘required|min:8|unique:users|integer’,
‘firstname’ => ‘required’,
‘lastname’ => ‘required’,
‘email’ => ‘required|email’,
‘password’ => ‘required|confirmed’
);
$messages = array(
‘required’ => ‘El campo :attribute es obligatorio.’,
@iign
iign / 3xmixin.less
Created March 17, 2015 15:16
3x support for retina.less mixin
.at2x(@path, @w: auto, @h: auto) {
background-image: url(@path);
@at2x_path: ~`@{path}.replace(/\.\w+$/, function(match) { return "@2x" + match; })`;
@at3x_path: ~`@{path}.replace(/\.\w+$/, function(match) { return "@3x" + match; })`;
@media @highdpi {
background-image: url("@{at2x_path}");
background-size: @w @h;
}
@iign
iign / index.php
Created June 4, 2015 17:38
Silex index.php file
require_once __DIR__ . '/vendor/autoload.php';
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
$app = new Silex\Application();
// $app['debug'] = true;
$app->register(new Silex\Provider\UrlGeneratorServiceProvider());
@iign
iign / disable-url-rewrite.htaccess
Created August 10, 2011 14:54
Disable url rewrite for a folder
RewriteRule ^folder_name/.*$ - [PT]
@iign
iign / nonwww-to-www.htaccess
Created August 10, 2011 14:55
Rewrite non-www to www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.mysitehere.com/$1
@iign
iign / remove-svn-folders.txt
Created August 17, 2011 13:50
Remove all .svn folders and contents
find . -name .svn -print0 | xargs -0 rm -rf
@iign
iign / terminal-targzip
Created May 18, 2012 13:33
Create a .tar.gzip using Terminal
tar -pvczf BackUpDirectory.tar.gz /path/to/dir
@iign
iign / dabblet.css
Created June 28, 2012 02:13
Minesweeper
/**
* Minesweeper
*/
.left{ float:left; }
.right{ float:right; }
button{
@iign
iign / index.html
Created July 16, 2012 18:15
A web page created at CodePen.io
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Minesweeper &middot; CodePen</title>
<!--
Copyright (c) 2012 Ignacio Toledo, http://codepen.io/iign
Permission is hereby granted, free of charge, to any person obtaining