Skip to content

Instantly share code, notes, and snippets.

View JamesIves's full-sized avatar
커피는 나의 원동력

Jives JamesIves

커피는 나의 원동력
View GitHub Profile
@JamesIves
JamesIves / sevenrooms-reservation-checker.js
Last active May 24, 2025 18:29
Node (v22) script that queries the Sevenrooms reservation booking system to inform you if a timeslot is available. Reservation times that are marked as is_requestable are removed from the payload as they cannot be booked online and require calling the restaurant.
/**
* 🎉 The number of guests in the party.
*/
const PARTY_SIZE = 4;
/**
* 📅 The start date for the reservation search.
*/
const START_DATE = "05-30-2025"; // Format: MM-DD-YYYY
@JamesIves
JamesIves / commit-message-guidelines.md
Last active June 13, 2025 15:18 — forked from okineadev/commit-message-guidelines.md
🤖 Copilot commit messages instructions for VS Code

Add the following data to settings.json within VSCode to auto-generate commit messages with Copilot using the Conventional Commit format. This is based off of this example, however includes more explicit instructions for all commit prefixes (such as docs, refactor, etc).

  "github.copilot.chat.commitMessageGeneration.instructions": [
    {
      "text": "Generate commit messages in Conventional Commits format with gitmoji. Follow this exact structure:\n\n```\n<type>[optional scope]: <gitmoji> <description>\n\n[optional body]\n```\n\nExamples:\n- `feat(auth): :sparkles: add new login validation`\n- `fix(api): :bug: resolve user data fetch timeout`\n- `docs: :memo: update README installation steps`\n- `docs: :bookmark: add JSDoc comments to media component`\n- `style: :art: format code according to linting rules`\n- `refactor: :recycle: restructure video platform detection logic`\n\nTypes must be one of:\n- `feat`: A new feature\n-
@JamesIves
JamesIves / walkdom.js
Last active March 14, 2024 13:24
Walks the DOM and creates a table based on how many elements it occurs in the light and shadow DOM, along with a combined total separated by a coloured header. Useful for tracking down performance issues with excessive DOM nodes. Can be run in the browser dev tools console.
/**
* Walk the DOM tree and tally the number of elements between light and shadow dom.
*/
function walkDOM(root, nodeCounts = {}, shadowNodeCounts = {}, isShadow = false) {
const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT);
const nodes = [];
const excludedNodes = ['META', 'SCRIPT', '#text']; // Add any other node types you want to exclude
while(walker.nextNode()) {
if (!excludedNodes.includes(walker.currentNode.nodeName)) {
@JamesIves
JamesIves / code.ts
Last active March 22, 2022 14:43
Convert Figma CSS Properties to TailwindCSS utilities. This is only partially functional, feel free to take this code and use it to build your own plugin.
/** Converts Figma CSS Properties to TailwindCSS utilities.
* This plugin is unfinished, feel free to take this code and extend it to build your own plugin!
* @author James Ives - https://jamesiv.es
*
*/
const convertComponentToHex = (c: number) => {
const hex = c.toString(16);
return hex.length == 1 ? "0" + hex : hex;
};
@JamesIves
JamesIves / quake_light_flicker.js
Last active June 16, 2021 12:11
Basic interpretation of the Quake light flicker in JavaScript.
const flickerString = "mmamammmmammamamaaamammma";
const flickerInterval = 500;
const pauseExecution = (timeout) => {
return new Promise((resolve) =>
setTimeout(() => {
resolve();
}, timeout)
);
}
@JamesIves
JamesIves / wow_token.cs
Last active May 26, 2020 19:36
Small program which fetches the current WoW token price from the Blizzard API written in C#.
using Newtonsoft.Json;
using RestSharp;
using RestSharp.Authenticators;
using System;
namespace WoWTokenPrice
{
class Program
{
static void Main(string[] args)
@JamesIves
JamesIves / meme_generator.html
Last active March 18, 2019 02:48
Creates internet memes using HTML5 Canvas. Save it as a HTML file and open in a compatible browser such as Chrome.
<!DOCTYPE html>
<html>
<head>
<title>James' Meme Generator</title>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0"
/>