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
class MyTitle extends HTMLElement { | |
connectedCallback() { | |
this.innerHTML = ` | |
<style> | |
h1 { | |
font-size: 2.5rem; | |
color: hotpink; | |
font-family: monospace; | |
text-align: center; | |
text-decoration: pink solid underline; |
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 React, { createContext, PropsWithChildren, useContext } from 'react'; | |
type OnMouseClickEvent = React.MouseEvent<HTMLButtonElement, MouseEvent>; | |
const DemoContext = createContext<{ | |
onClick: (ev: OnMouseClickEvent) => void; | |
}>({ | |
onClick: () => undefined, | |
}); |
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
# ----------------------------------- | |
# MAKEFILE VARS | |
# ----------------------------------- | |
.DEFAULT_GOAL := help | |
.PHONY: test | |
# ----------------------------------- | |
# MAKE TARGETS |
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
#!/bin/bash | |
set -euo pipefail | |
function print_bold { | |
local text_bold=$(tput bold) | |
local text_normal=$(tput sgr0) | |
echo "${text_bold}$1${text_normal}" | |
} |
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
// Colors reference | |
// You can use the following as so: | |
// console.log(colorCode, data); | |
// console.log(`${colorCode}some colorful text string${resetCode} rest of string in normal color`); | |
// | |
// ... and so on. | |
export const reset = "\x1b[0m" | |
export const bright = "\x1b[1m" | |
export const dim = "\x1b[2m" |
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
{ | |
"global": { | |
"check_for_updates_on_startup": true, | |
"show_in_menu_bar": true, | |
"show_profile_name_in_menu_bar": false | |
}, | |
"profiles": [ | |
{ | |
"complex_modifications": { | |
"parameters": { |
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
// ---- | |
// Sass (vundefined) | |
// Compass (vundefined) | |
// dart-sass (v1.18.0) | |
// ---- | |
$MYBLUEEYES: #3587DA; | |
@mixin card { | |
border: 1px solid $MYBLUEEYES; |
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 date = new Date(); | |
function createProperISOString(date) { | |
const dateTime = date.toISOString().slice(0, 19); | |
const timezoneOffset = -date.getTimezoneOffset() / 60; | |
let timezoneOffsetAsHours | |
if (Number.isInteger(timezoneOffset)) { | |
timezoneOffsetAsHours = `${('0' + Math.abs(timezoneOffset)).slice(-2)}:00`; | |
} else { |
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 is an example body that you would pass in through the test function | |
* { | |
* "snsMessage": "This is a test body that will come through", | |
* "messageAttributes": { | |
* "insurance_type": { | |
* "DataType": "String", | |
* "StringValue": "car" | |
* } | |
* } |
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
// GIST to find pairs of numbers within an array that is greater than the sum of all numbers in the array | |
// first GOTCHA, make sure you don't multiply a number by itself | |
// second GOTCHA, make sure numbers aren't multiplied in reverse! (eg 10 * 8 and 8 * 10) | |
function bruteForce() { | |
// unsorted list | |
var list = [ 3, 10, 4, 9, 8, 7 ]; | |
// sum of all numbersin list |
NewerOlder