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 for getting weather data using OpenWeatherMap | |
* @see http://openweathermap.org/current | |
*/ | |
class OpenWeatherMap { | |
/** | |
* Creates new instance and sets class properties | |
* | |
* @param {string} imperial or metric | |
* @param {string} language code |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Document.Ready?</title> | |
<script> | |
HTMLDocument.prototype.ready = function () { | |
return new Promise(function(resolve, reject) { | |
if (document.readyState === 'complete') { | |
resolve(document); |
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
DirectoryIndex index.html index.phtml index.php | |
#Configure PHP's autoloader and set include_path, min PHP version | |
<IfModule env_module> | |
SetEnv CONFIG_DIR ../../config | |
SetEnv AUTOLOAD_DIR ../../classes | |
</IfModule> | |
#Loads the autoloader script before executing main PHP file | |
php_value auto_prepend_file ../../std-php-functions/autoloader.php |
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
# Auto detect text files and perform LF normalization | |
* text=auto | |
# Custom for Visual Studio | |
*.cs diff=csharp | |
# Standard to msysgit | |
*.doc diff=astextplain | |
*.DOC diff=astextplain | |
*.docx diff=astextplain |
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
# Auto detect text files and perform LF normalization | |
* text=auto | |
# Custom for Visual Studio | |
*.cs diff=csharp | |
# Standard to msysgit | |
*.doc diff=astextplain | |
*.DOC diff=astextplain | |
*.docx diff=astextplain |
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 submitForm(form) { | |
if (! ('fetch' in window)) { | |
return new Promise(function() { | |
throw new Error('Your browser does not support the fetch API'); | |
}); | |
} | |
var url = new URL(form.action || '/', document.baseURI || location.origin); | |
var headers = new Headers(); | |
var body = new FormData(form); | |
headers.append('Content-Type', form.enctype || 'multipart/form-data'); |
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
# Configure PHP's autoloader and set include_path | |
<IfModule env_module> | |
SetEnv AUTOLOAD_DIR classes | |
SetEnv AUTOLOAD_EXTS .php | |
SetEnv AUTOLOAD_FUNC spl_autoload | |
</IfModule> | |
# Loads the autoloader script before executing main PHP file | |
php_value auto_prepend_file ./autoloader.php |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 PHP mail class using mail() | |
* | |
* Strips, converts, etc. Automatically sets required headers. Takes most | |
* of the work out of the coding side of writing emails. | |
* | |
* You should verify that you have an email service installed. | |
* On Ubuntu, I use ssmtp (see link for manpage) | |
* |