Skip to content

Instantly share code, notes, and snippets.

View MartinSadovy's full-sized avatar

Martin Sadovy MartinSadovy

View GitHub Profile
@MartinSadovy
MartinSadovy / gist:6760392
Created September 30, 2013 07:25
google chrome - win8 mode to desktop
Remove this registr:
HKLM\Software\Classes\ChromeHTML\open\command\DelegateExecute
HKLM\Software\Classes\Chrome
@MartinSadovy
MartinSadovy / localEncoding.php
Last active December 12, 2015 12:28
Windows uses the local character encoding (cp125*) for file and directory name.
<?php
function utf8ToLocalEncoding($s) {
if (substr(PHP_OS, 0, 3) === 'WIN') {
$tmp = explode(".", setlocale(LC_CTYPE, 0));
if (isset($tmp[1]) && is_numeric($tmp[1]))
$s = @iconv("UTF-8", "cp" . $tmp[1] . "//TRANSLIT", $s);
}
return $s;
}
<?php
// Happy birthday Tom
class Tom extends Person{
public function runBirthday(){
$this->age++;
if($this->age == 18){
$this->acl->allow('doing own decisions');
@MartinSadovy
MartinSadovy / live-form-validation.js
Created August 8, 2012 12:18 — forked from redhead/live-form-validation.js
Live Form Validation for Nette 2.0
/**
* Live Form Validation for Nette 2.0
*
* @author Radek Ježdík, MartyIX, David Grudl, Martin Sadový
*/
var LiveForm = {
options: {
controlErrorClass: 'form-control-error',
errorMessageClass: 'form-error-message',
validMessageClass: 'form-valid-message',
<?php
require 'Nette/loader.php';
require 'stringFluent.php';
$string = string("ahoj já jsem petr")->capitalize();
echo $string."\n";
echo $string->webalize();