Instantly share code, notes, and snippets.

View coc.md

FOLLOW THE FUCKING LAW CODE OF CONDUCT Version 1, February 2016

Copyright (C) 2016

Everyone is permitted to copy and distribute verbatim or modified copies of this code of conduct, and changing it is allowed as long as the name is changed.

      FOLLOW THE FUCKING LAW CODE OF CONDUCT

OUTLINE OF EXPECTATIONS FOR ACCEPTABLE BEHAVIOR BY COMMUNITY MEMBERS

View gist:2b199b9ae22a2a3526e1
<?php
public function addhw() {
$array=array(
'hw_name' => $_POST['hw_name'],
'hw_description' =>$_POST['hw_description'],
'hw_model' => $_POST['hw_model'],
'hw_serialno' => $_POST['hw_serialno'],
'hw_manufacturer_id' => $_POST['manufacturer_id'],
View keybase.md

Keybase proof

I hereby claim:

  • I am teresko on github.
  • I am teresko (https://keybase.io/teresko) on keybase.
  • I have a public key whose fingerprint is 5678 6C6E 574C B998 5787 FFD7 995C 977E F9C2 7614

To claim this, I am signing this object:

View short
$args = array(
'post_type' => 'products',
'tax_query' => array(),
);
if(get_field('multi_filter') ) {
$temp = array();
while(has_sub_field('multi_filter')){
$_temp = array(
'taxonomy' => get_sub_field('taxonomy'),
View gist:8bd572cc40baef6304e5
<?php
$tempList = [];
foreach( $images as $image ) {
$tempList[] = "<img src='{$image['sizes']['large']}'>";
}
?>
<script id="images2<?php echo get_the_ID(); ?>" type="text/cycle">
<?php echo json_encode($tempList); ?>
</script>
View gist:4d3dac72909f1ef00abc

Few notes on the subject

  • the three sets of structures from model layer, that you mention, are not the only ones. Only the most common. In larger application you may find, that you also need repositories and units of work. Also I am not entirely sure whether "collection of domain objects" should be mentioned separately or not.

  • there is very little if at all written about ui layer in proper literature. I have found only few snippets from Fowler and that's about it. And most of the content is aimed towards desktop software.

  • controllers do not really do "perform authentication, dispatch requests, render output". Those could be called: external concerns. Your framework/infrastructure supplies the controller with per-processed user input (as arguments or Request class instance) and then controller decides on how to use this input to alter the model layer's state. That's it. The parts that you mentioned before are stuff done in front controller (which is a different from mvc's controller

View gist:ce808ae87e5f0703c44c

Few notes on the subject

  • the three sets of structures from model layer, that you mention, are not the only ones. Only the most common. In larger application you may find, that you also need repositories and units of work. Also I am not entirely sure whether "collection of domain objects" should be mentioned separately or not.

  • there is very little if at all written about ui layer in proper literature. I have found only few snippets from Fowler and that's about it. And most of the content is aimed towards desktop software.

  • controllers do not really do "perform authentication, dispatch requests, render output". Those could be called: external concerns. Your framework/infrastructure supplies the controller with per-processed user input (as arguments or Request class instance) and then controller decides on how to use this input to alter the model layer's state. That's it. The parts that you mentioned before are stuff done in front controller (which is a different from mvc's controller

View gist:3190886
<?php
namespace Application\View;
use Fracture\Presentation\View;
use Fracture\Presentation\Template;
class Profile extends View
{
View gist:2907749
Please, don't use `mysql_*` functions to write new code. They are no longer maintained and the community has begun [deprecation process](http://goo.gl/KJveJ). See the [*red box*](http://goo.gl/GPmFd)? Instead you should learn about [prepared statements](http://goo.gl/vn8zQ) and use either [PDO](http://php.net/pdo) or [MySQLi](http://php.net/mysqli). If you can't decide which, [this article](http://goo.gl/3gqF9) will help you. If you pick PDO, [here is good tutorial](http://goo.gl/vFWnC).