This file contains hidden or 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 | |
declare(strict_types=1); | |
// Enable required extensions in php.ini: pcntl, posix, ffi | |
if (!extension_loaded('pcntl')) { | |
fwrite(STDERR, "FATAL tini (" . posix_getpid() . "): pcntl extension is not enabled.\n"); | |
exit(1); | |
} | |
if (!extension_loaded('posix')) { | |
fwrite(STDERR, "FATAL tini (" . posix_getpid() . "): posix extension is not enabled.\n"); |
This file contains hidden or 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 Co; | |
if (!function_exists('go')) { | |
function go($f) { $f(); } | |
function run($f) { $f(); } | |
} else { | |
\Co::set(['hook_flags' => SWOOLE_HOOK_TCP]); | |
} | |
echo "Start time: ", date(DATE_ATOM), PHP_EOL; |
This file contains hidden or 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 Xhgui\Profiler; | |
class UploadSaver | |
{ | |
/** @var string */ | |
private $url; | |
/** @var int */ | |
private $timeout; |
This file contains hidden or 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 requests | |
import json | |
Req = [ | |
"KOSPI2:IND", | |
"NIFTY:IND", | |
"SX5E:IND", | |
"UKX:IND", | |
"NDX:IND" | |
] | |
Data = {} |
This file contains hidden or 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 | |
set -e | |
# complain to STDERR and exit with error | |
die() | |
{ | |
echo "$*" >&2 | |
print_usage | |
exit 2 |
This file contains hidden or 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 (blockSelector, itemSelector) { | |
let list = document.querySelector(blockSelector); | |
let observer = () => list.querySelectorAll(itemSelector +":not(.imd-hash)") | |
.forEach(el => { | |
el.classList.add('imd-hash'); | |
let width = 32; | |
let height = 32; | |
let img = new Image(); | |
img.onload = function() { | |
let canvas = document.createElement("canvas"); |
This file contains hidden or 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
# Sources: | |
# https://cloudonaut.io/how-to-create-a-customized-cloudwatch-dashboard-with-cloudformation/ | |
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html | |
# https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/ECS.html | |
Resources: | |
CustomTaskDefinition: | |
Type: 'Custom::TaskDefinition' | |
Version: '1.0' | |
Properties: |
This file contains hidden or 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
#!/bin/bash | |
# | |
# Example of how to parse short/long options with 'getopt' | |
# | |
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"` | |
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi | |
echo "$OPTS" |
This file contains hidden or 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
#!/bin/bash | |
# | |
# Example of how to parse short/long options with 'getopt' | |
# | |
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"` | |
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi | |
echo "$OPTS" |
This file contains hidden or 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
# Alex Ellis 2018 | |
# Example from: https://blog.alexellis.io/quick-look-at-google-kaniko/ | |
# Pre-steps: | |
# kubectl create secret generic docker-config --from-file $HOME/.docker/config.json | |
# Other potential optimizations (suggested by @errordeveloper) | |
# - Store "templates" in a permanent volume | |
# - Download source via "tar" instead of git clone |
NewerOlder