Create an empty git repo or reinitialize an existing one
$ git init| /* | |
| this is a pubsub pattern example. | |
| the pubsub mechanism is in PubSub. | |
| any class can use it by creating an instance ie: | |
| // the class that accepts subscribers must implement PubSub: | |
| //"MyClass" definitions: | |
| //... | |
| this.pubsub = new PubSub(); |
| let element = document.querySelector('.block'); | |
| element.addEventListener('mousedown', (evt) => { | |
| let startCoords = { | |
| x: evt.clientX, | |
| y: evt.clientY | |
| }; | |
| let onMouseMove = function(moveEvt) { | |
| let shift = { |
| <?php | |
| class MyModel extends Eloquent { | |
| public function getSql() | |
| { | |
| $builder = $this->getBuilder(); | |
| $sql = $builder->toSql(); | |
| foreach($builder->getBindings() as $binding) | |
| { |
Create an empty git repo or reinitialize an existing one
$ git init| // http://stackoverflow.com/questions/7279567/how-do-i-pause-a-window-setinterval-in-javascript | |
| function RecurringTimer(callback, delay) { | |
| var timerId, start, remaining = delay; | |
| this.pause = function() { | |
| window.clearTimeout(timerId); | |
| remaining -= new Date() - start; | |
| }; |
| (function (root, factory) { | |
| if ( typeof define === 'function' && define.amd ) { | |
| define([], factory(root)); | |
| } else if ( typeof exports === 'object' ) { | |
| module.exports = factory(root); | |
| } else { | |
| root.myPlugin = factory(root); | |
| } | |
| })(typeof global !== "undefined" ? global : this.window || this.global, function (root) { |
#Set DB_CONNECTION to use sqlite in-memory database when testing
<env name="DB_CONNECTION" value="sqlite">
<env name="DB_DATABASE" value=":memory:">
config\database.php file, change the default sqlite connection to 'connections' => [
| <?php | |
| /** | |
| * find string between two needles | |
| * @param string $string | |
| * @param string $needle_1 | |
| * @param string $needle_2 | |
| * @param boolean $case_insensitive | |
| * @return string/boolean | |
| */ |
Install.
composer require phpoffice/phpexcel