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 protected]> | |
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
// | |
// While TinyMCE can strip out <script> tags, | |
// it does not remove inline JS event handlers. | |
// | |
// Example: onmouseover, onclick, etc. | |
// | |
// This should be included at the bottom of a page, | |
// contained inside an <iframe> to sandbox user-created | |
// content. The reason it is contained in an <iframe> | |
// is to prevent user-created CSS from affecting |
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 | |
/** | |
* PHP port of JavaScript String slice() method | |
* | |
* @param string $str | |
* @param int $start | |
* @param int $end (optional) | |
*/ | |
function str_slice($str, $start, $end = FALSE) | |
{ |
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
// Extension to Twitter Bootstrap's mixin.less that adds support for translucent background colors in IE6-IE9 (deprecated as of IE9) | |
#translucent { | |
.background(@color: @white, @alpha: 1) { | |
// http://css3please.com/ | |
// http://msdn.microsoft.com/en-us/library/ms532997(v=vs.85).aspx | |
background-color: transparent; | |
background-color: hsla(hue(@color), saturation(@color), lightness(@color), @alpha); | |
// http://stackoverflow.com/questions/2877322/convert-opacity-to-hex-in-javascript | |
// http://robertnyman.com/2010/01/11/css-background-transparency-without-affecting-child-elements-through-rgba-and-filters/ |
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 if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
/** | |
* Create URL Title with support for accented characters | |
* | |
* Takes a "title" string as input and creates a | |
* human-friendly URL string with either a dash | |
* or an underscore as the word separator. | |
* | |
* All accented characters get transliterated |
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 class="no-js" lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="HandheldFriendly" content="True"> | |
<meta name="MobileOptimized" content="0"> | |
<meta name="viewport" content="width=device-width"> | |
<script type="text/javascript" src="riloadr.min.js"></script> |
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
// 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 if (!defined('BASEPATH')) exit('No direct script access allowed'); | |
// Adds support for language code in the first segment of the URI. | |
// It negotiates the language if no language is found in the URI. | |
// Negotiation priority: URI language code segment > Cookie ($_COOKIE) > User agent ($_SERVER['HTTP_ACCEPT_LANGUAGE']) > Fallback (Configuration) | |
class MY_Lang extends CI_Lang { | |
/** | |
* Config class |
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
DELIMITER // | |
# Campaign modified timestamps: modified_description, modified_where, modified_conditions, modified_includes | |
CREATE TRIGGER before_campaigns_update BEFORE UPDATE ON campaigns | |
FOR EACH ROW | |
BEGIN | |
IF (NEW.description <> OLD.description) OR (NEW.description IS NOT NULL AND OLD.description IS NULL) OR (NEW.description IS NULL AND OLD.description IS NOT NULL) | |
OR (NEW.infolink_text <> OLD.infolink_text) OR (NEW.infolink_text IS NOT NULL AND OLD.infolink_text IS NULL) OR (NEW.infolink_text IS NULL AND OLD.infolink_text IS NOT NULL) | |
OR (NEW.infolink_url <> OLD.infolink_url) OR (NEW.infolink_url IS NOT NULL AND OLD.infolink_url IS NULL) OR (NEW.infolink_url IS NULL AND OLD.infolink_url IS NOT NULL) |
OlderNewer