Given an integer array and a number n, move all of thens to the end of the array while maintaining the relative order of the non-ns. Bonus: do this without making a copy of the array!
$ moveNums([0,2,0,3,10], 0)
$ [2,3,10,0,0]Given an integer array and a number n, move all of thens to the end of the array while maintaining the relative order of the non-ns. Bonus: do this without making a copy of the array!
$ moveNums([0,2,0,3,10], 0)
$ [2,3,10,0,0]| $alpha: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z; | |
| :root { | |
| --pending-key: 0 0 0px 8px rgb(171, 67, 255) inset; | |
| --error-key: 0 0 0px 40px rgb(255, 58, 58) inset; | |
| } | |
| @each $letter in $alpha { | |
| body:has( [data-testid="tile"][data-state="tbd"][aria-label$=#{to-upper-case($letter)}]:not([data-animation="flip-in"])) [aria-label="Keyboard"] [data-key=#{$letter}] { | |
| box-shadow: var(--pending-key); |
| import fs from 'fs'; | |
| import path from 'path'; | |
| import carbonIcons from '@carbon/icons-react'; | |
| const fileContent = `${Object.keys(carbonIcons).reduce( | |
| (result, iconName) => | |
| `${result} declare export const ${iconName}: ComponentType;\n`, | |
| `/* this file is generated, recommend adding to prettier and eslint ignore and committing to git. DO NOT EDIT */ | |
| declare module '@carbon/icons-react' { |
| // change the following two key combos as you like | |
| // this key combo will mark the current focused file as viewed and jump to the next unviewed file | |
| const viewedAndNextKey = "ctrl-alt-meta-shift-v"; | |
| // this key combo will just jump to the next unviewed file | |
| const nextKey = "ctrl-alt-meta-shift-w"; | |
| const modifiers = ["ctrl", "alt", "meta", "shift"]; | |
| const viewedAndNextKeyParts = viewedAndNextKey.split("-"); | |
| const nextKeyParts = nextKey.split("-"); |
The above scripts require the following environment variables defined to use.
GITLAB_TOKEN a personal access token for gitlabGITHUB_TOKEN a personal access token for github with all repo scopesGITLAB_REPO the id of the Gitlab project as in the Settings > General page of the Gitlab projectGITHUB_REPO the 'owner/repository' string of the GitHub repository as in the url; https://github.com/owner/repository| /// <reference types="cypress" /> | |
| // *********************************************************** | |
| // This example plugins/index.js can be used to load plugins | |
| // | |
| // You can change the location of this file or turn off loading | |
| // the plugins file with the 'pluginsFile' configuration option. | |
| // | |
| // You can read more here: | |
| // https://on.cypress.io/plugins-guide | |
| // *********************************************************** |
| // Used for one JSON file for each language containing all namespaces | |
| i18next.use({ | |
| type: 'backend', | |
| read<Namespace extends keyof typeof en>( | |
| language: LocaleCode, | |
| namespace: Namespace, | |
| callback: ( | |
| errorValue: unknown, | |
| translations: null | typeof en[Namespace] | |
| ) => void |
| declare module 'pagix' { | |
| export function between(num: number, min: number, max: number): number; | |
| export function range(from: number, to: number): number[]; | |
| export interface PagixOptions { | |
| /** | |
| * total of records to paginate | |
| */ | |
| records: number; | |
| /** |
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions |
| const shopLoadingMachine = Machine({ | |
| id: 'shop-loading', | |
| initial: 'entry', | |
| context: { | |
| shopSettings: null | |
| }, | |
| states: { | |
| entry: { | |
| on: { | |
| LOAD: { |