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
$dir = '.'; | |
$files = scandir($dir); | |
foreach ( $files as $file ) { | |
if ( strpos($file,'word') !== false ) { | |
unlink( $file ); | |
} | |
} |
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
//Add to hosts file in "C:\Windows\System32\drivers\etc\" | |
127.0.0.1 newsite | |
//Access your new directory via "http://newsite" |
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
<html> | |
<p style="width: 70%;margin: auto;margin-top: 5%;font-size:larger;text-align:center"> | |
Download a file from any URL</p> | |
<form method="post" style="width: 70%;margin: auto;margin-top: 10%;"> | |
<input name="url" size="50" placeholder="Source URL" style="width: 100%;height: 10%;font-size: 1.5em;padding:10px" required> | |
<input name="submit" type="submit" value="Download" style="width: 30%;height: 10%;margin: 5% auto; display: block;"> | |
<p style="width: 70%;margin: auto;margin-top: 10%;font-size:larger;text-align:center"> | |
To <?php echo getcwd(); ?></p> | |
<p style="width: 70%;margin: auto;font-size: smaller;text-align: center;position: fixed;bottom: 0;background: #fff;"> | |
Powered by: <a href="https://karthikbhat.net/portfolio" target="_blank" style="color:#f60;text-decoration:none;">Karthik</a></p> |
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
cd path/to/git/project | |
export GIT_COMMITTER_DATE="YYYY-MM-DD HH:MM:SS" | |
export GIT_AUTHOR_DATE="YYYY-MM-DD HH:MM:SS" | |
git commit --amend --date=""YYYY-MM-DD HH:MM:SS" | |
# Verify date and time then save. | |
unset GIT_COMMITTER_DATE | |
unset GIT_AUTHOR_DATE |
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
*125* | |
*125*1541# | |
*125*1537# |
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
<?php | |
if ( ! isset($_SERVER['HTTP_CF_VISITOR']) && ! isset($_SERVER['HTTP_CF_CONNECTING_IP']) ) { | |
die('Direct Access'); | |
} | |
echo 'Cloudflare Access'; |
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
#!/bin/bash | |
# @todo: NOT WORKING PROPERLY | |
MYSQL_PASSWORD="KarthikMSQL&398" | |
DATABASE_NAME="wpkart" | |
SERVER_NAME="karthikbhat.net" | |
sudo apt-get -y install apache2 |
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
FROM python:3 | |
# From here: https://hub.docker.com/_/python | |
# Python preinstalled | |
# You can use any image from docker hub | |
WORKDIR /usr/src/app | |
COPY my_file.py ./ | |
# Copy any file or directory here if needed. |
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 () { | |
'use strict'; | |
function _slicedToArray(arr, i) { | |
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); | |
} | |
function _arrayWithHoles(arr) { | |
if (Array.isArray(arr)) return arr; | |
} |
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
const fs = require('fs'); | |
const data = fs.readFileSync( process.argv[2], { encoding: 'utf8', flag: 'r' } ); | |
const min = JSON.parse(data, (key, value) => | |
typeof value === "number" ? Math.round(value * 100) / 100 : value | |
) | |
const minString = JSON.stringify( min ) |