Skip to content

Instantly share code, notes, and snippets.

@janmarek
janmarek / FormMacros.php
Created March 28, 2010 21:30
Form macros
<?php
namespace Nette\Templates;
use Nette\Forms\Form;
use Nette\String;
/**
* Form macros
*
@Cifro
Cifro / AnotherLatteMacros.php
Created July 3, 2010 15:20
Static class for additional Nette Latte Macros with first macro {each}{eachelse}{/each}
<?php
namespace Nette\Templates;
use Nette\Object;
use Nette\String;
/**
* Another Latte Macros
*
@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
@fprochazka
fprochazka / git-control.sh
Created October 23, 2010 12:55
funky git controller (sample: http://i55.tinypic.com/ao0038.jpg)
#!/bin/bash
srcLibs="/var/www"
black='\e[0;30m' # Black - Regular
red='\e[0;31m' # Red
green='\e[0;32m' # Green
yellow='\e[0;33m' # Yellow
blue='\e[0;34m' # Blue
purple='\e[0;35m' # Purple
@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
@netmute
netmute / Monokai.itermcolors
Created December 2, 2011 16:26
iTerm Monokai Colorscheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.30093687772750854</real>
<key>Green Component</key>
<real>0.36639997363090515</real>
@fprochazka
fprochazka / explained.md
Created February 20, 2012 15:59
Useful git hooks for Gitolite

Git push deploy

Requires installed gitolite in /home/git and following directory structure

/var
    /www
        /apps
        /hosts

/libs

@stuartsierra
stuartsierra / lein2-issue.md
Created July 6, 2012 21:04
'file:' repositories in Leiningen 2.0.0-preview5 and later

Sample Project

Starting from:

lein new foo
cd foo

Say I have a random JAR file that is not available in any repository:

touch README.md

@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@jhickner
jhickner / reload_chrome.sh
Created November 15, 2012 22:37
Reload Chrome then refocus iTerm
#!/bin/sh
exec <"$0" || exit; read v; read v; exec /usr/bin/osascript - "$@"; exit
-- the above is some shell trickery that lets us write the rest of
-- the file in plain applescript
tell application "Google Chrome"
activate
tell application "System Events"
tell process "Google Chrome"