Skip to content

Instantly share code, notes, and snippets.

View skowron-line's full-sized avatar

K.Skaradziński skowron-line

  • Warsaw
View GitHub Profile
@skowron-line
skowron-line / module.sh
Last active December 19, 2015 14:39
Kohana module tree generator
#!/bin/bash
# sudo ./module.sh <module_name>
module=$1
path[0]="modules/$module"
path[1]="modules/$module/classes"
path[2]="modules/$module/classes/controller"
path[3]="modules/$module/classes/model"
path[4]="modules/$module/views"
path[5]="modules/$module/views/$module"
@skowron-line
skowron-line / select2dropdown.js
Created June 30, 2013 16:15
Select to (bootstrap) dropdown..
(function($){
$.fn.select2Dropdown = function(){
var options = this.find('option'),
selected = this.find('option:selected').length == 0
? options[0]
: this.find('option:selected'),
div = document.createElement('div'),
a = document.createElement('a'),
span = document.createElement('span'),
ul = document.createElement('ul');
@skowron-line
skowron-line / jquery-tab-emulator.js
Last active December 16, 2015 08:09
Simple tab emulator, find fields from selector and allows to skip between then.
var tab = function()
{
this.fields = $('input:not(:disabled):not([type="hidden"]):not([readonly="readonly"]), a, select:not(:disabled)');
this.current = 0;
}
$.extend(tab.prototype, {
forward: function() {
this.current++;
if(this.current > this.fields.length) {
@skowron-line
skowron-line / db.php
Created April 22, 2012 06:49
Extension for kohana 3.2 DB class
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
*
* @author skowron-line
*/
class DB extends Kohana_DB {
/**
*
* @var string cache driver
*/
@skowron-line
skowron-line / pdo.php
Created September 29, 2011 13:49
[modules/database/classes/kohana/database/pdo.php] add condition to check if user use pqsql database, and correct returnig last insert id
<?php defined('SYSPATH') or die('No direct script access.');
/**
* PDO database connection.
*
* @package Kohana/Database
* @category Drivers
* @author Kohana Team
* @copyright (c) 2008-2009 Kohana Team
* @license http://kohanaphp.com/license
*/