Skip to content

Instantly share code, notes, and snippets.

View gist:828f1efa5051865bb893
require.config({
baseUrl:'/js/Dash',
shim: {
backbone: {
deps: [
"underscore",
"jquery"
],
exports: "Backbone"
},
View gist:e53bd9bed89ee519f716
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2)
Active: failed (Result: exit-code) since Thu 2015-05-14 11:50:34 EDT; 6min ago
Process: 5837 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)
@mergeweb
mergeweb / Field Options
Last active Aug 29, 2015
ACF Fields Repeatable
View Field Options
{
"id":"whitepaper_acf",
"title":"Whitepaper ACF",
"location":[
[
{
"param":"post_type",
"operator":"==",
"value":"upnup-whitepapers",
"order_no":0,
View gist:4bcb39bffad148141f08
<table cellspacing="0" cellpadding="0" class="gstl_50 gssb_c" style="width: 599px; top: 485px; position: absolute; text-align: left; /* display: none; */ left: 34px;" dir="ltr">
<tbody>
<tr>
<td class="gssb_f"></td>
<td class="gssb_e" style="width: 100%;">
<table cellspacing="0" cellpadding="0" class="gsc-completion-container" style="width: 100%;">
<tbody>
<tr class="">
<td class="gssb_a " dir="ltr" style="text-align: left;">
<div class="gsq_a">
View gist:59459f6124527e3ba80f
function create_post_types() {
register_post_type('degrees-and-programs', [
'labels' => [
'name' => 'Degrees and Programs',
'all_items' => 'All Degrees/Programs'
],
'public' => true,
'has_archive' => true,
'rewrite' => ['slug' => 'degrees-and-programs'],
'hierarchical' => true,
View test.php
<?php
App::uses('PwfSource', 'Model/Datasource');
App::uses('Model', 'Model');
public function setUp() {
$this->Source = ClassRegistry::init('PwfSource');
$this->sourceMethods = get_class_methods($this->Source);
$methods = array_diff($this->sourceMethods, ['read', '__call', '__isset', '__get']);
$this->Source = $this->getMock('PwfSource', $methods);
View gist:4cad0747c90f9b5ab729
<?php
$this->Source = $this->getMock('PwfSource');
ConnectionManager::create($this->sourceName, array(
'datasource' => get_class($this->Source),
));
$this->Model = $this->getMock(
'PwfTask',
array('getDataSource'),
View request.js
Request = {
send: function (options) {
this.options.success = this.success.bind(this);
this.options.error = this.error.bind(this);
this.options = _.extend(this.options, options)
return this.request(this.options);
},
request: function (options){
return new Promise(function (resolve, reject){
// Do the usual XHR stuff
View stuff.js
this.beforeSave()
.then(this.send.bind(this))
.then(this.success.bind(this))
.then(this.afterSave.bind(this))
// Error validation shown in page
.catch(function(error){
// HERE IS WHERE I WANT THE DEFAULT HTML5 ERRORS TO SHOW
// This will be called if any of the above promises throw an error
})
.then(this.enable_save.bind(this))
View gist:99699b30d816e2710bdf
if (isset($attachment['transformers'][$class])) {
return new $attachment['transformers'][$class]($options);
}