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
| :: This batch file does a `cargo build` and if successful, moves the credentials.json file into the build dir. | |
| @ECHO ON | |
| set "DIR=%~dp0" | |
| set "FILE=credentials.json" | |
| echo %DIR% | |
| cargo %1 | |
| IF %errorlevel% == 0 ( |
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
| // https://www.amd.com/en/support/linux-drivers | |
| // In order to have visualping detect the Ubuntu version change, we first need VisualPing to expand all the <details> elements: | |
| document.querySelectorAll('details.os-group').forEach((el) => { el.setAttribute('open', true) }); |
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
| curl \ | |
| --header "Content-Type: application/json" \ | |
| --header "Authorization: Bearer abc123" \ | |
| --request POST \ | |
| --data '{"username":"xyz","password":"xyz"}' \ | |
| http://localhost:3000/api/myendpoint |
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
| select { | |
| appearance: none; | |
| width: 100%; | |
| transition-property: background, color, padding, margin; | |
| transition-duration: 150ms; | |
| outline-width: 0.125rem; | |
| outline-style: solid; | |
| outline-color: transparent; | |
| outline-offset: 0.125rem; | |
| } |
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
| /* | |
| // Usage: | |
| <button id="counter" type="button"></button> | |
| import { setupCounter } from './counter.js' | |
| setupCounter(document.querySelector('#counter')) | |
| */ | |
| export function setupCounter(element) { |
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
| .fluid-type { | |
| font-size: clamp(1rem, 4cqi, 3rem); | |
| } |
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
| // Using a reducer allows you to control field validation etc | |
| // without having a million useState(); calls and logic spanning across multiple functions. | |
| import { useReducer } from "react"; | |
| function EditCalendarEvent() { | |
| const [event, updateEvent] = useReducer( | |
| (prev, next) => { | |
| const newEvent = { ...prev, ...next }; |
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
| <script runat="server"> | |
| // You can POST to this endpoint in order to quickly subscribe someone to a Data Extension. | |
| // The request body expects a JSON object with a property labelled "de" that uses the Marketing Cloud | |
| // Data Extension ID (e.g. 6ded84cc-9fbf-4ec5-83e3-06cc82fb380a) | |
| // The rest of the JSON object is just key/value pairs for each field name and field value. | |
| // | |
| // Example: | |
| // POST /subscribe | |
| // {"de":"6ded84cc-9fbf-4ec5-83e3-06cc82fb380a","FirstName": "Joe","LastName":"Bloggs","Email":"joe@bloggs.com"} | |
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
| // 1) Use the Cloudlflare Pages/Github integration to build everytime there is a push to the main branch. | |
| // 2) In github settings for the repo, create a new webhook that only triggers on "Check runs". |
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 * as React from "react"; | |
| import { render } from "react-dom"; | |
| import produce from "immer"; | |
| import { set, has } from "lodash"; | |
| import "./styles.css"; | |
| function enhancedReducer(state, updateArg) { | |
| // check if the type of update argument is a callback function | |
| if (updateArg.constructor === Function) { |