Skip to content

Instantly share code, notes, and snippets.

View robertscherer's full-sized avatar

Robert Scherer robertscherer

View GitHub Profile
SELECT s.* FROM services s
INNER JOIN (
SELECT st.service_id FROM services_typetags st
INNER JOIN services s ON s.id = st.service_id
INNER JOIN typetags t ON t.id = st.typetag_id
WHERE t.id IN (8, 9, 11)
GROUP BY st.service_id
HAVING COUNT(st.service_id) = 3
) ss
ON s.id = ss.service_id
App.Controllers.InstallationConfigurationsIndexController = Frontend.AppController.extend({
_installation: null,
startup: function() {
// This variable has been assigned from the CakePHP Controller action.
this._installation = this.getVar('installation');
this.$('.btn-add-fixture').click(this._onAddFixture.bind(this));
},
_onAddFixture: function() {
var url = {
controller: 'InstallationConfigurations',
<?php
Router::defaultRouteClass('Route');
Router::scope('/', function ($routes) {
/**
* Here, we are connecting '/' (base path) to a controller called 'Pages',
* its action called 'display', and we pass a param to select the view file
* to use (in this case, src/Template/Pages/home.ctp)...
*/
$routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']);
@robertscherer
robertscherer / gist:1386d3f2a2b55a087789
Created September 5, 2014 08:36
CakePHP 3 Query Update
<?php
$updateQuery = $this->query();
$updateQuery->update();
$updateQuery->set([
'workerkey' => $key,
'fetched' => date('Y-m-d H:i:s')
]);
$updateQuery->where($where);
$updateQuery->limit(1);
$updateQuery->order([
public function saveSitemap($tree, $parent_id = null, $sort = 0) {
$this->begin();
foreach($tree as $element) {
if(isset($element['children'])) {
$this->saveSitemap($element['children'], $element['id'], $sort);
}
// Save parent_id and sort
if (!$this->updateField($element['id'], 'parent_id', $parent_id)
|| !$this->updateField($element['id'], 'sort', ++$sort)
|| !$this->updatePageUrls()) {
22:11:21 T:140281073633152 NOTICE: -----------------------------------------------------------------------
22:11:21 T:140281073633152 NOTICE: Starting XBMC (12.2 Git:Unknown), Platform: Linux (Ubuntu 12.10, 3.5.0-46-generic x86_64). Built on May 13 2013
22:11:21 T:140281073633152 NOTICE: special://xbmc/ is mapped to: /usr/share/xbmc
22:11:21 T:140281073633152 NOTICE: special://xbmcbin/ is mapped to: /usr/lib/xbmc
22:11:21 T:140281073633152 NOTICE: special://masterprofile/ is mapped to: /home/mediabitch/.xbmc/userdata
22:11:21 T:140281073633152 NOTICE: special://home/ is mapped to: /home/mediabitch/.xbmc
22:11:21 T:140281073633152 NOTICE: special://temp/ is mapped to: /home/mediabitch/.xbmc/temp
22:11:21 T:140281073633152 NOTICE: The executable running is: /usr/lib/xbmc/xbmc.bin
22:11:21 T:140281073633152 NOTICE: Local hostname: mediabitch
22:11:21 T:140281073633152 NOTICE: Log File is located: /home/mediabitch/.xbmc/temp/xbmc.log
@robertscherer
robertscherer / xbmc.log
Created February 22, 2014 17:09
XBMC Samsung UE55F6500 Log
18:03:44 T:140466308765568 NOTICE: -----------------------------------------------------------------------
18:03:44 T:140466308765568 NOTICE: Starting XBMC (12.2 Git:Unknown), Platform: Linux (Ubuntu 12.10, 3.5.0-46-generic x86_64). Built on May 13 2013
18:03:44 T:140466308765568 NOTICE: special://xbmc/ is mapped to: /usr/share/xbmc
18:03:44 T:140466308765568 NOTICE: special://xbmcbin/ is mapped to: /usr/lib/xbmc
18:03:44 T:140466308765568 NOTICE: special://masterprofile/ is mapped to: /home/mediabitch/.xbmc/userdata
18:03:44 T:140466308765568 NOTICE: special://home/ is mapped to: /home/mediabitch/.xbmc
18:03:44 T:140466308765568 NOTICE: special://temp/ is mapped to: /home/mediabitch/.xbmc/temp
18:03:44 T:140466308765568 NOTICE: The executable running is: /usr/lib/xbmc/xbmc.bin
18:03:44 T:140466308765568 NOTICE: Local hostname: mediabitch
18:03:44 T:140466308765568 NOTICE: Log File is located: /home/mediabitch/.xbmc/temp/xbmc.log
var PX = require('com.pixate.framework');
PX.styleSheetFromFilePathWithOrigin({
monitor: true,
origin: 0,
filename: '/path/to/file.css'
});
PX.styleSheetFromFilePathWithOrigin({
monitor: true,
origin: 0,
filename: '/path/to/second_file.css'
@robertscherer
robertscherer / gist:6852107
Created October 6, 2013 10:14
Titanium build output with com.pixate.pxengine 2.0.0RC1
This file has been truncated, but you can view the full file.
nanomac:KetchupMobile nano$ titanium clean
Titanium Command-Line Interface, CLI version 3.1.2, Titanium SDK version 3.1.3.GA
Copyright (c) 2012-2013, Appcelerator, Inc. All Rights Reserved.
Please report bugs to http://jira.appcelerator.org/
[DEBUG] No project level plugins to load
[DEBUG] Loaded plugin hooks:
[DEBUG] /Users/nano/Library/Application Support/Titanium/mobilesdk/osx/3.1.3.GA/cli/hooks/plugins.js
[DEBUG] Deleting all platform build directories
SIMULATOR
http://m.banner.t-online.de/adsdk/3.0/784.1/0/0/-1/adtech;alias=fan_mobil_iphone_match-radar_sticky-top-5;kvappn=Fantomic;appguid=F38539E8-B21F-4DA5-B58B-A091ED0CE79C;kvmversion=5;sdkversion=3_2_1;connectiontype=wifi;devicemodel=x86_64;screenwidth=320;screenheight=480;screendensity=1.0;kvmflash=false;kvcheckin=;kvleagueid=;kvplaytime=;kvage=;kvlon=0.000000;kvlat=0.000000;kvevent=;random=696D319B-9D59-49EE-A8E9-14E101DEC7D0;tagType=banner;grp=3879
{"offlineEnabled":"0","refreshInterval":"0","adSnippet":"document.write(\"<a href=\\\"http://m.banner.t-online.de/adtechclick?host=adserver.adtech.de&rest=/adlink/784/4514933/0/3055/kvmRptAl=fan_mobil_iphone_match-radar_sticky-top-5;kvmRptWd=320;kvmRptHt=480;kvmRptNk=784.1;AdId=7317445;BnId=4;guid=F38539E8-B21F-4DA5-B58B-A091ED0CE79C;itime=309608129;key=rld-APPLE_IPHONE;nodecode=yes;link=http://www.interactivemedia.net\\\" target=\\\"_blank\\\"><img src=\\\"http://aka-cdn-ns.adtech.de/apps/453/Ad7317445St3Sz3055Sq103545673V2Id4/0320x0150_de_expandable.jpg\