Skip to content

Instantly share code, notes, and snippets.

View vojtech-dobes's full-sized avatar

Vojtěch Dobeš vojtech-dobes

View GitHub Profile
@redhead
redhead / live-form-validation.js
Created August 26, 2010 21:16
Live Form Validation for Nette 2.0
/**
* Live Form Validation for Nette 2.0
*
* @author Radek Ježdík, MartyIX, David Grudl
*/
var LiveForm = {
options: {
controlErrorClass: 'form-control-error', // CSS class for an invalid control
errorMessageClass: 'form-error-message', // CSS class for an error message
@vaclavbohac
vaclavbohac / jQuery.mobile.formfix.js
Created June 16, 2011 15:48
AJAX forms in Nette FW and jQuery mobile
/**
* Formfix enables you to use AJAX forms with Nette FW
* and helps keep tracking of history in jQuery mobile.
*
* Requires jQuery 1.4+, jQuery mobile 1.0
*
* Usage:
* $("#foo").formfix();
*
* @author Vaclav Bohac <bohac.v@gmail.com>
@haochi
haochi / LICENSE.txt
Created July 10, 2011 23:23 — forked from 140bytes/LICENSE.txt
tofu: tiny templating engine
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Haochi Chen <http://ihaochi.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@paulirish
paulirish / 1-tablemarkup.html
Created August 1, 2011 01:38
whitespace use for html/css readability
<!-- formatting fun #1: tables! -->
<!-- use whitespace to mimic the layout you want. leave off optional end tags for readability -->
<table>
<caption>Selector engines, parse direction</caption>
<thead>
<tr><th>Left to right <th>Right to left
<tbody>
<tr><td>Mootools <td>Sizzle
/**
* Beta
*
* Sibling of netteForms.js "rewritten to jQuery"
* @author Pavel Kučera
* @author David Grudl author of netteForms.js, of the idea and the one who I copied from
*
* Disclaimer: I'm not a javascript programmer, actually I hate javascript, so consider that please if you want to complain about quality of this utility.
*
* Dependencies
@paulirish
paulirish / data-markdown.user.js
Last active February 6, 2024 10:41
*[data-markdown] - use markdown, sometimes, in your HTML
// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/>
// @link http://git.io/data-markdown
// @match *
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.
@abtris
abtris / widgets.js
Created January 29, 2012 10:38
mapy.cz
/**
* Input type - address with autocomplete and reverse geocoding using Seznam maps API.
*/
angular.inputType('address', function(element) {
var scope = this;
// full address data from geocoder for angular model
var address = {};
// parse input value and set into model
@kaja47
kaja47 / phplisp.php
Created May 3, 2012 17:31
Object oriented system made only from functions
<?php
// If you want to make an object oriented system from scratch, you must first create the universe.
// Only things you need are functions
function cons($h, $t) {
return function($what) use($h, $t) {
return ($what[0] === 'h') ? $h : $t;
};
}
@melanke
melanke / MultiGetSet.js
Created June 19, 2012 20:53
MultiGetSet.JS - Quickly generate getters and setters for multiple attributes
var MultiGetSet = function(opt){
var getType = function(o) {
return ({}).toString.call(o).match(/\s([a-zA-Z]+)/)[1].toLowerCase()
};
if(!opt.public || !opt.private)
return opt.public;
if(opt.handler && opt.handler.init)
@LeonardoCA
LeonardoCA / AjaxPanels.php
Created July 13, 2012 21:22
AjaxPanelsCompilerExtension
<?php
/**
* This file is part of the AjaxPanels Nette Addon
*
* Copyright (c) 2012 Leonard Odlozilik
*
* For the full copyright and license information, please view
* the file license.txt that was distributed with this source code.
*/