Skip to content

Instantly share code, notes, and snippets.

<div class="container">
<form>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="customSwitch1">
<label class="custom-control-label" for="customSwitch1">Toggle this switch element</label>
</div>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" disabled id="customSwitch2">
<label class="custom-control-label" for="customSwitch2">Disabled switch element</label>
</div>
$.ajax({
url: formUrl,
success: function (data) {
console.log(data);
if (data.success) {
$deleteButton.parent().parent().parent().remove();
} else {
alert('Could not delete Material');
}
}
<?php
$entities = $this->Servers->find()
->contain('Defines', function($q) use ($service) {
return $q
->contain(['Environments', 'Services'])
->where(['Environments.name' => $this->envName])
->where(['Services.name' => $service]);
});
$entities = $this->Servers->find()
<p>{MAIN_COMPANY_LOGO}</p>
<p>{MAIN_COMPANY_BILLING_ADDRESS}</p>
<p>{MAIN_COMPANY_PHONE}</p>
<p>{MAIN_COMPANY_FAX}</p>
<p>{MAIN_COMPANY_WEBSITE}</p>
<?php
class SomeTable extends Table
{
public function implementedEvents()
{
return [
'Model.afterSave' => [
'callable' => 'afterSave',
'priority' => 3
@Modicrumb
Modicrumb / Test.php
Last active September 19, 2018 20:02
<?php
$staringArray = [
'Hercules' => [
(int) 0 => [
(int) 10 => 'Slaykings'
],
(int) 1 => [
(int) 4 => 'Welp'
]
]
<?php
namespace App\Model\Entity;
use Cake\I18n\Time;
use Cake\ORM\Entity;
/**
* Expense Entity.
*
* @property int $id
@Modicrumb
Modicrumb / test.clj
Last active October 1, 2017 00:57
test.clj
(fn thenth [collection x]
(loop [ collection collection
x x
idx 0
]
(if (first collection)
(if (= idx x)
(first collection)
)
(recur thenth [(rest collection)
(ns clojure-noob.core
(:gen-class))
(defn happening
[& args]
(if (and true false)
do (println "print me")
do (println "no print me!")))
(defn whataheck
(and true false)
(println "okay")
(println "wow")
)