This file contains hidden or 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
| const plugin = require('tailwindcss/plugin') | |
| const baseClass = '.focus' | |
| const property = '--focus-colour' | |
| const getColours = (colours, prefix, e) => { | |
| let utils = {} | |
| for (const key in colours) { | |
| if (typeof colours[key] === 'object') { |
This file contains hidden or 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
| javascript:(function(){ localStorage.setItem('statistics', JSON.stringify({ "currentStreak": 100, "maxStreak": 100, "guesses":{ "1": 99, "2": 0, "3": 1, "4": 0, "5": 0, "6": 0, "fail" :0 }, "winPercentage": 100, "gamesPlayed": 100, "gamesWon": 100, "averageGuesses": 1 }))})() |
This file contains hidden or 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
| <?php | |
| echo image( [ | |
| 'image' => get_field('image'), | |
| 'srcset' => [300, 450, 600, 800, 1000, 1200], | |
| 'sizes' => '100vw', | |
| 'loading' => 'lazy' | |
| 'class' => 'image-class' | |
| ] ); |
This file contains hidden or 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
| <?php | |
| echo image([ | |
| 'image' => 'otter.jpg', | |
| 'alt' => 'an otter standing on a log looking majestic', | |
| 'srcset' => [300, 450, 600, 800, 1000, 1200], | |
| 'sizes' => '100vw', | |
| 'width' => 1200, | |
| 'height' => 800, | |
| 'loading' => 'lazy', |
This file contains hidden or 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
| console.log(contrastingColour('#eee')) | |
| function contrastingColour(colour) { | |
| const rgb = hexToRGB(colour) | |
| // luminance of inputted colour | |
| const L = 0.2126 * colourMod(rgb.r) + 0.7152 * colourMod(rgb.g) + 0.0722 * colourMod(rgb.b) | |
| // white has a luminance of 1 | |
| const whiteL = 1 |
This file contains hidden or 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
| <div x-data="{ | |
| count: 4, | |
| init() { | |
| const self = this | |
| Object.defineProperty(window, 'count', { | |
| enumerable: true, | |
| configurable: true, | |
| get: function() { | |
| return self.count | |
| }, |
This file contains hidden or 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
| <?php | |
| /** | |
| * Utility for adding an event to various calendars | |
| * | |
| * @package SMRC | |
| */ | |
| if (isset($_POST['smrc_add_to_diary'])) { | |
| $event = new SMRC_Diary_Event($_POST); |
This file contains hidden or 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
| import { rewrite } from '@vercel/edge'; | |
| import { RequestCookies } from '@edge-runtime/cookies' | |
| // only run middleware on home page | |
| export const config = { | |
| matcher: '/', | |
| } | |
| export default function middleware(req) { | |
| const cookies = new RequestCookies(req.headers) |
This file contains hidden or 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
| import bcrypt from 'bcrypt'; | |
| import { SignJWT } from 'jose'; | |
| import { serialize } from 'cookie'; | |
| export default async function (request, response) { | |
| if (request.method !== "POST") { | |
| return response.status(405).send('does not respond to GET requests'); | |
| } | |
| // get all configured passwords |
This file contains hidden or 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
| // ==UserScript== | |
| // @name New Userscript | |
| // @namespace http://tampermonkey.net/ | |
| // @version 2024-08-22 | |
| // @description try to take over the world! | |
| // @author You | |
| // @match https://www.mojiparty.io/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=mojiparty.io | |
| // @grant none | |
| // ==/UserScript== |