Skip to content

Instantly share code, notes, and snippets.

@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 = git@github.com: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:

@juzna
juzna / backup-with-git.md
Created August 5, 2012 16:23
Simple backups with Git

Simple backups with Git

Git calls itself "stupid content tracker", which means that the core just stores any data you put in and allows you to get it back. On top of that, there's all the fancy stuff like branching, diffs, remote repos etc, but that's not important for us today. We just want to track content, and the more stupidier (i.e. simple) way, the better - it'll be simpler to do any crazy stuff we imagine later on.

Motivation

I wanted to do backups of couple of terabytes of data, consisting of quite small files (< 10MB) which usually don't change. I wanted to have incremental backups (not to transfer all data) and I wanted to see history and be able to get into any version.

So why not to use git for it?

@paranoiq
paranoiq / aaa.txt
Created February 15, 2011 18:24
Cross-browser styling of <fieldset> and <legend> without any additional HTML elements
formátování <fieldset> a <legend> je opravdu vojeb. veškerá řešení,
která jsem našel vyžadovala přidat do kódu nějaké pomocné <div>y nebo
<span>y. takové řešení mi ale nevyhovuje
nakonec jsem dospěl k tomuto. vypadá na pixel stejně ve všech novějších
prohlížečích včetně IE7. v IE6 a starších (bez selektorů + a >) nefunguje
falešný padding
@bil-bas
bil-bas / logger.gd
Last active April 23, 2021 02:39
Simple logger for Godot Game Engine (godotgameengine.org)
# GodotLogger by Spooner
# ======================
#
# logger.gd is a simple logging system. It allows for more formatted logging,
# logging levels and logging to a file.
#
# Installation
# ------------
#
# Place this file somewhere (for example, 'res://root/logger.gd')
@leif81
leif81 / git_fix_author
Created March 9, 2011 21:50
Written to change the unix name used for a cvs commit to a pretty git name for the user. Implementation borrowed from http://lists.freedesktop.org/archives/portland/2010-October.txt author-conv-file format (same format as git-cvsimport requires):
#!/bin/bash
export $authors_file=author-conv-file
git filter-branch -f --env-filter '
get_name () {
grep "^$1=" "$authors_file" |
sed "s/^.*=\(.*\) <.*>$/\1/"
}
@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

@fprochazka
fprochazka / PresenterInfo.php
Created November 19, 2010 01:00
PresenterTree
<?php
namespace Kdyby;
use Nette;
use Nette\Reflection\ClassType;
/**
@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 / XmlObject.php
Created August 23, 2012 14:03
XmlObject as replacement for SimpleXmlObject
<?php
use Nette\Utils\Arrays;
use Nette\Utils\Strings;
use Nette\Utils\Html;
/**
/**
* Common AJAX setup
*/
var snippetsExt = $.nette.ext('snippets');
snippetsExt.context.applySnippet = function ($el, html) {
$el.fadeTo("fast", 0.3, function () {
$el.html(html).fadeTo("fast", 1);
});
};