sudo apt-get update
sudo apt-get install vim
| /* | |
| The main method here is processTailwindSrcsetSizes. You can generate a sizes attribute using it based on | |
| tailwind style breakpointed sizes referencing your screens, such as: | |
| "100vw md:500px" | |
| "200px lg:100vw" | |
| "200px md:300px xl:600px" | |
| "100vw lg:50vw" | |
| "100vw" | |
| "400px" |
| # create a local .env file with the following 4 properties: | |
| # | |
| # MYSQL_DATABASE=<something> | |
| # MYSQL_USER=<something> | |
| # MYSQL_PASSWORD=<something> | |
| # MYSQL_ROOT_PASSWORD=<something> | |
| # | |
| # Note: I have had a LOT of issues working with anything newer then Docker Desktop v4.26.1 | |
| # If you're on something newer, then double check against this release. | |
| # |
| <?php | |
| function verify_captcha($token) { | |
| $threshold = 0.5; // Score must be > threshold to pass captcha. | |
| // Default is 0.5, although the majority of users will get 0.9 | |
| $sites = ["localhost", "nachotoast.com", "ntgc.ddns.net"]; // Site names string, e.g. sub.domain.com:8080 | |
| $secret = "Put your client secret here."; | |
| $url = "https://www.google.com/recaptcha/api/siteverify"; | |
| $data = array("secret" => $secret, "response" => $token); |
| // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types | |
| enum MimeTypes { | |
| ".aac" = "audio/aac", | |
| ".abw" = "application/x-abiword", | |
| ".arc" = "application/x-freearc", | |
| ".avi" = "video/x-msvideo", | |
| ".azw" = "application/vnd.amazon.ebook", | |
| ".bin" = "application/octet-stream", | |
| ".bmp" = "image/bmp", |
| import crypto from 'crypto'; | |
| const ALGORITHM = 'aes-256-cbc'; | |
| const ENCODING = 'hex'; | |
| const IV_LENGTH = 16; | |
| const KEY = process.env.ENCRYPTION_KEY!; | |
| export const encrypt = (data: string) => { | |
| const iv = crypto.randomBytes(IV_LENGTH); | |
| const cipher = crypto.createCipheriv(ALGORITHM, new Buffer(KEY), iv); |
| user www-data; | |
| worker_processes auto; | |
| worker_rlimit_nofile 8192; | |
| error_log /var/log/nginx/error.log warn; | |
| pid /var/run/nginx.pid; | |
| events { | |
| worker_connections 8000; | |
| } |
See how a minor change to your commit message style can make a difference.
git commit -m"<type>(<optional scope>): <description>" \ -m"<optional body>" \ -m"<optional footer>"
| # config to don't allow the browser to render the page inside an frame or iframe | |
| # and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking | |
| # if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri | |
| # https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options | |
| add_header X-Frame-Options SAMEORIGIN; | |
| # when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header, | |
| # to disable content-type sniffing on some browsers. | |
| # https://www.owasp.org/index.php/List_of_useful_HTTP_headers | |
| # currently suppoorted in IE > 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx |
| var mediaJSON = { "categories" : [ { "name" : "Movies", | |
| "videos" : [ | |
| { "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
| "sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
| "subtitle" : "By Blender Foundation", | |
| "thumb" : "images/BigBuckBunny.jpg", | |
| "title" : "Big Buck Bunny" | |
| }, | |
| { "description" : "The first Blender Open Movie from 2006", | |
| "sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |