Skip to content

Instantly share code, notes, and snippets.

Permanent study state

Anton qant

Permanent study state
View GitHub Profile
View google_translate.html
<div id="google_translate_element"></div>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en'
}, 'google_translate_element');
<script src=""></script>
qant / gulp-image-compressor-page-peed-google.txt
Created Mar 9, 2021
Gulp image compression for Page Speed of Google, 37% of compression aprox.
View gulp-image-compressor-page-peed-google.txt
install node
install npm
put package.json
npm i
create _src/ and dest/ folders
put image files to _src/ folder
then "npx gulp" to run
qant / gist:01dea07fa9847c292225e57176c35712
Created Mar 7, 2021
Docker mysql how to import big sql dump (close to 1 gb)
View gist:01dea07fa9847c292225e57176c35712
docker ps (for get name of my container like "ant_database_1")
docker exec ant_database_1 sh -c 'exec mysql -D wordpress -uwordpress -pwordpress' < local.sql
* will not work because default max_allowed_packet in mysql configuration so:
docker exec -it ant_database_1 bash -c "echo 'max_allowed_packet = 1G' >> /etc/mysql/mysql.conf.d/mysqld.cnf"
Now it might work.
But to be shure i am prefere the way with copy and manual import inside the container
qant /
Created Mar 5, 2021 — forked from JacobFierro/
Docker Cheatsheet

Docker Cheatsheet

Docker info:

docker info


List Images:

qant / example.txt
Created May 21, 2020
Translate text with google api for free
View example.txt
Upload this file to your php app and run like this:
OR with translating parameters http://localhost/translate-text-google-api-free.php?tl=ru
Also there is limit with 5000 simbols, and the google api can ban your ip if you will abise to much.
qant /
Created May 16, 2020 — forked from thegitfather/
Vanilla JavaScript Quick Reference / Cheatsheet
qant / playwright-iphone11pro.js
Created May 12, 2020
Check url on iphone 11 pro with playwright (like puppeteer) in 3 browser
View playwright-iphone11pro.js
const playwright = require("playwright");
const vp = { width: 375, height: 812 };
(async () => {
for (const browserType of ["webkit", "chromium", "firefox"]) {
const browser = await playwright[browserType].launch();
const context = await browser.newContext({
devices: ["iPhone 11 Pro"],
qant / eventLoop.js
Created Feb 2, 2020
Event loop javascript order
View eventLoop.js
qant / fetchExamples.js
Created Jan 7, 2020 — forked from Remzi1993/fetchExamples.js
Examples of using native fetch
View fetchExamples.js
// Config / constants
const baseUrl = 'http://localhost:4000' || '' // or use an environment variable like this: process.env.URL || 'http://localhost:4000'
const JWT = 'Whatever-token'
* Examples of using native fetch
* REST API - CRUD convention (Create/POST, Read/GET, Update/modify/PUT/PATCH, Delete/DELETE)
qant / taxonomy-breadcrumbs.php
Created Jan 26, 2018 — forked from saqibsarwar/cloudSettings
WordPress custom taxonomy breadcrumbs based on deepest term.
View taxonomy-breadcrumbs.php
if( !function_exists( 'inspiry_get_breadcrumbs_items' ) ) :
* Returns a array of breadcrumbs items
* @param $post_id int Post id
* @param $breadcrumbs_taxonomy string Taxonomy name
* @return mixed|void
function inspiry_get_breadcrumbs_items( $post_id, $breadcrumbs_taxonomy ) {