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

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 {

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.

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
@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)
/**
* 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.
/* Base */
html {
font-size: 10px;
}
body {
color: var(--gray9);
font-family: var(--sans-serif);
font-size: 1.8rem;
}
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
@import url(https://cdn.rawgit.com/laCour/slack-night-mode/master/css/raw/black.css);
.menu ul li a:not(.inline_menu_link) {color: #fff !important;}
#p_thread_view_container > .p-threads_view { background-color: #222; }
#p_thread_view_container > .p-threads_view .p-threads_view_header__permalink { color: #e6e6e6 !important; }
#p_thread_view_container > .p-threads_view .p-threads_view__default_background { background-color: #222; }

cdnjs April 2019 Usage Stats

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

Key Highlights

  • cdnjs served over 160 billion requests in April 2019.
  • During the month we used over 2.6 petabytes of bandwidth to serve these requests.
  • That is over 89 terabytes of data and 5 billion requests each day.

Library Highlights

  • jQuery (3.3.1) was once again the top library with over 6 billion requests for the single file.