Instantly share code, notes, and snippets.

View lambda.php
<?php
->addCondition(function() use ($form) {
return ...; //true nebo false
})
View example.php
<?php
1)
$videoLength = $video->addText('videoLength', 'Délka videa');
$videoLength->addConditionOn($form['article-published'], Form::EQUAL, TRUE)
->setRequired();
$videoLength->addCondition(Form::FILLED)
->addRule(Form::PATTERN
View 1
<?php
View MySQL delete dupes on multiple columns.sql
--Find Duplicates
SELECT t.ID, t.id_A, t.id_B
FROM (
SELECT id_A, id_B
FROM table_name
GROUP BY id_A, id_B
HAVING count(*) > 1
) x, table_name t
WHERE x.id_A = t.id_A AND x.id_B = t.id_B
View index.html
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Rating panel via CSS 3 & jQuery">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<style id="jsbin-css">
View some-component-default.latte
{control footerContactForm templateConfig => ['btn_contact_form' => $data->btn_contact_form != '' ? $data->btn_contact_form : 'Odeslat dotaz']}
View jquery plugin function expression v2
1/
(function($){
$.extend({
jYoutube: function( url, size ){
if(url === null){ return ""; }
size = (size === null) ? "big" : size;
var vid;
var results;
results = url.match("[\\?&]v=([^&#]*)");
vid = ( results === null ) ? url : results[1];
View demo.js
1)
var Abc = function(aProperty,bProperty){
this.aProperty = aProperty;
this.bProperty = bProperty;
this.init = function(){
// Do things here.
}
this.init();
};
var currentAbc = new Abc(obj,obj);
View DateTime.php
<?php
namespace MyNamespace;
$date = new ADateTime('2018-03-28');
$date->sub(new \DateInterval('P1M'));
echo $date->format('Y-m-d') . "\n";
View closure.html
<p id="demo">0</p>
<script>
var add = (function () {
var counter = 0;
return function () {return counter += 1;}
})();
function myFunction(){
document.getElementById("demo").innerHTML = add();