This file contains 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 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 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 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 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 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 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 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 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 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(){var a,b,c,d,e,f,g=0;if(a=["tag seen","Stray end tag","Bad start tag","violates nesting rules","Duplicate ID","first occurrence of ID","Unclosed element","not allowed as child of element","unclosed elements","not allowed on element","unquoted attribute value","Duplicate attribute"].join("|"),b=document.getElementById("results"),!b)return void alert("No results container found.");for(c=b.getElementsByTagName("li"),f=0;f<c.length;f++)d=c[f],""!==d.className%26%26(e=(void 0===d.innerText%3Fd.textContent:d.innerText)+"",resultHtml=d.innerHTML,null===e.match(a)%3F(d.style.display="none",d.className+=" steveNoLike",g++):-1!==e.indexOf("not allowed on element")%26%26(-1!==resultHtml.indexOf("<code>ng-")||-1!==resultHtml.indexOf("<code>x-")||-1!==resultHtml.indexOf("<code>ax-")||-1!==resultHtml.indexOf("<code>v-")||-1!==resultHtml.indexOf("<code>:")||-1!==resultHtml.indexOf("<code>%40"))%26%26(d.style.display="none",d.className+=" steveNoLike",g++));alert("Complete. "+g+" items removed.")})(); |
NewerOlder