This file contains 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
#!/usr/bin/env bash | |
#$1 : Minimum number of instance | |
#$2 : Maximum number of instance | |
#<auto-scaling-group-name> : To find this, visit EC2 section in your aws management dashboard and in your left sidebar, | |
# click on AUTO SCALING GROUPS at the very bottom and it shall display all the scaling groups of your EBS. | |
# Select your group name from there. | |
RED="\033[1;31m\n" | |
NOCOLOR="\033[0m\n" | |
YELLOW='\033[0;33m' |
This file contains 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
select * from <table> where | |
ST_CONTAINS( | |
ST_GEOMFROMTEXT( | |
CONCAT( | |
'POLYGON(( | |
', json_unquote(json_extract(column_name, '$.rectangle.bounds."north-east".lng')), ' | |
', json_unquote(json_extract(column_name, '$.rectangle.bounds."north-east".lat')), ', | |
', json_unquote(json_extract(column_name, '$.rectangle.bounds."north-west".lng')), ' | |
', json_unquote(json_extract(column_name, '$.rectangle.bounds."north-west".lat')), ', | |
', json_unquote(json_extract(column_name, '$.rectangle.bounds."south-west".lng')), ' |
This file contains 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
function solution($N) { | |
// write your code in PHP7.0 | |
if($N!=null){ | |
$bin = decbin($N); | |
$binArr = str_split($bin); | |
//print_r($binArr); | |
$pos = array_keys($binArr,1); | |
//print_r($pos); return; | |
$diff = []; | |
if(sizeof($pos)>1){ |
This file contains 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
(function (window, document) { | |
window.domEventsHandler = (function (window, document) { | |
let srcElement; | |
/* | |
* Options value for the highlighter | |
* */ | |
const opt = { | |
ignoreElem: ['head', 'meta', 'link', 'style', 'title', 'script'], // elements to ignore | |
queryElem : 'img, a, button, input, textarea', // elements to track on click |
This file contains 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
#!/usr/bin/env bash | |
RED="\033[1;31m\n" | |
NOCOLOR="\033[0m\n" | |
YELLOW='\033[0;33m' | |
GREEN='\033[0;32m' | |
if [[ $EUID -ne 0 ]]; then | |
printf "${RED}This script must be run as root${NOCOLOR}" | |
exit 1 |
This file contains 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
//Building Origin Search Payload | |
let form=null; | |
form.collection = "K50qtol4isMqmdFjz6xnWCFz5oAc3s"; | |
form.query = this.$route.query.q; | |
var authOptions = { | |
method: "get", | |
url: `https://ai.kartmax.in/api/{{enter_your_app_id_here}}/search-get/v1/plp-special`, | |
headers: { | |
"Content-Type": "application/json", |
This file contains 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
SELECT | |
table_schema as `Database`, | |
table_name AS `Table`, | |
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` | |
FROM information_schema.TABLES | |
ORDER BY (data_length + index_length) DESC; |
This file contains 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
SELECT TABLE_NAME, table_rows, data_length, index_length, | |
round(((data_length + index_length) / 1024 / 1024),2) "Size in MB" | |
FROM information_schema.TABLES WHERE table_schema = "$table_name" | |
ORDER BY (data_length + index_length) DESC; |
This file contains 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
#Method 1 (https://stackoverflow.com/questions/879327/quickest-way-to-delete-enormous-mysql-table) | |
CREATE TABLE new_foo LIKE foo; | |
RENAME TABLE foo TO old_foo, new_foo TO foo; | |
DROP TABLE old_foo; | |
#Method 2 (https://stackoverflow.com/questions/2300396/force-drop-mysql-bypassing-foreign-key-constraint) | |
SET foreign_key_checks = 0; | |
Truncate table foo; |
This file contains 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
[ | |
{ | |
"value":"ABeeZee", | |
"name":"ABeeZee" | |
}, | |
{ | |
"value":"Abel", | |
"name":"Abel" | |
}, | |
{ |
OlderNewer