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 | |
/** @see https://twitter.com/AshAllenDesign/status/1786037324775633109 */ | |
test('strict types are used everywhere') | |
->expect('App') | |
->toUseStrictTypes(); | |
test('globals') | |
->expect(['dd', 'ddd', 'die', 'dump', 'ray', 'sleep']) |
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
{ | |
"ti": "AAAABBBBCCCCDDDD_ZZZ", | |
"cn": "Example ION File", | |
"dt": "11", | |
"ci": "AAAABBBBCCCCDDDD_ZZZ~fioUStyk923dTK4y7iXdBwVjTBYEunBtd9GpEigvBf9", | |
"cs": "gkBdyWByfHiOwteD-vQn9jb7pudublgsI9kW4fiPhzsOi2lFKIttCzy5ofiiyMQqgSjpuS3GRDtMHbLbj_fexq", | |
"iu": "https://mingle-ionapi.inforcloudsuite.com", | |
"pu": "https://mingle-sso.inforcloudsuite.com:443/AAAABBBBCCCCDDDD_ZZZ/as/", | |
"oa": "authorization.oauth2", | |
"ot": "token.oauth2", |
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
{ | |
"name": "laravel/laravel", | |
"description": "The Laravel Framework.", | |
"keywords": ["framework", "laravel"], | |
"license": "MIT", | |
"type": "project", | |
"repositories": [], | |
"require": { | |
"php": "^7.3|^8.0", | |
"fideloper/proxy": "^4.4", |
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
#!/usr/bin/env bash | |
# e (errexit): Abort script at first error | |
# u: Treat unset variables as an error | |
# f: Disable filename expansion (globbing) upon seeing *, ?, etc.. | |
# pipefail: Causes a pipeline to return exit code for last command in pipe | |
set -euf -o pipefail | |
# run this if the script exits with a non-zero exit code | |
handle_error() { |
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
Show hidden characters
/* | |
On OS X, basic text manipulations (left, right, command+left, etc) make use of the system key bindings, | |
and don't need to be repeated here. Anything listed here will take precedence, however. | |
*/ | |
[ | |
{ "keys": ["super+shift+n"], "command": "new_window" }, | |
{ "keys": ["super+shift+w"], "command": "close_window" }, | |
{ "keys": ["super+alt+shift+n"], "command": "new_os_tab" }, | |
{ "keys": ["ctrl+alt+tab"], "command": "next_os_tab" }, | |
{ "keys": ["ctrl+alt+shift+tab"], "command": "prev_os_tab" }, |
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 | |
if (!function_exists('dd')) { | |
function dd($data) | |
{ | |
ini_set("highlight.comment", "#969896; font-style: italic"); | |
ini_set("highlight.default", "#FFFFFF"); | |
ini_set("highlight.html", "#D16568"); | |
ini_set("highlight.keyword", "#7FA3BC; font-weight: bold"); | |
ini_set("highlight.string", "#F2C47E"); |
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
{ | |
"folders": [ | |
{ | |
"path": ".", | |
"folder_exclude_patterns": [ | |
".vemto", | |
"vendor", | |
"node_modules", | |
"storage", | |
"bootstrap/cache", |
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 | |
function renderPhpFile($filename, $vars = null) { | |
if (is_array($vars) && !empty($vars)) { | |
extract($vars); | |
} | |
ob_start(); | |
include $filename; | |
return ob_get_clean(); | |
} |
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 | |
/** @see https://www.php.net/manual/en/intro.parallel.php */ | |
$runtime = new \parallel\Runtime(); | |
$channel = new \parallel\Channel(); | |
// Run a task in parallel, passing a channel for communication | |
$future = $runtime->run(function () use ($channel) { | |
// Do some work here | |
$channel->send('Result'); |
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
// tweaked from: https://stackoverflow.com/a/42718113/1170664 | |
func getXML(url string) ([]byte, error) { | |
resp, err := http.Get(url) | |
if err != nil { | |
return []byte{}, fmt.Errorf("GET error: %v", err) | |
} | |
defer resp.Body.Close() | |
if resp.StatusCode != http.StatusOK { | |
return []byte{}, fmt.Errorf("Status error: %v", resp.StatusCode) |
NewerOlder