Skip to content

Instantly share code, notes, and snippets.

View Akii's full-sized avatar
🚀
To the Moon

Akii

🚀
To the Moon
View GitHub Profile
@Akii
Akii / gist:3381588
Created August 17, 2012 18:59
My custom statement
SELECT * FROM tx_spreise_domain_model_reise r JOIN tx_spreise_domain_model_tour t ON(r.tour = t.uid)
WHERE t.schiff = '1' AND t.land = '1' AND r.anfang <= '1345154400' AND r.ende >= '1345154400' AND (r.max - r.belegt) >= '1' AND r.hidden = 0 AND r.deleted = 0 AND t.hidden = 0 AND t.deleted = 0
@Akii
Akii / gist:4276196
Created December 13, 2012 12:55
Internal controller request.
$controller = new \TYPO3\PackageBuilder\Strategy\TYPO3Flow\Controller\StrategyController();
$request = new \TYPO3\Flow\Http\Request(array(), array(), array(), array());
$actionRequest = $request->createActionRequest();
$actionRequest->setControllerPackageKey('TYPO3.PackageBuilder');
$actionRequest->setControllerActionName('lol');
$actionRequest->setArgument('package', array());
$controller->processRequest($actionRequest, new \TYPO3\Flow\Http\Response());
@Akii
Akii / dummy.json
Created December 27, 2012 09:45
Dummy.json derzeit noch ohne Actions, Relations.
{
"identifier":"TYPO3.TestThingy",
"type":"TYPO3.PackageBuilder:Package",
"label":"Package Name",
"description":"A description of the Package.",
"children":{
"0":{
"type":"TYPO3.PackageBuilder:Container",
"identifier":"DomainObject",
"label":"DomainObjects",
$resultArray = array();
foreach ($data as $object){
$resultArray[] = array(
'firm' => $object->getFirma(),
'anschr' => $object->getAnschrift()
);
}
$this->view->assign('json', json_encode($resultArray));
/**
* Returns the value of the Value Object. Must be overwritten by a concrete value object.
*
* @return void
*/
public function getValue() {
return $this->__toString();
}
class Money {
protected $amount;
public function __construct($amount) {
$this->amount = $amount;
}
public function subtract($amount) {
return new Money($this->amount - $amount);
}
$hashSource = $proxyClassName;
foreach ($hashSourceParts as $hashSourceKey => $hashSource) {
$hashSource .= $hashSourceKey . ':' . $hashSource;
}
@Akii
Akii / getResources
Created February 3, 2014 19:50
How to iterate through images in the resource tab of the page.
lib.slideshow = COA
lib.slideshow {
10 = TEXT
10.data = levelmedia:-1, slide
10.split {
token=,
cObjNum=1
1 {
1 = IMG_RESOURCE
1 {
// SERVER_NAME is a defined constant
// Create dictionary of search parameters
NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys:(__bridge id)(kSecClassInternetPassword), kSecClass, SERVER_NAME, kSecAttrServer, kCFBooleanTrue, kSecReturnAttributes, nil];
// Remove any old values from the keychain
OSStatus err = SecItemDelete((__bridge CFDictionaryRef) dict);
// Create dictionary of parameters to add
NSData* passwordData = [credentials.password dataUsingEncoding:NSUTF8StringEncoding];
@Akii
Akii / setup.txt
Created May 20, 2014 11:34
Ajax Extbase
ajax_page = PAGE
ajax_page {
typeNum = 1400579457
config {
disableAllHeaderCode = 1
xhtml_cleaning = 0
admPanel = 0
debug = 0
no_cache = 1
additionalHeaders (