Skip to content

Instantly share code, notes, and snippets.

@Mikulas
Mikulas / coding_standard.php
Created June 28, 2010 14:35
Coding standard [PHP]
/**
* Coding standard
*
* @copyright Mikuláš Dítě 2010
* @version 1
*/
________________________________________________________________________________
<?php # full php opening tag on first line
# new line after php opening tag
namespace Example; # namespace name in CamelCase
@Mikulas
Mikulas / nette_getter_demonstration.php
Created June 28, 2010 18:00
Nette automatic getter calling demonstration
<?php
/**
* Nette automatic getter calling demonstration
*/
namespace Model;
class Test extends BaseModel
@Mikulas
Mikulas / gist:492710
Created July 27, 2010 19:21
Regex Wrapper example usage
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Regex Sandbox with default Unicode support</title>
</head>
<body style="font-family: Verdana; ">
<h1 style="font-size: 23px;">Regex class with unicode support and objective access</h1>
<?php
@Mikulas
Mikulas / gist:498693
Last active September 5, 2015 13:25
Mac OS X Console Output Coloring terminal color
/**
* Mac OS X Console Output Coloring
* @author Mikulas Dite
* @copyright Mikulas Dite 2012
*/
# Pattern
\033[%codes%m%text%\033[0m
@Mikulas
Mikulas / gist:499244
Created July 29, 2010 21:11
Experimental check for hash cycles
<?php
/**
* Experimental check for hash cycles
* Should take about 16 hours, 20 minutes to compute hashes and few more minutes to compare them
* @author Mikulas Dite
* @copyright Mikulas Dite 2010
* @version MD5
*/
@Mikulas
Mikulas / Toggling block comments.php
Created September 25, 2010 16:18
Toggling block comments
<?php
/*
* Toggling block comments
* Mikulas Dite 2010
*/
/*
@Mikulas
Mikulas / FormMacros.php
Created October 3, 2010 11:03 — forked from janmarek/FormMacros.php
Form Macros
<?php
namespace Nette\Templating;
use Nette\Forms\Form;
use Nette\Utils\Strings as String;
use Nette\InvalidStateException;
use Nette\Object;
use Nette\Latte\DefaultMacros;
@Mikulas
Mikulas / git-control.sh
Created October 23, 2010 18:42 — forked from fprochazka/git-control.sh
Git project control for Mac
#!/bin/bash
srcLibs="/Volumes/Data/Web"
colorPrefix="\033["
colorPostfix="\033[0m"
color_default="0"
color_red="31"
color_red_bold="1;31"
@Mikulas
Mikulas / .bash_alias
Created November 5, 2010 16:14
Mac bash settings
alias o='open .'
alias ls='ls -AG'
alias ll='ls -l'
alias ..='cd ..'
alias w='cd /Volumes/Data/Web/'
alias p='cd /Volumes/Data/Projects'
alias s="sudo"
@Mikulas
Mikulas / browse.sh
Created November 11, 2010 15:13
Mac shell script for opening web projects
#!/bin/bash
x=`pwd`
x=$(echo $x|sed 's/\/Volumes\/Data\/Web/localhost/g')
open -a Google\ Chrome http://$x/www/
exit