This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function returnsFieldsAsAttributes() { | |
if (empty($this->_result) || empty($this->_field_map)) { | |
return $this->_result; | |
} | |
$field_map = $this->_field_map; | |
$this->withFieldMap(); | |
$this->forModel(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* CakePHP 2.x -- add this code to a controller and then access the controller's route from the browser. | |
* This allows you to trigger shells through the browser, so that you can use xdebug if it cannot be accessed | |
* through the command line | |
*/ | |
App::uses('ShellDispatcher', 'Console'); | |
public function index() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('wizehive.resources', ['ngResource', 'wizehive.auth']) | |
.factory('Data', ['$rootScope', '$http', '$q', '$resource', 'Auth', 'PluginEvents', function($rootScope, $http, $q, $resource, Auth, PluginEvents) { | |
var _apiBaseUrl = wizehive.config('constants').API_URL || ''; | |
/* ... */ | |
function beforeFilter(params) { | |
params = _flattenObject(params); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* DO NOT MODIFY THIS FILE! IT'S FOR LOCAL USE ONLY! */ | |
app.uses(function(req, resp, next) { | |
var httpRequest = require('httpRequest'); | |
httpRequest.setAccessToken(req.headers.accessToken); | |
delete req.headers.accessToken; | |
var eventData = {}; | |
eventData.request = { | |
headers: req.getHeaders(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
znRecordOverlay.open({ | |
onSubmit: function(submittedData, onComplete) { | |
var newRecord = {}; | |
angular.extend(newRecord, submittedData); | |
console.log(newRecord.id); // error | |
$scope.recordList.push(submittedData); | |
onComplete.then(function(serverData) { | |
// each onSave and "included" onComplete promise are connected by being in closure together | |
// you can have as many as you want and they won't interact with each other | |
angular.extend(newRecord, serverData); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Plugin many lines 2 Controller | |
*/ | |
plugin.controller('manyLines2Cntl', ['$scope', function ($scope) { | |
$scope.text = 'Hello World!'; | |
var data = [ | |
'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', | |
'Duis a lorem id felis hendrerit facilisis.', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){var i=$('body').injector().get;window.$rootScope=i('$rootScope');window.Data=i('Data');window.getService=i;console.log('Services set in console');})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myGlobal = 'I am accessible!'; // global var | |
(function(window) { | |
console.log('Without clearing anything'); | |
console.log(window.myGlobal); // 'I am accessible!' | |
console.log(myGlobal); // 'I am accessible!' | |
})(window); | |
(function(window) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('wizehive.services') | |
.service('PluginEvents', ['$rootScope', '$timeout', function($rootScope, $timeout) { | |
var scopes = { | |
// This would be set up dynamically, maybe by plugin directive? | |
'action-panel-top': $rootScope.$new(false), | |
'top-nav': $rootScope.$new(false) | |
}; | |
return function(location) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'curl' . DIRECTORY_SEPARATOR . 'curl.php'; | |
$Curl = new Curl(); | |
// This is called once, after we get a code back | |
if (!empty($_GET['code'])) { | |
// Make sure there wasn't an error authenticating | |
if (!empty($_GET['error'])) { |
NewerOlder