This file contains hidden or 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
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"> | |
<?php | |
function calculate_median($arr) { | |
sort($arr); | |
$count = count($arr); //total numbers in array | |
$middleval = floor(($count-1)/2); // find the middle value, or the lowest middle value | |
if($count % 2) { // odd number, middle is the median | |
$median = $arr[$middleval]; | |
} else { // even number, calculate avg of 2 medians |
This file contains hidden or 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 | |
/** | |
* signaly.cz - christian community platform | |
* MIT license | |
* | |
* @link https://www.signaly.cz | |
*/ | |
namespace Signaly; |
This file contains hidden or 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 TestIterator implements \IteratorAggregate | |
{ | |
public function getIterator() | |
{ | |
return new ArrayIterator(array(1, 2, 3)); | |
} | |
} |
This file contains hidden or 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 | |
$user = $connection->repository('user')->get(1); | |
// $user instanceof Row | |
$users = $connection->repository('user')->query()->where('id in ?', [1, 2, 3]); | |
// $users instanceof SqlBuilder | |
$users = $connection->repository('user')->query()->where('id in ?', [1, 2, 3])->getSelection(); | |
// $users instanceof Selection |
This file contains hidden or 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
CREATE TABLE book ( | |
id serial NOT NULL, | |
author_id int NOT NULL, | |
translator_id int, | |
title varchar(50) NOT NULL, | |
PRIMARY KEY (id) | |
); | |
CREATE TABLE book_tag ( | |
book_id int NOT NULL, |
This file contains hidden or 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
$('.ameta').each(function() { | |
var i = $(this).find('.a').text(); | |
i = i.substring(0, i.length - 3).replace(',',''); | |
var d = $(this).find('.d').text(); | |
d = d.substring(0, d.length - 3).replace(',',''); | |
$(this).parents('li').data('rank', i - d); | |
}); | |
var l = $('.contrib-data'); | |
var list = l.find('li').sort(function(a,b){ return $(b).data('rank') - $(a).data('rank'); }); | |
l.find('li').remove(); |
This file contains hidden or 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
``` | |
```abc | |
``` |
This file contains hidden or 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
@echo off | |
if "%PHPBIN%" == "" set PHPBIN=php.exe | |
"%PHPBIN%" "C:/Program Files (x86)/wamp/bin/php/php5.4.6/composer.phar" %* |
This file contains hidden or 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
alias gui='git gui&' | |
alias gitk='gitk --all &' | |
source /c/dev/git-bash-tools/completion.bash # find it in your git installation path | |
hg_ps1() { | |
hg prompt "{ {branch}}{ at {bookmark}}{{status}}" 2> /dev/null | |
} | |
function color_my_prompt { |
This file contains hidden or 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 | |
/** | |
* @license MIT license | |
*/ | |
namespace Nextras; | |
use Nette, | |
Nette\Latte, | |
Nette\Latte\MacroNode, |