Skip to content

Instantly share code, notes, and snippets.

View olekhy's full-sized avatar
🤓
happy developer

Alexander Hutorezki olekhy

🤓
happy developer
View GitHub Profile
@olekhy
olekhy / apache rewrite rule
Created September 19, 2023 09:58 — forked from santthosh/apache rewrite rule
Apache config for SPA's
# To be inside the /Directory
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
@olekhy
olekhy / README.md
Created February 23, 2023 17:15 — forked from ryu1kn/README.md
Getting GCP access token from a service account key JSON file

Getting GCP access token from a service account key

Use your service account's key JSON file to get an access token to call Google APIs.

Good for seeing how things work, including the creation of JWT token.

To create a JWT token, you can replace create-jwt-token.sh script with tools like step.

If you just want to get an access token for a service account,

@olekhy
olekhy / sqlalchemy_mysql_binary_uuid.py
Created January 15, 2023 21:22 — forked from craigdmckenna/sqlalchemy_mysql_binary_uuid.py
SQLAlchemy, MySQL 16 bit UUID, Custom Data Type
import UUID
from sqlalchemy.dialects.mysql import BINARY
from sqlalchemy.types import TypeDecorator
class BinaryUUID(TypeDecorator):
'''Optimize UUID keys. Store as 16 bit binary, retrieve as uuid.
inspired by:
http://mysqlserverteam.com/storing-uuid-values-in-mysql-tables/
@olekhy
olekhy / .htaccess
Created April 20, 2021 10:23 — forked from jwhulette/.htaccess
A base .htaccess with HTTPS redirect behind an AWS Load Balancer #apache
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Force HTTPS - Proto needed for AWS ELB
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTP_USER_AGENT} !^ELB-HealthChecker
aws polly synthesize-speech \
--output-format mp3 \
--voice-id Zhiyu \
--language-code cmn-CN \
--text file://p50.txt \
p50.mp3
@olekhy
olekhy / docker-cleanup-resources.md
Last active March 22, 2019 11:06 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@olekhy
olekhy / docker-ce-ubuntu-17.10.md
Created August 1, 2018 12:48 — forked from raminfp/docker-ce-ubuntu-17.10.md
Install Docker CE on Ubuntu 17.10 and Docker-compose

Installing Docker CE on Ubuntu 17.10 Artful Aardvark

As of 20/10/2017, a release file for Ubuntu 17.10 Artful Aardvark is not available on Download Docker.

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
@olekhy
olekhy / selenium_curl.sh
Created May 8, 2018 12:55 — forked from prashanthrajagopal/selenium_curl.sh
Run Selenium test via curl
s_id=`curl -X POST http://127.0.0.1:4444/wd/hub/session -d '{"desiredCapabilities":{"browserName":"firefox","platform":"MAC"}}'|awk -F'"' '{print $6}'`
curl -X POST http://127.0.0.1:4444/wd/hub/session/$s_id/url -d '{"url":"http://www.google.com"}'
curl -X POST http://127.0.0.1:4444/wd/hub/session/$s_id/element -d '{"using":"id","value":"gbqfq"}'
curl -X POST http://127.0.0.1:4444/wd/hub/session/$s_id/element/0/value -d {"value":["selenium"]}
curl -X POST http://127.0.0.1:4444/wd/hub/session/$s_id/element -d '{"using":"id","value":"gbqfb"}'
curl -X POST http://127.0.0.1:4444/wd/hub/session/$s_id/element/1/click
curl -X DELETE http://127.0.0.1:4444/wd/hub/session/$s_id/window
@olekhy
olekhy / gitflow-breakdown.md
Last active June 21, 2017 05:31 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
- git commit --allow-empty -m "Initial commit"
- git checkout -b develop master

Connect to the remote repository

<?php
namespace Application\View\Helper;
use RuntimeException;
use SpiffyNavigation\Page\Page;
use SpiffyNavigation\View\Helper\AbstractHelper;
class Breadcrumbs extends AbstractHelper
{