This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Quick hack of regular expressions to convert twitter bootstrap from LESS to Stylus | |
less2stylus = (string) -> | |
string = string | |
.replace(/^(\ *)(.+)\ +\{\ *\n?\ */mg, "$1$2\n$1 ") # remove opening brackets | |
.replace(/^(\ *)([^\ \n]+)\ +\{\ *\n?\ */mg, "$1$2\n$1 ") # remove opening brackets | |
.replace(/\ *\{\ *\n*/g, "\n") # remove opening brackets again (some random cases I'm too lazy to think through) | |
.replace(/\ *\}\ *\n*/g, "\n") # remove closing brackets | |
.replace(/\;\ *?$/gm, "") # remove semicolons | |
.replace(/@(\w+):(\ *)\ /g, (_, $1, $2) -> # replace @variable: with $variable = | |
"$#{$1}#{$2} = " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{* with helper *} | |
<div id="with-data" data-example="{[a => b]|data}"></div> | |
{* with macro *} | |
<div id="with-data" n:data="example, [a => b]"></div> | |
<script> | |
var data = parseDataJson($('#with-data'), 'example'); | |
// => data == {a: 'b'} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Doctrine\ORM\Query\Filter; | |
abstract class SQLFilter | |
{ | |
final public function __construct(Connection $conn); | |
final function setParameter($name, $value, $type); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Avalon CMS | |
* | |
* Copyright (c) 2010 Vaclav Vrbka (http://www.php-info.cz) | |
*/ | |
namespace Avalon\Application; | |
use Avalon, Nette; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* PHP-in' CMS Framework | |
* | |
* Copyright (c) 2010 Vaclav Vrbka (http://www.php-info.cz) | |
* | |
* This source file is subject to the "PHP-in' CMS Framework licence". | |
* For more information please see http://www.phpin.eu | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class GravatarPresenter extends \Nette\Application\UI\Presenter | |
{ | |
public function actionDefault($email, $size = 80) | |
{ | |
$this->sendResponse(new GravatarResponse($email, $size)); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# My first shell script :) | |
# Backup domains directories and MySQL database. | |
clear | |
# CONFIGURATION | |
MODE_D="0740" | |
MODE_F="0640" | |
DAY=$(date +%F) # YYYY-MM-DD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 |
NewerOlder