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
/* | |
* Example plugin | |
* | |
* Data attributes: | |
* - data-control="example" - enables the plugin on an element | |
* - data-option="value" - an option with a value | |
* | |
* JavaScript API: | |
* $('a#someElement').myPlugin({ option: 'value' }) | |
* |
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 | |
// Requires PHP 5.3+ | |
// Found here: http://stackoverflow.com/a/1320156 | |
function flatten_array(array $array) { | |
$flattened_array = array(); | |
array_walk_recursive($array, function($a) use (&$flattened_array) { $flattened_array[] = $a; }); | |
return $flattened_array; | |
} |
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
<comment-box> | |
<h1>{ opts.title }</h1> | |
<comment-list url={ opts.url } comments={ comments } /> | |
<comment-form url={ opts.url } /> | |
this.comments = [] | |
add(comment) { | |
this.comments.push(comment) |
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 | |
$userName = 'fooUser'; | |
$password = 'fooPassword'; | |
$endpoint = 'https://cig.dhl.de/services/sandbox/soap'; | |
$client = new SoapClient("https://cig.dhl.de/cig-wsdls/com/dpdhl/wsdl/standortsuche-api/1.0/standortsuche-api-1.0.wsdl", [ | |
'login' => $userName, | |
'password' => $password, | |
'location' => $endpoint, |
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
import tensorflow as tf | |
from tensorflow.python.framework import ops | |
import numpy as np | |
# Define custom py_func which takes also a grad op as argument: | |
def py_func(func, inp, Tout, stateful=True, name=None, grad=None): | |
# Need to generate a unique name to avoid duplicates: | |
rnd_name = 'PyFuncGrad' + str(np.random.randint(0, 1E+8)) | |
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 namespace Vendor\Plugin | |
use Event; | |
use Vendor\Plugin\Models\MyModel; | |
use Vendor\Plugin\Controllers\MyController; | |
class Plugin | |
{ | |
public function boot() | |
{ |