Skip to content

Instantly share code, notes, and snippets.

View arshinalbab's full-sized avatar
🌴
Chilling!

Arshin Albab arshinalbab

🌴
Chilling!
View GitHub Profile
function myFunction() {
var d = new Date();
var hours = d.getHours();
var currentTime = d.toLocaleDateString();
var counter = SpreadsheetApp.getActiveSheet().getRange('B1').getValues();
// check if the current time is between 6am to 6pm. If yes, it will visit my heroku app, and then log this activity on the accompanying Google Sheet at Column A
if (hours >= 1 && hours <= 24) {
// Visit the specified
var response = UrlFetchApp.fetch("https://bitpiller-craft-prod.herokuapp.com/");
SpreadsheetApp.getActiveSheet().getRange('A1').setValue('Visted at ' + currentTime + " " + hours + "h");
@arshinalbab
arshinalbab / bulk_compress.sh
Created November 28, 2020 15:48
Compress all .SQL files in current directory to TAR.GZ & Get the md5 sum of all TAR.GZ files
#!/bin/bash
# Compress all .SQL files in current directory to TAR.GZ
# Single Line
# for i in *.sql; do tar -czf $i.tar.gz $i; done
for i in *.sql;
do tar -czf $i.tar.gz $i;
done
# Get the md5 sum of all TAR.GZ files
@arshinalbab
arshinalbab / bogo_sort.py
Created November 29, 2020 04:44
BogoSort Implemented in python
from random import shuffle
def is_sorted(data) -> bool:
"""Determine whether the data is sorted."""
return all(data[i] <= data[i + 1] for i in range(len(data) - 1))
def bogosort(data) -> list:
"""Shuffle data until sorted."""
while not is_sorted(data):
shuffle(data)
@arshinalbab
arshinalbab / jquery_get_table_data.js
Created December 13, 2020 14:07
Jquery get data inside table
$("table > tbody > tr").each(function () {
console.log($(this).find('td').eq(0).text() + " " + $(this).find('td').eq(1).text() );
});
@arshinalbab
arshinalbab / adminer.php
Created January 1, 2023 05:10
Download adminer ( Password disabled)
<?php
/** Adminer - Compact database management
* @link https://www.adminer.org/
* @author Jakub Vrana, https://www.vrana.cz/
* @copyright 2007 Jakub Vrana
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
* @version 4.8.1
*/function
adminer_errors($Ac,$Cc){return!!preg_match('~^(Trying to access array offset on value of type null|Undefined array key)~',$Cc);}error_reporting(6135);set_error_handler('adminer_errors',E_WARNING);$Yc=!preg_match('~^(unsafe_raw)?$~',ini_get("filter.default"));if($Yc||ini_get("filter.default_flags")){foreach(array('_GET','_POST','_COOKIE','_SERVER')as$X){$Fi=filter_input_array(constant("INPUT$X"),FILTER_UNSAFE_RAW);if($Fi)$$X=$Fi;}}if(function_exists("mb_internal_encoding"))mb_internal_encoding("8bit");function