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
#### OSX etc #### | |
.DS_Store* | |
Icon? | |
Thumbs.db | |
ehthumbs.db | |
*.swp | |
*.out | |
/nbproject/ | |
*.lock | |
*~ |
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 | |
$cacheId = 'xyz'; | |
$cacheDriver = new \Doctrine\Common\Cache\ApcCache(); | |
if ($cacheDriver->contains($cacheId)) { | |
return $cacheDriver->fetch($cacheId); | |
} |
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 MyStuff\Imagick; | |
/** | |
* Option 1: My Imagick extending the original one with custom methods | |
*/ | |
class Imagick extends \Imagick | |
{ | |
public function customMethod($param) |
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
/** | |
* Mierzy wysokość tekstu na podstawie specyfikacji css: font. | |
* Przykład: MMG.getTextHeight("italic bold 13em Arial"); | |
* | |
* @param string font CSSowa specyfikacja czcionki | |
* @return integer Wysokość linii tekstu w pikselach | |
*/ | |
MMG.getTextHeight = function(font) { | |
var text = $('<span style="font: ' + font + '">Hg</span>'); | |
var block = $('<div style="display: inline-block; width: 1px; height: 0px;"></div>'); |
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
<span data-bind="foreach: textVerticalTrimOptions"> | |
<button data-bind=" | |
text: name, | |
value: value, | |
click: $parent.setTextVerticalTrim | |
"></button> | |
</span> | |
<script> | |
VM = function() { |
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
var isFinished = old < button.value ? function() { | |
return i <= button.value; | |
} : function() { | |
return i >= button.value; | |
}; |
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
(function(window) { | |
// is calling a function on this "local" window faster | |
window.parseInt("17"); | |
// then calling it as a global function? | |
parseInt("17"); | |
})(window); |
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
$('#form').submit(function() { | |
/* This is a callback that some lib file is doing before the form is submitted. | |
* My goal is not to modify it */ | |
}); |
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
ko.bindingHandlers.canvasContext = { | |
init: function(element, valueAccessor, allBindingsAccessor, viewModel) { | |
if ("undefined" === typeof viewModel.__canvasContexts__) { | |
viewModel.__canvasContexts__ = []; | |
} | |
// works now :) | |
if ("function" !== typeof element.getContext && FlashCanvas) { | |
FlashCanvas.initElement(element); | |
} |
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
{% extends 'MyBundle::layout.html.twig' %} | |
{% form_theme edit_form _self %} | |
{% set someVariable = 'abc' %} | |
{% block _myformname_myfield_widget %} | |
{{ block('form_widget') }} | |
{{ someVariable }} | |
{% endblock %} |
OlderNewer