Skip to content

Instantly share code, notes, and snippets.

View einSelbst's full-sized avatar
💭
Me, looking through the window of opportunity.

einSelbst einSelbst

💭
Me, looking through the window of opportunity.
  • Berlin / BalticSea
View GitHub Profile
Run only tests that has .only or all of them if there's no .only
grep --exclude-dir=node_modules -rl . -e 'test.only\|it.only\|describe.only' --null | tr '\n' ' ' | xargs -0 npx jest | grep . || npx jest
clear && grep --exclude-dir=node_modules -rl . -e 'test.only\|it.only\|describe.only' --null | tr '\n' ' ' | xargs -0 npx jest --coverage=false
@OrderAndCh4oS
OrderAndCh4oS / iso-639-2-lookup.json
Last active August 23, 2022 22:48
iso-639-2 language code to iso-639-1 look up json
{
"abk": {
"iso-639-2": "abk",
"iso-639-1": "ab",
"english": "Abkhazian",
"french": "abkhaze",
"german": "Abchasisch"
},
"ace": {
"iso-639-2": "ace",
@OrderAndCh4oS
OrderAndCh4oS / iso-639-1-lookup.json
Last active August 23, 2022 22:47
iso-639-1 language code to iso-639-2 look up json
{
"ab": {
"iso-639-2": [
"abk"
],
"iso-639-1": "ab",
"english": "Abkhazian",
"french": "abkhaze",
"german": "Abchasisch"
},
@OrderAndCh4oS
OrderAndCh4oS / iso-3166-country-codes.ts
Last active August 23, 2022 22:46
ISO 3166 Country Codes Typescript Object JSON
// https://www.iso.org/obp/ui/#search
const isoCountryCodes = [
{name: 'Andorra', alphaTwoCode: 'AD', alphaThreeCode: 'AND', numeric: '020'},
{name: 'United Arab Emirates', alphaTwoCode: 'AE', alphaThreeCode: 'ARE', numeric: '784'},
{name: 'Afghanistan', alphaTwoCode: 'AF', alphaThreeCode: 'AFG', numeric: '004'},
{name: 'Antigua and Barbuda', alphaTwoCode: 'AG', alphaThreeCode: 'ATG', numeric: '028'},
{name: 'Anguilla', alphaTwoCode: 'AI', alphaThreeCode: 'AIA', numeric: '660'},
{name: 'Albania', alphaTwoCode: 'AL', alphaThreeCode: 'ALB', numeric: '008'},
{name: 'Armenia', alphaTwoCode: 'AM', alphaThreeCode: 'ARM', numeric: '051'},
{name: 'Angola', alphaTwoCode: 'AO', alphaThreeCode: 'AGO', numeric: '024'},
@adbutterfield
adbutterfield / prettier.config.js
Last active February 21, 2024 05:17
Default prettier config with comments and links to prettier rules
module.exports = {
/**
* Print Width
* https://prettier.io/docs/en/options.html#print-width
*
* Specify the line length that the printer will wrap on.
*
* printWidth: <int>
* default: 80
*/
@chooie
chooie / 3_things_ive_learned_in_5_years_of_javascript_software_development.md
Last active January 4, 2022 01:17
3 things I've learned in 5 years of JavaScript Software Development

3 things I've learned in 5 years of JavaScript Software Development

Code should lead with the higher-level concepts. The lower-level pieces should follow

Don't force the reader of your code to scroll past the minutiae.

function makeBreakfast() {
  const ingredients = fetchIngredients();
  const friedBacon = fryBacon(ingredients.bacon);
  const cookedScrambledEggs = whiskEggsAndFryThem(ingredients.eggs);
 const preparedMeal = plateAndSeasonMeal(friedBacon, cookedScrambledEggs);
@rangeoshun
rangeoshun / config.el
Last active June 12, 2023 15:45
Typescript with CSS in JS (styled-components, Emotion), JSX and graphql highlight and major mode for Emacs Doom with `mmm-mode` for *.tsx
;; Assign typescript-mode to .tsx files
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-mode))
(require 'mmm-mode)
(setq mmm-global-mode t)
(setq mmm-submode-decoration-level 0) ;; Turn off background highlight
;; Add css mode for CSS in JS blocks
(mmm-add-classes
'((mmm-styled-mode
@azu
azu / amp.d.ts
Last active November 19, 2022 06:08
TypeScript definitions for AMP Attributes. Write AMP in JSX.
// roughish AMP attribute types for JSX/TypeScript
// Source: https://playground.amp.dev/amphtml-hint.json
// https://github.com/Microsoft/TypeScript/issues/15449
// https://stackoverflow.com/questions/50585952/typescript-and-google-amp-property-amp-img-does-not-exist-on-type-jsx-intrin
import * as React from 'react';
// why null ?
type _ANY = any;
type _ANYS = any;
declare module 'react' {
interface HTMLAttributes<T> {
@AJolly
AJolly / bitmexusd.user.js
Last active September 12, 2019 01:51 — forked from QuantBits/script.js
BitMex USD Converter - For TemperMonkey
// ==UserScript==
// @name BitMex USD Converter
// @namespace https://bitmex.com/
// @version 0.13
// @description Get some sanity into your gambling.
// @author koinkraft, modified by @Jolly - https://www.twitter.com/Jolly
// @grant none
// @include https://bitmex.com/*
// @include https://www.bitmex.com/*
// @require https://code.jquery.com/jquery-2.1.4.min.js