Skip to content

Instantly share code, notes, and snippets.

View julianwachholz's full-sized avatar
🤓

Julian Wachholz julianwachholz

🤓
View GitHub Profile
<?php
function _applyPlugin($function, $args) {
foreach ($this->plugins as $plugin) {
if (method_exists($plugin, $function)) {
switch (count($args)) { // call_user_func_array() doesn't work well with references
case 0: $return = $plugin->$function(); break;
case 1: $return = $plugin->$function($args[0]); break;
case 2: $return = $plugin->$function($args[0], $args[1]); break;
case 3: $return = $plugin->$function($args[0], $args[1], $args[2]); break;
case 4: $return = $plugin->$function($args[0], $args[1], $args[2], $args[3]); break;
<?php
$SQL = "INSERT INTO `productgroups` ";
$SQL .= "( ";
$SQL .= "`xmlid`,";
$SQL .= "`lang`,";
$SQL .= "`title`";
$SQL .= ") ";
$SQL .= "VALUES ( ";
$SQL .= "'".mysql_real_escape_string($_POST['group']['xmlid'])."', ";
$SQL .= "'".mysql_real_escape_string($_POST['group']['lang'])."', ";
@julianwachholz
julianwachholz / GroupsRepository.php
Last active December 16, 2015 01:09
Mind you, most of this does absolutely nothing or could be rewritten in two lines.
<?php
/**
* Explodes an XPath into an Array / only 2 Levels
* @param array $xpath
* @param boolean $utf8Encode
* @return array
*/
private function titleExploder($xpath, $utf8Encode = TRUE) {
$exTitle = explode('/', $xpath);
<?php
use ActionController; // etc..
/**
* Example controller
*/
class EventController extends ActionController {
public function invitePeopleFormAction(SearchForm $searchForm = NULL) {
// check individual properties of $searchForm, e.g. $searchForm->getEvent()
{% compress js %}
<script src="/static/coffee/app.coffee" type="text/coffeescript" charset="utf-8"></script>
{% endcompress %}
@julianwachholz
julianwachholz / HsgCrm.php
Created May 14, 2013 08:52
you've got to be fucking kidding me.
if (is_array($soapResultObject->Body->ExecuteResponse->ExecuteResult->Results->KeyValuePairOfstringanyType->value->Entities->Entity)) {
foreach ($soapResultObject->Body->ExecuteResponse->ExecuteResult->Results->KeyValuePairOfstringanyType->value->Entities->Entity as $entity) {
$entities_array[] = $this->findByUid($entity->LogicalName->LogicalName, $entity->Id->Id, $convertToClass);
}
} elseif (isset($soapResultObject->Body->ExecuteResponse->ExecuteResult->Results->KeyValuePairOfstringanyType->value->Entities->Entity)) {
$entity = $soapResultObject->Body->ExecuteResponse->ExecuteResult->Results->KeyValuePairOfstringanyType->value->Entities->Entity;
$entities_array[] = $this->findByUid($entity->LogicalName->LogicalName, $entity->Id->Id, $convertToClass);
}
jsoncontactlist = PAGE
jsoncontactlist {
10 = USER_INT
10 {
userFunc = Tx_Extbase_Core_Bootstrap->run
extensionName = hsgtalents
pluginName = message
controller = Message
controllerConfiguration {
Message = findRecipients
import sys
from tcunittest import TeamcityTestRunner
from tcmessages import TeamcityServiceMessages
from pycharm_run_utils import adjust_django_sys_path
from nose_utils import TeamcityNoseRunner
adjust_django_sys_path()
activation_link = user.registrationprofile.get_absolute_url()
self.assertIn(activation_link, mail.outbox[0].body)
def has_verified_email(self):
try:
verification = self.emailverification
except EmailVerification.DoesNotExist:
return True
return verification.is_verified()
has_verified_email.boolean = True