Skip to content

Instantly share code, notes, and snippets.

@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')
@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;
/**
@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?

/**
* 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);
});
};
@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 / HomepagePresenter.php
Created June 2, 2011 05:55 — forked from vaclavbohac/HomepagePresenter.php
Mobile device detection in Nette
<?php
class HomepagePresenter extends BasePresenter
{
public function actionDefault()
{
$detector = $this->context->detector;
if ($detector->isMobile()) {
$this->redirect("mobile");
@ondrejmirtes
ondrejmirtes / ConsoleDebug.php
Created March 18, 2011 12:44
PHP Nette CLI comfortable debugging
<?php
namespace Tools;
use Nette\Debug;
use Nette\Environment;
use Nette\Finder;
/**
* Shows exceptions thrown in CLI mode in browser.
@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/"
}
@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