- Install composer-patches plugin
composer require cweagans/composer-patches
-
Download all the files (
*.diff
&*.json
) topatches
subdirectory of your project -
Add the following to your
composer.json
:
"extra": {
You are a RFC (Request For Comments, the Internet standards) document author. | |
Please create a RFC document that would define a new HTTP response code in the | |
4xx range that would instruct the HTTP client to refresh their stale DNS records. | |
Why? Because when moving a site to the new IP address, some HTTP clients still | |
query the old iP even after many hours after the DNS record should be invalid | |
because it has a TTL of 5 minutes or so. Format it using plain text, like the | |
other RFC documents usually are. |
// Add attributes as title tooltip | |
document.querySelectorAll('input').forEach(function(element) { | |
var attributes = []; | |
for (i = 0; i < element.attributes.length; i++){ | |
if (element.attributes[i].nodeName.toLowerCase() === 'title') { | |
continue; | |
} | |
if (element.attributes[i].nodeName.toLowerCase() === 'type' && typeof element.originalType !== 'undefined') { | |
var value = element.originalType; | |
} else { |
#!/bin/bash | |
# Optimize images for talk slides | |
# Run in directory with images, it does the following: | |
# 1. runs zopfli on all PNGs | |
# 2. runs guetzli on all JPEGs | |
# 3. creates lossy and lossless WebP, keeps the smaller one | |
# 4. keeps the WebP if smaller than original | |
GREEN=$(tput setaf 2) |
composer require cweagans/composer-patches
Download all the files (*.diff
& *.json
) to patches
subdirectory of your project
Add the following to your composer.json
:
"extra": {
-----BEGIN CERTIFICATE----- | |
MIIDoTCCAomgAwIBAgIUHaHTeqKOXVJAuOJtLu3vqYfgVaAwDQYJKoZIhvcNAQEL | |
BQAwYDELMAkGA1UEBhMCQ1oxDDAKBgNVBAgMA0ZvbzEMMAoGA1UEBwwDQmFyMQww | |
CgYDVQQKDANCYXoxDjAMBgNVBAsMBVdhbGRvMRcwFQYDVQQDDA5zZWxmLnNpZ25l | |
ZC5jejAeFw0yMTA2MDUyMTExMjRaFw0yMTA2MDYyMTExMjRaMGAxCzAJBgNVBAYT | |
AkNaMQwwCgYDVQQIDANGb28xDDAKBgNVBAcMA0JhcjEMMAoGA1UECgwDQmF6MQ4w | |
DAYDVQQLDAVXYWxkbzEXMBUGA1UEAwwOc2VsZi5zaWduZWQuY3owggEiMA0GCSqG | |
SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDUYp5WfN2Btdd1bg7uMP7nlUO5l4AXZXFq | |
XIM/Vdv+1tZMaMeKMW9mwYJoXySUNJS5/ix8pPdZL7szGZ8tqMMAisdjmNMfvg0e | |
mZu9/9yMh7vRDe/KU4u2rKPw4gvZNVx42ptIa1hAecjBwoVxysumBJh9HPo3z1d7 |
<?php | |
function index() | |
{ | |
echo ascii('xsssk'); | |
} | |
function rick() | |
{ | |
header('Location: https://media.giphy.com/media/Vuw9m5wXviFIQ/giphy.gif', true, 301); | |
} |
#!/bin/bash | |
# Find files in CVE-2020-15227 nette/application issue | |
# by @spazef0rze | |
# Run with `bash find-cve-2020-15227.sh`, works on Linux, FreeBSD, tested on Ubuntu 18.04, FreeBSD 11.4 | |
# This is a universal finder for all affected versions. | |
# Requirements: find, grep, bash (might work with your default shell but YMMV) | |
# The fixes: |
# Stripped subdomains (foo.example.com => example.com, doesn't mean example.com was in the original list) | |
# regex [a-z*0-9\-]+\.cz(?=[ \]]) | |
05.cz | |
0e.cz | |
0oo.cz | |
1000miglia.cz | |
1000oken.cz | |
1000zkh.cz | |
1001.cz | |
1001hry.cz |
<?php | |
// https://en.wikipedia.org/wiki/Category:Coffee_brands | |
$covfefes = [ | |
'alterracoffeeroasters', | |
'angiangcoffee', | |
'angelinus', | |
'autocrat', | |
'barcaffe', | |
'batdorfbronson', | |
'bewleys', |
<?php | |
function hashPbkdf2($algorithm, $password, $salt, $iterations, $length = 0) | |
{ | |
// Number of blocks needed to create the derived key | |
$blocks = ceil($length / strlen(hash($algorithm, null, true))); | |
$digest = ''; | |
for ($i = 1; $i <= $blocks; $i++) { | |
$ib = $block = hash_hmac($algorithm, $salt . pack('N', $i), $password, true); | |
// Iterations | |
for ($j = 1; $j < $iterations; $j++) { |