This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LICENCIA PÚBLICA de NO SEAS UN CAPULLO | |
Version 1, Diciembre 2009 | |
Copyright (C) 2009 Philip Sturgeon <email@philsturgeon.co.uk> | |
Se autoriza la reproducción y distribución de las copias del presente documento de licencia, y se permite así mismo su modificación siempre y cuando se cambie el nombre de la licencia. | |
LICENCIA PÚBLICA de NO SEAS UN CAPULLO | |
TÉRMINOS Y CONDICIONES PARA LA COPIA, DISTRIBUCIÓN Y MODIFICACIÓN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Live demo: paste this gist's code on http://less2css.org/ | |
@start: left; | |
@end: right; | |
@base-space-0: 0; | |
@base-space-1: 1rem; | |
@base-space-2: 2rem; | |
@base-space-3: 3rem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ A simplistic way of loading and rendering HAML partials (header.haml, footer.haml, nav.haml... you name it) without Rails | |
/ Useful when using tools like LiveReload http://livereload.com/ | |
/ but don't want to configure a web server just to use PHP include/require constructs (discussion http://help.livereload.com/discussions/questions/22-haml-partials) | |
/ It could be improved/simplified using a helper http://stackoverflow.com/questions/5436769/partial-haml-templating-in-ruby-without-rails/5436973#5436973 | |
/ Check out the Jade version https://gist.github.com/2593727 | |
%html | |
%body | |
%header | |
= Haml::Engine.new(File.read('/path/to/your/partial.haml')).render |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html dir="ltr" lang="en-US"> | |
<head> | |
<!-- utf-8 works for most cases --> | |
<meta charset="utf-8"> | |
<!-- Forcing initial-scale shouldn't be necessary --> | |
<meta name="viewport" content="width=device-width"> |
Para sitios corporativos uso WP Engine, aunque no estén libres de DDoS puntuales.
Para proyectos personales uso una combinación de plugins, a poder ser con CloudFlare por encima:
- BruteProtect: stopping distributed brute force attacks
- Sucuri: security hardening
- WP Security Audit Log or Simple History: audit log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Jade (http://jade-lang.com) version of this HAML snippet https://gist.github.com/2585095 | |
html | |
body | |
header | |
include partial | |
footer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Takes an associative array in the layout of parse_url, and constructs a URL from it | |
* | |
* see http://www.php.net/manual/en/function.http-build-url.php#96335 | |
* | |
* @param mixed (Part(s) of) an URL in form of a string or associative array like parse_url() returns | |
* @param mixed Same as the first argument | |
* @param int A bitmask of binary or'ed HTTP_URL constants (Optional)HTTP_URL_REPLACE is the default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Possible PHP Bug: | |
// An object is automatically created if an unset object with a property is passed by reference | |
// Inconsistent Warnings depending on the variable type | |
// Live test http://codepad.viper-7.com/ueZkz4 | |
// Possibly related PHP bug https://bugs.php.net/bug.php?id=52237 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MY_Model extends CI_Model { | |
// Form validation rules | |
protected $rules = array(); | |
// Sets form validation rules | |
protected function set_rules($field_names) | |
{ |