Skip to content

Instantly share code, notes, and snippets.

View kandy's full-sized avatar

Andrii Kasian kandy

View GitHub Profile
@kandy
kandy / Bloomberg Market Crawler.py
Created April 3, 2022 01:29 — forked from tomy0000000/Bloomberg Market Crawler.py
Crawl Some Data from Bloomberg
import requests
import json
Req = [
"KOSPI2:IND",
"NIFTY:IND",
"SX5E:IND",
"UKX:IND",
"NDX:IND"
]
Data = {}
@kandy
kandy / custom-task-definition.yml
Created April 29, 2020 23:45 — forked from guillaumesmo/custom-task-definition.yml
CloudFormation Custom Task Definition POC
# 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:
@kandy
kandy / parse-options.sh
Created October 24, 2019 16:36 — forked from cosimo/parse-options.sh
Example of how to parse options with bash/getopt
#!/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"
@kandy
kandy / parse-options.sh
Created October 24, 2019 16:36 — forked from cosimo/parse-options.sh
Example of how to parse options with bash/getopt
#!/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"
@kandy
kandy / job.yaml
Created June 26, 2019 21:52 — forked from alexellis/job.yaml
Use a Kubernetes Job and Kaniko to build an OpenFaaS function from Git
# 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
@kandy
kandy / criticalcss-bookmarklet-devtool-snippet.js
Created March 15, 2019 03:07 — forked from PaulKinlan/criticalcss-bookmarklet-devtool-snippet.js
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@kandy
kandy / install-ioncube.sh
Last active April 2, 2018 07:33 — forked from asabirov/install-ioncube.sh
Easy way to install ioncube on Debian/Ubuntu
cd /tmp
curl -O http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar zxvf ioncube_loaders_lin_x86-64.tar.gz
PHP_CONFD=$(php-config --configure-options|sed 's/.*\with-config-file-scan-dir\=\(\S*\).*/\1/g')
PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")
PHP_EXT_DIR=$(php-config --extension-dir)
cp "ioncube/ioncube_loader_lin_${PHP_VERSION}.so" $PHP_EXT_DIR
echo "zend_extension = ${PHP_EXT_DIR}/ioncube_loader_lin_${PHP_VERSION}.so" > "${PHP_CONFD}/00-ioncube.ini"
rm -rf ./ioncube
rm ioncube_loaders_lin_x86-64.tar.gz
@kandy
kandy / sql_profiling.php
Created May 12, 2017 10:18 — forked from mslabko/sql_profiling.php
Enable sql profiling for Magento2
<?php
/**
* Enable sql profiling for each page.
*
* Put code to index file in two parts
*/
// place it BEFORE application run
$profiler = \Magento\Framework\App\ObjectManager::getInstance()
->get('Magento\Framework\App\ResourceConnection')
@kandy
kandy / Random bytes, ints, UUIDs in PHP.md
Created February 1, 2016 14:21 — forked from tom--/Random bytes, ints, UUIDs in PHP.md
PHP random bytes, integers and UUIDs

Random bytes, ints, UUIDs in PHP

Simple and safe random getters to copy-paste

string randomBytes( int $length )

int randomInt ( int $min , int $max )

string randomUuid ( void )
@kandy
kandy / m2-module-install-2.sh
Created November 21, 2015 12:33 — forked from davidalger/m2-module-install-2.sh
Install module directly or via composer
composer config repositories.alger/phpworld-talk2 vcs [email protected]:davidalger/phpworld-talk2.git
composer require alger/module-skeleton:dev-master
bin/magento setup:upgrade -q && bin/magento cache:flush -q
# OR
git clone [email protected]:davidalger/phpworld-talk2.git app/code/Alger/Skeleton
bin/magento module:enable Alger_Skeleton
bin/magento setup:upgrade -q && bin/magento cache:flush -q