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
// Returns a function, that, as long as it continues to be invoked, will not | |
// be triggered. The function will be called after it stops being called for | |
// N milliseconds. If `immediate` is passed, trigger the function on the | |
// leading edge, instead of the trailing. | |
function debounce(func, wait, immediate) { | |
var timeout; | |
return function () { | |
var context = this, args = arguments; | |
var later = function () { | |
timeout = null; |
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 <Your namespace here>; | |
use Illuminate\Support\Facades\DB; | |
/** | |
* | |
* @author Ervinne Sodusta <[email protected]> | |
*/ |
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
// app/Exceptions/Handlers.php | |
public function render($request, Exception $exception) | |
{ | |
if ($this->exceptionToHttpResponseHandlerRouter->isHandleable($exception)) { | |
return $this->exceptionToHttpResponseHandlerRouter->handle($exception); | |
} | |
if (!$this->isApiCall($request)) { | |
return parent::render($request, $exception); | |
} else { |
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 App\Http\Middleware; | |
use Closure; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Log; | |
class RequireIPIsWhitelisted | |
{ |
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
let questions = [{ | |
"form_criteria_id": "46", | |
"field_name": "pumpstation_general", | |
"field_label": "General repairs required?", | |
"mandatory": false, | |
"action": "dropdown", | |
"input_type": [{ | |
"id": 7, | |
"text": "Yes", | |
"value": "yes", |
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
let foo = document.getElementById('foo'); | |
foo.style.color = 'red'; | |
foo.style.border = '2px solid #000'; | |
foo.style.paddingLeft = '3px'; | |
foo.style.marginTop = '3px'; | |
foo.style.fontSize = '1.2em'; | |
foo.style.fontStyle = 'italic'; |
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
function toggleFooHasError() { | |
let foo = document.getElementById('foo'); | |
if (foo.classList.contains('has-error')) { | |
foo.classList.remove('has-error'); | |
} else { | |
foo.classList.add('has-error'); | |
} | |
} | |
toggleFooHasError(); |
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
// ... variable declaration and setting of widgetID, widgetTitle, etc. | |
let widgetText = "JavaScript is Quirky"; | |
let widgetHTML = '<div id=' + widgetId + '>' + | |
'<h2 id="' + widgetTitleId + '">' + widgetTitle + '</h2>' + | |
'<div id="' + widgetContentId + '" style="' + widgetContentStyles + '">' + | |
widgetText + | |
'</div>' + | |
'</div>'; | |
document.getElementById("widget-container").innerHTML = widgetHTML; |
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
<script src="js/tmpl.min.js"></script> | |
<script type="text/x-tmpl" id="tmpl-specific-widget-x"> | |
<div id="specific-widget-x" class="specific-widget-x"> | |
<h2>{%=o.title%}</h2> | |
<div class="specific-widget-x-body-classes"> | |
{%=o.text%} | |
</div> | |
</div> | |
</script> |
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
const { validate, normalize, persist } = require('./user-module') | |
const pipe = require('./pipe') | |
const saveUser = (user) => { | |
return pipe( | |
validate, | |
normalize, | |
persist | |
)(user) | |
} |
OlderNewer