...
"require": {
"vendor/package": "1.3.2", // exactly 1.3.2 (exact)
// >, <, >=, <= | specify upper / lower bounds
"vendor/package": ">=1.3.2", // anything above or equal to 1.3.2
"vendor/package": "<1.3.2", // anything below 1.3.2
// * | wildcard
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/env python3 | |
# Build a SQLite3 DB for looking up SHA-1 hashes of leaked passwords. | |
# | |
# This can be fed the txt file from one of Have I Been Pwned's hash | |
# lists available from https://haveibeenpwned.com/Passwords -- but any | |
# text file with line format ``hash-hex:count`` will work. | |
# | |
# When run on the v5 hash-ordered SHA-1 file, expect the build to take | |
# about 35 minutes and produce a 15.7 GiB file (~30.5 bytes per record). | |
# |
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
# Create a file in Plugins/ | |
# You can run this via Sublime's console with: view.run_command("php_unit_test_method") | |
# You can bind it to ctrl+e as a regular command | |
import sublime | |
import sublime_plugin | |
class PhpUnitTestMethodCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
line = self.view.substr(self.view.line(self.view.sel()[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
@setup | |
require __DIR__.'/vendor/autoload.php'; | |
(new \Dotenv\Dotenv(__DIR__, '.env'))->load(); | |
$appName = "my-app.com"; | |
$repository = "spatie/{$appName}"; | |
$baseDir = "/home/forge/{$appName}"; | |
$releasesDir = "{$baseDir}/releases"; | |
$currentDir = "{$baseDir}/current"; | |
$newReleaseName = date('Ymd-His'); |
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
# This is an annotated subset of the Nginx configuration from our Magento production platform @ www.hypernode.com | |
# See https://www.byte.nl/blog/magento-cacheleak-issue | |
# !!!! If you are a Hypernode customer, do not use this config as it will result in duplicate statements. !!!!! | |
user app; | |
worker_processes 4; | |
pid /var/run/nginx.pid; | |
events { |
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
/** | |
* Check if a given ip is in a network | |
* @param string $ip IP to check in IPV4 format eg. 127.0.0.1 | |
* @param string $range IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 is accepted and /32 assumed | |
* @return boolean true if the ip is in this range / false if not. | |
*/ | |
function ip_in_range( $ip, $range ) { | |
if ( strpos( $range, '/' ) == false ) { | |
$range .= '/32'; | |
} |