Skip to content

Instantly share code, notes, and snippets.

@kyledecot
kyledecot / laravel-ujs.js
Created June 19, 2012 14:40
laravel UJS
(function($, undefined) {
// Shorthand to make it a little easier to call public laravel functions from within laravel.js
var laravel;
$.laravel = laravel = {
// Link elements bound by jquery-ujs
linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]',
// Select elements bound by jquery-ujs
inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',
@loonies
loonies / hierarchy.php
Created November 20, 2011 21:39 — forked from devi/hierarchy.php
MySQL "Closure Table" for Kohana based on Bill Karwin design.
<?php defined('SYSPATH') or die('No direct script access.');
/**
* MySQL "Closure Table" for Kohana based on Bill Karwin design.
*
* @link http://www.slideshare.net/billkarwin/models-for-hierarchical-data
* @TODO improve
*
* sql schema:
* CREATE TABLE `closures` (
* `id` int(11) NOT NULL AUTO_INCREMENT,
@pallan
pallan / chiliproject_to_redmine.rb
Created September 22, 2013 19:33
Run this script from the root of your Redmine installation to convert from a Chiliproject installation
# encoding: UTF-8
# Chiliproject to Redmine converter
# =================================
#
# This script takes an existing Chiliproject database and
# converts it to be compatible with Redmine (>= v2.3). The
# database is converted in such a way that it can be run multiple
# times against a production Chiliproject install without
# interfering with it's operation. This is done by duplicating
@egermano
egermano / ie-fix.js
Created November 26, 2013 22:05
ECMA Script fixes for IE
'use strict';
// Add ECMA262-5 method binding if not supported natively
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
if (!Function.prototype.bind) {
Function.prototype.bind = function (oThis) {
if (typeof this !== "function") {
// closest thing possible to the ECMAScript 5 internal IsCallable function
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
}