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
var StylingHelper = function(){ | |
this.id = 'dynamic-styles'; | |
this.step = 2; | |
this.count = 1; | |
this.h1Size, this.h2Size, this.h3Size, this.h4Size, this.h5Size, this.h6Size, this.pSize; | |
}; | |
StylingHelper.prototype.increment = function() { | |
this.count++; |
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
* API FOR GET REQUESTS | |
// most simple and returns iata code | |
https://airport-autosuggest.flightright.net/v1/airports/COM?name=london | |
// connected to kiwi.com, but you can still use it for autocompletes and has a lot of information | |
https://api.skypicker.com/locations/?term=london | |
* BELOW API IS FOR POST REQUESTS | |
// related to openflights data or a simple text autocomplete |
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
// Also take a look at this nice article for more knowledge https://mariadb.com/kb/en/library/securing-connections-for-client-and-server/ | |
// for connecting via cli with ssl and host use below command | |
mysql -u root -p -h ClientCertOne --ssl | |
// SERVER PART | |
1 - Create a certificate, see this gist for info https://gist.github.com/fhdalikhan/27461530147a0b6eb281f5db1826912b | |
2- Add these lines to my.ini config file, providing you have these certificates. |
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
// generate cert | |
@see https://mariadb.com/kb/en/library/certificate-creation-with-openssl/ | |
// Add to my.ini | |
@see https://mariadb.com/kb/en/library/securing-connections-for-client-and-server/ | |
[mariadb] | |
ssl_cert = D:/work/mysql-certs/server-cert.pem | |
ssl_key = D:/work/mysql-certs/server-key.pem | |
ssl_ca = D:/work/mysql-certs/cacert.pem |
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 | |
define('BASE', './basecamp'); // Folder to store files (must be writable) | |
define('BASECAMP_URL', '[YOUR BASECAMP URL HERE]'); // e.g. https://stelabouras.basecamphq.com/ (Don't forget the trailing slash!) | |
define('BASECAMP_KEY', '[YOUR API KEY HERE]'); // e.g. one huge string (found in 'My info' in the Authentication tokens section) | |
define('COOKIE', tempnam(sys_get_temp_dir(), uniqid())); | |
function curl($url, $prefix = true) | |
{ | |
$url = ($prefix ? BASECAMP_URL : '').$url; |
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 | |
phps="7.1 7.2 7.3" | |
laravels="5.5 5.6 5.7 5.8" | |
requests="1000" | |
concurrencies="1 10 100" | |
native="$1" | |
function csv { | |
for t in requests time; do |
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
# COUNT ALL DATABASES | |
SELECT COUNT(*) FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mysql','information_schema'); | |
# COUNT ALL TABLES | |
SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES; |
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
// gulp version 4 used for below | |
// Step (1 Install gulp CLI) If gulp cli is not installed then npm install --global gulp-cli | |
// Step (2 Install Dependencies) npm install --save-dev gulp gulp-uglify gulp-rename gulp-if gulp-clean-css gulp-concat | |
// Step (3 Run gulp) gulp | |
// gulp command will run the default exported task | |
// to run an individual command run gulp taskName, be sure to export the task | |
const { src, dest, watch } = require('gulp'); | |
// const babel = require('gulp-babel'); | |
const uglify = require('gulp-uglify'); |
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
var states = [ | |
{ | |
label: 'Alabama', | |
value: 'AL' | |
}, | |
{ | |
label: 'Alaska', | |
value: 'AK' | |
}, | |
{ |
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 | |
return [ | |
'GB' => '/^GIR[ ]?0AA|((AB|AL|B|BA|BB|BD|BH|BL|BN|BR|BS|BT|CA|CB|CF|CH|CM|CO|CR|CT|CV|CW|DA|DD|DE|DG|DH|DL|DN|DT|DY|E|EC|EH|EN|EX|FK|FY|G|GL|GY|GU|HA|HD|HG|HP|HR|HS|HU|HX|IG|IM|IP|IV|JE|KA|KT|KW|KY|L|LA|LD|LE|LL|LN|LS|LU|M|ME|MK|ML|N|NE|NG|NN|NP|NR|NW|OL|OX|PA|PE|PH|PL|PO|PR|RG|RH|RM|S|SA|SE|SG|SK|SL|SM|SN|SO|SP|SR|SS|ST|SW|SY|TA|TD|TF|TN|TQ|TR|TS|TW|UB|W|WA|WC|WD|WF|WN|WR|WS|WV|YO|ZE)(\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}))|BFPO[ ]?\d{1,4}$/', | |
'JE' => '/^JE\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/', | |
'GG' => '/^GY\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/', | |
'IM' => '/^IM\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/', | |
'US' => '/^\d{5}([ \-]\d{4})?$/', | |
'CA' => '/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][ ]?\d[ABCEGHJ-NPRSTV-Z]\d$/', | |
'DE' => '/^\d{5}$/', |