Skip to content

Instantly share code, notes, and snippets.

use Silex\Application;
use Silex\CallbackResolver;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Event\KernelEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\KernelEvents;
<?php
$hh = $id['act'];
//на сколько надо сместить массив
for ($i = 0; $i++ < $hh;) {
$arr = array_shift($ff);
$ff[] = $arr;
}
//смещение массива и вставка в конец массива
function voin($attackerId, $targetId, $counter)
<?php
$data = array(0 => array('gods' => '', 'ser' => '9068', 'group2' => 'pusto', 'zol' => '1000', 'op' => '447', 'id' => '1', 'fro' => 'users', 'gods1' => '0', 'login' => 'Xtra Strong', 'inc' => '10', 'pit' => 'Тьма', 'pit1' => 'Прыть', 'xp2' => '60', 'inte' => '23', 'xp' => '60', 'class' => 'Маг', 'urn' => '30', 'brn' => '14', 'murn' => '15', 'back' => '1', 'sth' => 'Огонь', 'uvr' => '8', 'krt' => '8', 'blc' => '7', 'tch' => '4', 'udh' => '0',), 1 => array('login' => 'Тьма', 'id' => '38', 'fro' => 'pit', 'inc' => '10', 'xp2' => '70', 'class' => 'Воин', 'urn' => '60', 'brn' => '10', 'murn' => '0', 'xp' => '70', 'inte' => '0', 'back' => '1', 'uvr' => '10', 'krt' => '10', 'blc' => '0', 'tch' => '10', 'udh' => '5', 'sth' => '',), 2 => array('login' => 'Прыть', 'id' => '37', 'fro' => 'pit', 'inc' => '7', 'xp2' => '100', 'murn' => '0', 'inte' => '0', 'back' => '1', 'uvr' => '5', 'xp' => '100', 'krt' => '7', 'blc' => '0', 'tch' => '15', 'udh' => '10', 'class' => 'Воин', 'urn' => '40', 'brn' => '30', 'sth' => '',)
@BlackScorp
BlackScorp / object.php
Last active August 29, 2015 14:22
Refactoring legacy code step by step
<?php
session_start();
require_once('./global.php');
exec_header();
//$bgEngine->gamenavigation->siteCheck("object.php");
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : null;
$gameField = isset($bgEngine->gamefields->usergamefield[$id]) ? $bgEngine->gamefields->usergamefield[$id] : '';
@BlackScorp
BlackScorp / webworks.php
Last active August 29, 2015 14:23
refactoring legacy code part2
<?php
include("./include/config2.inc.php3");
include("$tools_dir/class.FastTemplate.php3");
/* Get Cookie und decrypt */
$admin_pass_enc = $HTTP_COOKIE_VARS["$cookiepassword"];
$admin_nick_enc = $HTTP_COOKIE_VARS["$cookienickname"];
$admin_pass = base64_decode($admin_pass_enc);
Keyboard = function(){
this.keys = {
'BACKSPACE': 8,
'TAB': 9,
'ENTER': 13,
'PAUSE': 19,
'CAPS': 20,
'ESC': 27,
'SPACE': 32,
'PAGE_UP': 33,
var Isometric = function(tw,th,mw,mh){
this._tile.width = parseInt(tw);
this._tile.height = parseInt(th)||parseInt(tw)/2;
this._tile.r = this._tile.width / this._tile.height;
this._map.width = parseInt(mw);
this._map.height = parseInt(mh) || parseInt(mw);
var Isometric = function(tw,th,mw,mh){
this._tile.width = parseInt(tw);
this._tile.height = parseInt(th)||parseInt(tw)/2;
this._tile.r = this._tile.width / this._tile.height;
this._map.width = parseInt(mw);
this._map.height = parseInt(mh) || parseInt(mw);

IT in der Gesellschaft

Neulich frage mich meine jüngere Schwester "Was machst du eigentlich Beruflich? Ich muss immer den anderen die Antwort geben: Irgendwas mit PC" Mit der Antwort "Fachinformatiker Anwendungsentwickler" konnte sie jedoch nichts anfangen.

Es gibt viele Berufe die kaum Einer kennt, schließlich kommt man nicht oft mit den Berufen in Kontakt. In der IT sieht es aber ganz anders aus. Überall gibt es software, sei es der Toaster mit einem Display oder das eigene Auto und dennoch ist die IT für viele "Neuland". Da stellt man sich doch die Frage, wieso eigentlich?

Erste Kontakte

In der 9en Klasse sollte ich auf das Berufsleben vorbereitet werden, damals war mir klar, beruflich will ich "irgendwas am PC" machen. Um mich zu erkundigen hatte ich ein Termin bei einem Berufsberater in der lokalen Arbeitsagentur, nach einem längeren Gespräch empfiehlte er mir ein Praktikum als "Elektroinstallateur" zu absolvieren. Eine Woche lang musste ich Kabel verlegen in einer Kläranlage, ein PC habe ich

<?php
interface BarRepository{
public function findByFoo($foo) : BarEntity[]
}
class BarRepositoryImplementation implements BarRepository{
public function findByFoo($foo): BarEntity[]
{
//Some SQL or other things