Skip to content

Instantly share code, notes, and snippets.

/*
* jQuery JavaScript Library v1.6.2
* http://jquery.com/
*
* Copyright 2011, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
<?php
class Template {
private $data;
private $fileName;
public function __construct($filename) {
$this->setFileName($filename);
}
class KohanaORMUserRepository implements UserRepositoryInterface{
private $orm;
public function __construct(){
$this->orm = ORM::Factory('user');
}
public function findOneByEmail($email){
$ormUser = $this->orm->where('email','=',$email)->find();
if($ormUser){
$user = new User($ormUser->id,$ormUser->username,$ormUser->passwordHash,$ormUser->email);
return $user;
<?php
//Module.php
namespace CheeseAgent\Core;
use \Silex\ServiceProviderInterface;
use \Silex\Application;
use \Symfony\Component\HttpFoundation\Response;
use \Symfony\Component\HttpFoundation\Request;
use \Symfony\Component\HttpKernel\KernelEvents;
use \CheeseAgent\Core\Value\Gender;
Problem 1
- Installation request for gushphp/gush dev-master -> satisfiable by gushphp/gush[dev-master].
- gushphp/gush dev-master requires gushphp/gush-github-adapter ~1.0 -> no matching package found.
Problem 2
- Installation request for gushphp/gush-github-adapter dev-master -> satisfiable by gushphp/gush-github-adapter[dev-master].
- gushphp/gush-github-adapter dev-master requires gushphp/gush ~1.3 -> no matching package found.
# plasma.py
# plasma fractal
# FB - 201003147
from PIL import Image
import math
import random
# image size
w = 512
h = 512
<?php
function FN_ae2umlaute($string)
{
return(str_replace(array("ae","oe","ue", "Ae","Oe","Ue") , array("ä","ö","ü", "Ä","Ö","Ü") ,$string));
}
$fp=fopen("soldatenvars.txt","r");
if($fp)
{
<?php
/**
* Klasse Farbrechner
* Berechnet aus den Farb-Gencodes der Eltern den Gencode des Fohlens
*/
class Farbrechner {
/**
<?php
$action = new KillACat();
$request = new KillACatRequest(3);
$response = $action->process($request);
echo $response->killedCats
@BlackScorp
BlackScorp / clean_code.md
Last active January 29, 2020 19:15
clean code

#once upon a time...

there was a developer, he had to realize a nice clean greenfield project with any framework he like.

He had no idea which PHP Frameworks were outside there and after a small research he decide to use Kohana 3.2 because at this time this was the only one framework which the developer could understand and use.

after 9 months of developing the project was born and launched. the developer realized that a new version of the Kohana framework was released, it was a minor release.

one small simple update to Kohana 3.3 and the entire project was broken, he reverted the framework update.