Skip to content

Instantly share code, notes, and snippets.

View tobiastom's full-sized avatar

Tobias Tom tobiastom

View GitHub Profile
<?php
class securehasing {
public static function registerImplementation($alias, $class) {}
public static function instanceForImplementation($alias = 'sha512') {}
}
interface securehasing_interface {
public function random($length = 12);
<?php
class A {
public function foo() {
B::baz();
}
}
class B {
static public function baz() {
<form action="/~tobias/Support.webapp/Public/profile.;update" method="post">
<dl>
<dt>Name</dt>
<dd><input type="text" name="name" value="Tobias Tom" /></dd>
<dt>Email</dt>
<dd><input type="text" name="email" value="t.tom@succont.de" /></dd>
</dl>
<p><input type="checkbox" id="passwordInterfaceOption" onchange="document.getElementById('passwordInterface').style.display=this.checked?'block':'none';" />
<label for="passwordInterfaceOption">I would like to change my password</label></p>
public function deleteAction($identifier) {
$this->user = \User\User::instanceWithId($identifier);
if (!$this->user) {
return self::NotFoundStatus;
}
if ($this->request->isConfirmed()) {
$this->user->delete();
$this->response->layoutVariant = 'Successful';
return self::DeletedStatus;
curl -i http://127.0.0.1/~tobias/Support.webapp/Public/user/2.;
HTTP/1.0 200 Ok
Date: Fri, 11 Sep 2009 18:29:47 GMT
Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8k DAV/2 PHP/5.3.0
X-Powered-By: PHP/5.3.0
Content-Language: en
Last-Modified: Fri, 11 Sep 2009 19:12:07 CEST
Content-MD5: e4dc2f4198ca5481ce3cce68abd761bd
public function generatePasswordAction($identifier, $sendByEmail = false) {
$this->user = \User\User::instanceWithId($identifier);
if (!$this->user) {
return self::NotFoundStatus;
}
if ($this->request->isConfirmed()) {
$this->user->password = $this->password = \User\User::generateRandomPassword();
$this->user->save();
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL|E_STRICT);
$xml = <<<XML
<html xmlns:s="http://succont.com">
<head>
<title s:content="title" />
</head>
beaver:1.3 tobias$ phploc ./
phploc 1.2.0 by Sebastian Bergmann.
Directories: 1696
Files: 4813
Lines of Code (LOC): 751611
Comment Lines of Code (CLOC): 322498
Non-Comment Lines of Code (NCLOC): 429113
dispatch_apply(count, dispatch_get_global_queue(0, 0), ^(size_t i){
results[i] = do_work(data, i);
});
total = summarize(results, count);
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <dispatch/dispatch.h>
int main(void) {
dispatch_queue_t the_queue = dispatch_get_concurrent_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT);
size_t iterations = 100;