Skip to content

Instantly share code, notes, and snippets.

View favrik's full-sized avatar
🏀

Favio Manriquez favrik

🏀
View GitHub Profile
@favrik
favrik / tiny_mce.php
Created May 3, 2012 20:54
compiling script
<?php
$tiny_mce = realpath(__DIR__ ."/../../htdocs/js/tiny_mce");
require "$tiny_mce/tiny_mce_gzip.php";
$compressor = new TinyMCE_Compressor(array(
'base_path' => $tiny_mce,
'filename' => 'compiled.js',
'compress' => false,
@favrik
favrik / gist_embed.coffee
Created February 20, 2012 09:25 — forked from danott/gist_embed.coffee
Embed GitHub Gists without blocking the page.
# Asynchronously load GitHub Embeds
# Why?
# Because no web developer worth his weight in bacon salt wants to have blocking <script /> style embeds in his content.
# I want to be able to link to GitHub gists I write, and I want those links to show up in content aggregators as well.
# And then, if possibly, progressively enhance by embedding the gist.
#
# Usage, simply link to a gist. An entire gist, or an anchor tag to a particular file.
#
# Requires: jQuery and Modernizr
#
@favrik
favrik / index.php
Created January 27, 2012 21:58
SITIO BASICO 3ra Parte
<?php
$page_title = 'Mi Pagina Web';
require 'header.inc.php';
?>
<h1>Encabezado principal</h1>
<p>Informacion</p>
@favrik
favrik / footer.inc.php
Created January 27, 2012 21:56
SITIO BASICO 2da Parte
@favrik
favrik / header.inc.php
Created January 27, 2012 21:52
SITIO BASICO 1era Parte: Como crear un simple sistema de plantillas para sitios web muy basicos.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://www.w3.org/2005/10/profile">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" type="image/png" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/footer.css" />
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="css/ie7footer.css" />
<![endif]-->
@favrik
favrik / hah.js
Created December 5, 2011 00:49
Why .apply is awesome
// Set container height to highest list
var heights = $('.articleSection').map(function() {
return $(this).innerHeight();
}).get();
console.log(heights);
var max = Math.max.apply(Math, heights);
//$('.articlesWidget .wrapper').height(max);
@favrik
favrik / post-commit.php
Created August 13, 2011 01:54
Beanstalk post-commit hook script that sends an email if a specific file was modified
<?php
$SEND_NOTIFICATION = FALSE;
$watched_file = 'file/to/watch/in_your_repository';
/*----------------------------------------------------------*/
if (isset($_POST['commit'])) {
require 'JSON.php'; // PECL script, or perhaps json_decode() is enough
@favrik
favrik / holidays.php
Created June 6, 2011 11:24
Example view file with meta data in the initial php comments
<?php
/*
Page Title: My DF holidays
Meta Keywords: df, holidays, mine
*/
?>
<p>
This is some nice test content.
@favrik
favrik / layout.php
Created June 6, 2011 11:16
application/views/layout.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="keywords" content="<?php echo $meta_keywords ?>" />
<title>My Static Site - <?php echo $page_title ?></title>
</head>
<body>
<h1><?php echo $page_title ?></h1>
@favrik
favrik / routes.php
Created June 6, 2011 11:16
application/config/routes.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| URI ROUTING
| -------------------------------------------------------------------------
| This file lets you re-map URI requests to specific controller functions.
|
| Typically there is a one-to-one relationship between a URL string
| and its corresponding controller class/method. The segments in a
| URL normally follow this pattern: