Skip to content

Instantly share code, notes, and snippets.

View alle's full-sized avatar

Alessandro Frangioni alle

View GitHub Profile
@igstan
igstan / transliterate.sql
Created February 11, 2009 13:24
MySQL transliteration function
-- Copyright (c) 2009, Ionut Gabriel Stan. All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without modification,
-- are permitted provided that the following conditions are met:
--
-- * Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
--
-- * Redistributions in binary form must reproduce the above copyright notice,
-- this list of conditions and the following disclaimer in the documentation
@smgladkovskiy
smgladkovskiy / Controller_Ajax_Template.php
Last active September 25, 2015 00:18
Ajax Template Controller for Kohana v3.3
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* Ajax Template Controller template
*
* @package Templates
* @author Sergei Gladkovskiy <smgladkovskiy@gmail.com>
*/
abstract class Controller_Ajax_Template extends Controller {
@isaiahdw
isaiahdw / applicationclasseslogemail.php
Created September 3, 2011 20:58
Email Log writer
<?php defined('SYSPATH') or die('No direct script access.');
class Log_email extends Log_Writer {
/**
* Email the log message to the website administrator.
*
* @param array messages
* @return void
*/
@sebacruz
sebacruz / install-kohana.sh
Created October 17, 2011 15:08 — forked from shadowhand/install-kohana.sh
A script to install the Kohana PHP Framework
#!/bin/sh
# have submodules been added?
MODS=0
# Github base URL
GITHUB="https://github.com"
# Default branch
DEFAULT_BRANCH="3.0/master"
@oodavid
oodavid / README.md
Last active April 8, 2026 18:20 — forked from aronwoost/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@kemo
kemo / Cached.php
Created April 27, 2012 21:36
Cache-powered ORM model extension (Kohana 3.3) - [!!] Not tested
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Extend this class if you want your model cached. Example usage:
*
* 1. Model
* class Model_User extends ORM_Cached {}
*
* 2. Usage
*
@evanpurkhiser
evanpurkhiser / date.php
Created October 21, 2012 08:19
Human readable span date function
Class Date extends Kohana_Date {
/**
* Present the diffidence between two times in a natural format for humans
*
* If the difference is less than a day, then the difference in seconds,
* minutes, or hours will be reported.
*
* $span = Date::human_span(time() - 240); // "4 minutes ago"
* $span = Date::human_span(time() + 1); // "in 1 second"
@atannus
atannus / kohana.php
Created July 6, 2013 19:38
Quick hack to allow Kohana to handle memory_limit and max_execution_time violations.
<?php defined('SYSPATH') or die('No direct script access.');
class Kohana extends Kohana_Core {
/**
* Augments the core method for two reasons:
* 1) Reserve an extra 1M memory to allow handling memory_limit violation.
* 2) Reserve more exec time to allow max_execution_time violation.
*
* Note: keep variable creation at a minimum.
@birkir
birkir / multiquery.php
Created November 28, 2013 10:05
Multiquery adapter for MySQLi database driver
<?php
class MySQLi_Database extends Database {
...
public function multiquery($sql)
{
// Make sure the database is connected
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #