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 | |
/** | |
* Mobile Detect Library | |
* ===================== | |
* | |
* Motto: "Every business should have a mobile detection script to detect mobile readers" | |
* | |
* Mobile_Detect is a lightweight PHP class for detecting mobile devices (including tablets). | |
* It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment. | |
* |
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
import sys,os,zipfile,ftplib, configargparse | |
from os.path import basename | |
def ftp_login(user,passwd,host,port=21,timeout=30): | |
try: | |
ftp = ftplib.FTP() | |
ftp.connect(host, port, timeout) | |
ftp.login(user, passwd) | |
return ftp | |
except ftplib.all_errors as e: |
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
import sys,os,zipfile,ftplib, configargparse | |
from os.path import basename | |
def ftp_login(user,passwd,host,port=21,timeout=30): | |
try: | |
ftp = ftplib.FTP() | |
ftp.connect(host, port, timeout) | |
ftp.login(user, passwd) | |
return ftp | |
except ftplib.all_errors as e: |
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 | |
# Credit to Weslly | |
# Based on https://bountify.co/php-curl-api-uploader | |
// download the zip file | |
file_put_contents("file_to_upload.zip", fopen("http://someurl/file_to_upload.zip", 'r')); | |
// set the API Token | |
$api_token = "APITOKEN"; |
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 | |
//Last 30 days dates | |
$dates = array(); | |
for($i = 0; $i < 30; $i++) { | |
$dates[] = array('day'=> date("d", strtotime('-'. $i .' days')), 'month'=>date("m", strtotime('-'. $i .' days')), 'year'=>date("Y", strtotime('-'. $i .' days'))); | |
} | |
//Vars |
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
<html> | |
<head> | |
<!--Load the AJAX API--> | |
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> | |
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
// Load the Visualization API and the piechart package. | |
google.charts.load('current', {'packages':['corechart']}); | |
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
import random | |
import sys | |
sys.setrecursionlimit(5000) | |
def make_maze(columns=20, rows=20): | |
columns = columns / 2 | |
rows = rows / 2 | |
visited = [[0] * columns + [1] for _ in range(rows)] + [[1] * (columns + 1)] |
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 | |
/* | |
Make sure that /tmp/check.json has permissions to read and write | |
It is better to create /tmp/check.json manually | |
type below commands if you are using only php | |
sudo echo > /tmp/check.json | |
sudo chmod 777 /tmp/check.json | |
sudo chown www-data:www-data /tmp/check.json |
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 | |
$ffmpegpath = "ffmpeg.exe"; | |
$input = 'wattan.flv'; | |
$output = 'wattan.jpg'; | |
if (make_jpg($input, $output)){ | |
echo 'success'; | |
}else{ | |
echo 'bah!'; | |
} |
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
# HTML FILE | |
<div id="res"> | |
</div> | |
# JAVASCRIPT |
OlderNewer