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 | |
class CSVHelper | |
{ | |
// Build wonderful things | |
public static function parseCSV($fileName) | |
{ | |
$extractData = []; | |
$csvArray = []; |
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 | |
//Simple Usage | |
/** | |
* Encrypt a message | |
* | |
* @param string $message - message to encrypt | |
* @param string $key - encryption key | |
* @return string | |
*/ |
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
<div class="span-input"> | |
<span class="span-el">1234 ms</span> | |
<input type="text" class="hide"> | |
</div> | |
<div class="span-input"> | |
<span data-append=" ms" class="span-el">1234 ms</span> | |
<input type="text" class="hide"> | |
</div> |
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
sudo apt-get update | |
sudo apt install software-properties-common | |
sudo apt-get install python3.7 | |
cd /usr/bin/ | |
sudo ln -s python3 python | |
sudo apt-get -y install python3-pip | |
sudo ln -s /usr/bin/pip3 /usr/bin/pip | |
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py | |
sudo python get-pip.py | |
pip3 install Django |
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
package = 'sentry-sdk' | |
package_module = package.replace('-', '_') | |
def import_package(package_name, module_name): | |
try: | |
__import__(module_name) | |
except ImportError: | |
import pip | |
if hasattr(pip, 'main'): | |
pip.main(['install', package_name]) |
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 | |
sudo su | |
yum update -y | |
yum install -y httpd.x86_64 | |
systemctl start httpd.service | |
systemctl enable httpd.service | |
echo "Hello from $(hostname -f)" > /var/www/html/index.html |
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 | |
sudo su | |
yum update -y | |
amazon-linux-extras install nginx1.12 -y | |
systemctl start nginx | |
echo "Hello from $(hostname -f)" > /usr/share/nginx/html/index.html |
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 PrintElem(elem) | |
{ | |
var mywindow = window.open('', 'PRINT', 'height=400,width=600'); | |
mywindow.document.write('<html><head><title>' + document.title + '</title>'); | |
mywindow.document.write('</head><body >'); | |
mywindow.document.write('<h1>' + document.title + '</h1>'); | |
mywindow.document.write(document.getElementById(elem).innerHTML); | |
mywindow.document.write('</body></html>'); |
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 | |
sudo apt-get update -y | |
sudo apt-get remove docker docker-engine docker.io -y | |
sudo apt install docker.io -y | |
sudo systemctl start docker | |
sudo systemctl enable docker | |
sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
sudo usermod -aG docker $(whoami) |
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 multiprocessing import Pool | |
from multiprocessing import cpu_count | |
import signal | |
stop_loop = 0 | |
def exit_chld(x, y): | |
global stop_loop |
OlderNewer