Skip to content

Instantly share code, notes, and snippets.

View adidahiya's full-sized avatar

Adi Dahiya adidahiya

View GitHub Profile
/**
* Adapted from Kevin Weber
* https://codepen.io/kevinweber/pen/dXWoRw
*
* License: CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/)
*/
@function svg-factory($fill-color) {
@return '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="' + $fill-color + '" d="M12 4.248c-3.148-5.402-12-3.825-12 2.944 0 4.661 5.571 9.427 12 15.808 6.43-6.381 12-11.147 12-15.808 0-6.792-8.875-8.306-12-2.944z"/></svg>';
}
import type { editor } from "monaco-editor";
import { Colors } from "@blueprintjs/colors";
// Adapted from https://github.com/giladgray/vscode-theme-blueprint
export const MonacoThemeDark: editor.IStandaloneThemeData = {
base: "vs-dark",
colors: {
focusBorder: Colors.BLUE2,
foreground: Colors.GRAY5,
"widget.shadow": Colors.BLACK,
@adidahiya
adidahiya / datetime2.tsx
Created November 2, 2022 17:23
Jest mock for @blueprintjs/datetime2
// should live in __mocks__/@blueprintjs/datetime2.tsx
import type { DateInput2Props } from "@blueprintjs/datetime2";
import * as React from "react";
const datetime2 = jest.requireActual<typeof import("@blueprintjs/datetime2")>("@blueprintjs/datetime2");
/**
* HACKHACK: our Enzyme tests rely on DateInput being a class component we can easily select & grab props from,
* which doesn't work with DateInput2 as it's now a function component. This shim allows the current tests to keep
* working. Enzyme is deprecated and unsupported; these tests should be migrated to react-testing-library.
@adidahiya
adidahiya / download_tarot_cards.sh
Created February 27, 2019 19:39
Download tarot card scan images
# wands, cups, swords, pentacles
for suit in "wa" "cu" "sw" "pe"; do
# ace, 1-10, page, knight, queen, king
for i in "ac" "02" "03" "04" "05" "06" "07" "08" "09" "10" "pa" "kn" "qu" "ki"; do
filename=$suit$i.jpg
if [ ! -e ./$filename ]; then
wget "http://www.sacred-texts.com/tarot/pkt/img/$filename"
fi
done
done
@adidahiya
adidahiya / npm-debug.log
Created October 17, 2018 17:09
p5.serialport installation failure
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/10.11.0/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 072c6d71a0716dc3
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall [email protected]
7 info lifecycle [email protected]~preinstall: [email protected]
@adidahiya
adidahiya / _control.scss
Last active June 23, 2021 01:27
blueprint-react-select
// Copyright 2017 Palantir Technologies, Inc. All rights reserved.
// Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
// of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
// and https://github.com/palantir/blueprint/blob/master/PATENTS
@import "~@blueprintjs/core/src/components/forms/common";
@import "./common";
// ReactSelect does not conform to our naming scheme
// stylelint-disable selector-class-pattern