Skip to content

Instantly share code, notes, and snippets.

func add(Collection<Number> $numbers): Number {
return $numbers.reduce(func (undefined|Object $carry, Number $number): Number {
if ($carry is not defined) {
$carry = new Number(0)
}
return $carry.add($number)
});
const path = require("path");
const webpack = require('webpack');
function makeBundle({ outputPath, projectPath, watch = false }) {
const webpackConfig = require(path.resolve(projectPath, "webpack.config.js"));
return new Promise((resolve, reject) => {
const webpackCompiler = webpack(webpackConfig);
const postRun = (error, stats) => {
/**
* Verify a timeout value is under 30 minutes.
*/
function verifyTimeout(timeout) {
if (timeout > 1.8e+6) {
throw new Error('Timeouts must be under 30 minutes');
}
return timeout;
}
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class Contact extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
return !$('.onephone:eq(0)').is(':empty') && !$('.onephone:eq(1)').is(':empty');
//equals
const items = document.querySelectorAll('.onephone');
return !items[0].childNodes.length > 0 && ! items[1].childNodes.length > 0;
<?php
namespace App\Composers\Partials\Admin\Addresses;
use App\Address;
use App\Composers\Composer;
use Illuminate\Contracts\View\View;
use Illuminate\Http\Request;
class Form implements Composer
diff --git a/services/terminal.js b/services/terminal.js
index 742b553..e13242f 100644
--- a/services/terminal.js
+++ b/services/terminal.js
@@ -12,7 +12,15 @@ function Terminal(notify)
Terminal.prototype = {
init: function(params)
{
- this._term = pty.spawn(process.platform === "win32" ? "cmd.exe" : "bash", [], {
+ let shell = "";
{% include 'elements.input' with {
label: 'Name',
name: 'name',
inputAttributes: {
required: null,
value: nameValue
}
} only %}
  1. Go to chrome://flags#enable-devtools-experiments in your browser. Turn it on and restart Chrome.
  2. Install the DevTools Author extension.
  3. Open DevTools and go to Settings.
  4. Look in tabs to the left, find new "Experiments" tab.
  5. Enable the Allow custom UI themes one.
  6. Restart DevTools
  7. Go to new "Author Settings" panel.
  8. Select Solarized Dark in the dropdown, enter "Fira Code" for the font family, and select your desired text size.
  9. Restart DevTools.
  10. Enjoy the custom color theme in Elements, Sources, and Console. (Possibly other places, don't really know.)
<?php
namespace App\Composers;
use Illuminate\Contracts\View\View;
interface Composer
{
public function compose(View $view);