kubectl run mysql-client --image=mysql:5.7 -it --rm --restart=Never -- /bin/bash
mysql -h mysql-service -uroot -proot_password -e 'SHOW databases;'
OR
mysql -h mysql-service -uroot -proot_password
workflow "Demo workflow" { | |
on = "push" | |
resolves = ["SNS Notification"] | |
} | |
action "Build Image" { | |
uses = "actions/docker/cli@c08a5fc9e0286844156fefff2c141072048141f6" | |
runs = ["/bin/sh", "-c", "docker build -t $IMAGE_URI ."] | |
env = { | |
IMAGE_URI = "xxxxxxxx.dkr.ecr.ap-northeast-1.amazonaws.com/github-action-demo:latest" |
import merge from 'deepmerge'; | |
import delve from 'dlv'; | |
import defaultConfig from './default'; | |
const { REACT_APP_ENV, NODE_ENV } = process.env; | |
const ENV = REACT_APP_ENV || NODE_ENV; | |
const config = () => { | |
try { |
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.
<?php | |
/** | |
* Clear cache CLI style | |
* | |
* | |
* @category Mage | |
* @package Mage_Shell | |
* @copyright Copyright (c) 2015 Bjarne Oeverli (http://bjarneo.codes) | |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
*/ |
#!/bin/bash | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
apt-get update | |
apt-get install -y git-core autoconf bison libxml2-dev libbz2-dev libmcrypt-dev libcurl4-openssl-dev libltdl-dev libpng-dev libpspell-dev libreadline-dev make | |
mkdir -p /etc/php7/conf.d | |
mkdir -p /etc/php7/cli/conf.d | |
mkdir /usr/local/php7 |
{ | |
"name": "my-app", | |
"version": "1.0.0", | |
"description": "My test app", | |
"main": "src/js/index.js", | |
"scripts": { | |
"jshint:dist": "jshint src/js/*.js", | |
"jshint": "npm run jshint:dist", | |
"jscs": "jscs src/*.js", | |
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js", |
#!/bin/bash | |
while : | |
do | |
eject | |
eject -t | |
done |
<?php | |
/** | |
* Create Shopping Cart Sales Rule with Specific Coupon Code Programmatically | |
*/ | |
// All customer group ids | |
$customerGroupIds = Mage::getModel('customer/group')->getCollection()->getAllIds(); | |
// SalesRule Rule model | |
$rule = Mage::getModel('salesrule/rule'); |