Skip to content

Instantly share code, notes, and snippets.

View favrik's full-sized avatar
🏀

Favio Manriquez favrik

🏀
View GitHub Profile
@favrik
favrik / staticx.php
Created June 6, 2011 11:12
A CodeIgniter controller used for static sites
<?php
class Staticx extends CI_Controller {
/**
* This action must be configured as a "catch-all" url inside
* application/config/routes.php You can do this by adding the following
* line to that file:
*
* $route['(:any)'] = 'staticx/route/$1';
@favrik
favrik / localhost-vhost
Created May 10, 2011 20:17
vhost for localhost
<VirtualHost *:80>
DocumentRoot "/Library/WebServer/Documents"
<Directory />
Options All
AllowOverride All
Order deny,allow
Deny from All
Allow from 127.0.0.1
</Directory>
favrik {
background: #f00;
}
class Reservation < ActiveRecord::Base
has_many :taxes
has_many :surcharges
belongs_to :customer
#logic goes here
end
#!/bin/bash
SITE=$1
TYPE=$2
LUSER="favio"
GIT_USERNAME="favrik"
SITES_FOLDER="/home/favio/web"
cd $SITES_FOLDER
@favrik
favrik / Capfile
Created February 16, 2011 11:46
Deploy para php usando git y Capistrano
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
ssh_options[:forward_agent] = true
default_run_options[:pty] = true
set :application, "GDC"
set :repository, "[email protected]:noahlh/GDC-Online-Vehicle-Reservation-System.git"
set :scm, :git
set :deploy_via, :remote_cache
<?php
/*
Template Name: Photo Album
If you want to customize the look and feel of your photo album, follow these steps.
You'll probably need a good understanding of HTML and CSS!
1. Copy this file into your current active theme's directory
2. Also copy all the files starting with "photoalbum-" into your theme's directory
@favrik
favrik / groupsConfig.php
Created January 23, 2010 14:58
How I organize groupsConfig.php in PHP Minify.
<?php
/**
* Groups configuration for default Minify implementation
* @package Minify
*/
/**
* You may wish to use the Minify URI Builder app to suggest
* changes. http://yourdomain/min/builder/
**/
<?php
/*
Note: some parts based on the Spyc YAML parser at http://code.google.com/p/spyc/
*/
class MorpheusParser {
private $Form = array();
/* Pseudo Global Variables shared by several methods */
private $group_cursor = 0;
private $field_name = '';
<?php
class MorpheusParser {
private $Form = array();
private $group_cursor = 0;
public function __construct() {
}
private function getFile($input) {