Skip to content

Instantly share code, notes, and snippets.

View MattIPv4's full-sized avatar
:shipit:
Commits go brrrr

Matt Cowley MattIPv4

:shipit:
Commits go brrrr
View GitHub Profile
According to all known laws of aviation, there is no way a bee should be able to fly.
Its wings are too small to get its fat little body off the ground.
The bee, of course, flies anyway because bees don't care what humans think is impossible.
Yellow, black. Yellow, black. Yellow, black. Yellow, black.
Ooh, black and yellow!
Let's shake it up a little.
Barry! Breakfast is ready!
Coming!
Hang on a second.
Hello?

DNS over Discord

Ever wanted to make DNS requests from the comfort of your Discord server? Well now you can, thanks to the @1.1.1.1 bot.

To start using the DNS over Discord bot, invite it to your Discord server using this link: https://bit.ly/DNS-over-Discord

The bot only requires basic permissions to read messages in your server and send messages to reply to the DNS queries.

Once the bot is in your server, you can mention it (@1.1.1.1) followed by a domain name to begin making DNS requests. Provide DNS record types after the domain name to get back results for each record type. You can also use an asterisk ("*") in place of a record type to get back DNS results for all supported types.

@MattIPv4
MattIPv4 / quick.cpp
Last active October 19, 2023 02:51
#include <iostream>
/**
* Output the contents of an array.
*
* @param array the array of integers to output.
* @param last the size of the given array, or the "index" (1-based) of the last item in the array.
* @param first the index (0-based) of the first item in the array.
*/
void print(int array[], int last, int first = 0)

Cloning specific folders of cdnjs

Due to the amount of libraries of cdnjs, the repository has a very big size. Because of this some might find it difficult or time and resource consuming to carry out normal git tasks, such as cloning and commiting.

This page is a guide to cloning only some folders of cdnjs using a sparse checkout.

  1. If you haven't already, fork cdnjs on GitHub, so you can push commits on your fork.
  2. Open a terminal in your computer (with git installed)
  3. Run git init cdnjs
  4. cd cdnjs

Prism Patch

Rough guide to patch Prism such that it doesn't globally pollute.

Get Prism

script/prism.sh

#!/bin/sh
.prism-editor-wrapper {
width: 100%;
height: 100%;
display: flex;
align-items: flex-start;
overflow: auto;
tab-size: 1.5em;
-moz-tab-size: 1.5em;
.prism-editor__line-numbers {
/* Base */
html {
font-size: 10px;
}
body {
color: var(--gray9);
font-family: var(--sans-serif);
font-size: 1.8rem;
}
/**
* Exercise 3
* This project will serve as a utility to present SET operations. The investigated operations are:
*/
namespace SetOps
{
/**
* Determine if an integer is contained within a vector.
*
* @param items the vector of integers to search.

cdnjs March 2019 Usage Stats

Information provided directly by Cloudflare for the cdnjs.cloudflare.com domain. ⛅️

Key Highlights

  • cdnjs served just under 160 billion requests in March.
  • During the month we used over 2.5 petabytes of bandwidth.
  • That is over 5 billion requests and 83 terabytes of data per day.

Library Highlights

  • jQuery (3.3.1) was the top library with nearly 4 billion requests for the single file.
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
async function fetchAndApply(request) {
const requestURL = new URL(request.url)
if(!requestURL.pathname.startsWith('/ajax/libs')) {
requestURL.pathname = '/ajax/libs' + requestURL.pathname
const newResponse = await fetch(requestURL, request)
if(newResponse.status == 200) return newResponse