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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 | |
echo 'hallo'; | |
?> |
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
<? | |
$iterator = new RecursiveDirectoryIterator ('rootdir'); | |
$wrapper = new RecursiveIteratorIterator ($iterator, RecursiveIteratorIterator::SELF_FIRST); | |
foreach ($wrapper as $elem) { | |
echo $elem->getFilename (); | |
} | |
?> |
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
$target_dir = "pic/"; | |
$target_file = $target_dir . 'ndvi.jpg'; | |
$uploadOk = 1; | |
$imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION)); | |
// Check if image file is a actual image or fake image | |
if(isset($_POST["submit"])) { | |
$check = getimagesize($_FILES["fileToUpload"]["tmp_name"]); | |
if($check !== false) { | |
echo "File is an image - " . $check["mime"] . "."; |
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
# Rename this distribution example file to motion.conf | |
# | |
# This config file was generated by motion 4.1.1 | |
# Documentation: /usr/share/doc/motion/motion_guide.html | |
############################################################ | |
# Daemon | |
############################################################ | |
# Start in daemon (background) mode and release terminal (default: off) |
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/python | |
import yagmail | |
import sys | |
#initializing the server connection | |
yag = yagmail.SMTP(user='sender@sender', password='xxx') | |
#sending the email | |
yag.send(to='to@to', subject='Motion detected', contents=['Motion', sys.argv[1]]) | |
print("Email sent successfully") |
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
import mysql.connector | |
def save_enviro_data_in_db(vals): | |
print ("save db") | |
try: | |
mydb = mysql.connector.connect( | |
host="", | |
user="", | |
password="", | |
database="", |
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
class WebCrawler { | |
private const CURL_OPTIONS = array( | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_FOLLOWLOCATION => true, | |
CURLOPT_SSL_VERIFYHOST => 2, | |
CURLOPT_SSL_VERIFYPEER => true, | |
CURLOPT_CAINFO => "/path/to/cert.pem" // hier den Pfad zum Zertifikat eintragen | |
); | |
private $visited_links = []; |
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
import numpy as np | |
# Eingabedaten | |
X = np.array([[0, 0, 1], | |
[0, 1, 1], | |
[1, 0, 1], | |
[1, 1, 1]]) | |
# Erwartete Ausgabedaten | |
y = np.array([[0], |
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 | |
function didYouMean($query, $suggestions) { | |
$querySoundex = soundex($query); | |
$similarSuggestions = []; | |
foreach ($suggestions as $suggestion) { | |
if (soundex($suggestion) == $querySoundex) { | |
$similarSuggestions[] = $suggestion; | |
} |
OlderNewer