Skip to content

Instantly share code, notes, and snippets.

@beberlei
beberlei / SQLFilter.php
Created July 21, 2011 10:46
First idea for SQL Filtering in Doctrine2
<?php
namespace Doctrine\ORM\Query\Filter;
abstract class SQLFilter
{
final public function __construct(Connection $conn);
final function setParameter($name, $value, $type);
@paranoiq
paranoiq / makeScrollable.js
Created August 24, 2011 16:18
Scrollable table body
/**
* Make table body scrollable, with the table header always visible.
* Table shrinks vertically to fit the browser viewport.
*
* requirements:
* - jQuery framework required (tested with 1.6.2)
* - header must be wrapped in <thead> element
*
* warnings:
* - table <caption> is not supported
@ondrejmirtes
ondrejmirtes / .bash_profile
Created September 12, 2011 08:18
Git configuration
export PS1="\u:\W $ "
#GIT bash by HABR (modified by Dundee)
export PSORIG="$PS1"
function GITBRANCH() {
BRANCH="$(git branch 2>/dev/null | grep '*' | cut -d" " -f2-)"
if [ -n "$BRANCH" ] ; then
export PS1="\u:\W "
export PS1=$PS1$(echo -en "\[\033[00;37m\]$BRANCH \[\033[00m\]")
/**
* 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
@pepakriz
pepakriz / ConfigBuilder.php
Created November 1, 2011 16:02
ConfigBuilder for Nette Framework
<?php
/**
* Venne:CMS (version 2.0-dev released on $WCDATE$)
*
* Copyright (c) 2011 Josef Kříž pepakriz@gmail.com
*
* For the full copyright and license information, please view
* the file license.txt that was distributed with this source code.
*/
(function($) {
// Used by dateinput
$.expr = {':': {}};
// Used by bootstrap
$.support = {};
// Used by dateinput
$.fn.clone = function(){
var ret = $();
@juzna
juzna / EntityForm.php
Created December 27, 2011 14:14
Data binding in Nette
<?php
class EntityForm extends Form {
/**
* Bind entity to this form and set default values from it
*
* @param \Nella\Models\IEntity $entity
* @throws \Nette\InvalidStateException
*/
public function bind(\Nella\Models\IEntity $entity)
@lancejpollard
lancejpollard / less2stylus.coffee
Created February 9, 2012 19:33
Convert LESS to Stylus for Twitter Bootstrap
# Quick hack of regular expressions to convert twitter bootstrap from LESS to Stylus
less2stylus = (string) ->
string = string
.replace(/^(\ *)(.+)\ +\{\ *\n?\ */mg, "$1$2\n$1 ") # remove opening brackets
.replace(/^(\ *)([^\ \n]+)\ +\{\ *\n?\ */mg, "$1$2\n$1 ") # remove opening brackets
.replace(/\ *\{\ *\n*/g, "\n") # remove opening brackets again (some random cases I'm too lazy to think through)
.replace(/\ *\}\ *\n*/g, "\n") # remove closing brackets
.replace(/\;\ *?$/gm, "") # remove semicolons
.replace(/@(\w+):(\ *)\ /g, (_, $1, $2) -> # replace @variable: with $variable =
"$#{$1}#{$2} = "
@Janiczek
Janiczek / genetics.coffee
Created April 12, 2012 13:43
Evoluční algoritmus
#======================================================================#
# Biologicke algoritmy (2) - Evoluční algoritmy #
# http://www.root.cz/clanky/biologicke-algoritmy-2-evolucni-algoritmy/ #
#======================================================================#
#
# hledame kruznice, ktere nejvic sedi na danou mnozinu bodu
#
# ----------------------------------------------------------
#
# jedinec = trojice kruznic

I am thrilled to announce the arrival of a new stable version of Node.js.

Compared with the v0.6 releases of Node, this release brings significant improvements in many key performance metrics, as well as cleanup in several core APIs, and the addition of new debugging features.

tl;dr