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 | |
/** | |
* Simple method to use the API from https://www.troyhunt.com/ive-just-launched-pwned-passwords-version-2/ | |
* Written by Jim Westergren and released to public domain | |
* @return int count | |
*/ | |
function checkPawnedPasswords(string $password) : int | |
{ | |
$sha1 = strtoupper(sha1($password)); | |
$data = file_get_contents('https://api.pwnedpasswords.com/range/'.substr($sha1, 0, 5)); |
In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:
git remote add upstream https://github.com/whoever/whatever.git
git fetch upstream
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
//This code works fine in a Swift playground. | |
let startingX = 0.0 | |
let finishingX = 2.0 | |
//make this smaller for more accuracy but slower calculation times | |
let increment = 0.1 | |
var area = 0.0 | |
func fOfX(x : Double) -> Double{ |
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 | |
$domain = "img.scottshar.es/"; | |
//server-side directory | |
$directory_self = str_replace(basename($_SERVER['PHP_SELF']), '', $_SERVER['PHP_SELF']); | |
$uploadsDirectory = $_SERVER['DOCUMENT_ROOT'] . $directory_self; | |
// Image filetype check source: | |
// http://designshack.net/articles/php-articles/smart-file-type-detection-using-php/ | |
$tempFile = $_FILES['media']['tmp_name']; |