This file contains 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 Identity { | |
#nombre; | |
constructor(nombre) { | |
this.#nombre = nombre; | |
} | |
getNombre() { | |
return this.#nombre; | |
} |
This file contains 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
unmap h | |
unmap H | |
map a enterInsertMode | |
map i scrollUp | |
map k scrollDown | |
map j scrollLeft | |
map J goBack | |
map s scrollDown | |
map w scrollUp | |
map e scrollPageUp |
This file contains 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
(defcfg | |
process-unmapped-keys yes | |
macos-dev-names-include ( | |
"Apple Internal Keyboard / Trackpad" | |
"Bluetooth USB Host Controller" | |
) | |
concurrent-tap-hold yes | |
) | |
(defsrc |
This file contains 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
from typing import Union, List, TypedDict | |
import unittest | |
type Filenames = List[str] | |
type Action = TypedDict('Action', { | |
'added': Filenames, | |
'removed': Filenames, | |
}) | |
def get_relevant_changes(list_of_actions: List[Action]) -> Action: |
This file contains 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
/// ~/.configh/fish/functions/_tide_pwd.fish | |
-if set -l split_pwd (string replace -r '^$HOME' '~' -- \$PWD | string split /) | |
+if set -l split_pwd (string replace -r '^$HOME' '~' -- \$PWD | string split /)[-2..] | |
// see https://github.com/IlanCosman/tide/issues/428#issuecomment-1765244274 |
This file contains 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
// see: http://norvig.com/mayzner.html | |
all = [...document.querySelectorAll('tbody td')] | |
.filter((td) => td.title.includes(": ")) | |
.map((td) => { | |
const [bi, val] = td.title | |
.split('%')[0] | |
.split(': ') | |
return [bi.toLowerCase(), Number(val)] | |
}) |
This file contains 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 type * as t from './types.d' | |
const ONE_IN_TO_CM = 2.54 | |
const metricMap: t.UnitMap<t.MetricUnit> = { | |
mapList: ['km', 'hm', 'dam', 'm', 'dm', 'cm', 'mm'], | |
updater: { | |
inc: (a) => a * 10, | |
dec: (a) => a / 10, | |
} |
This file contains 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 { themes } from './theme' | |
import useCurrentTheme from './useCurrentTheme' | |
export type Props = { | |
children?: React.ReactNode | |
} | |
export function ThemeProvider({ children }: Props) { |
This file contains 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 last = (arr) => arr.slice(-1)[0]; | |
const init = (arr) => arr.slice(0, -1); | |
const matrix = (row, fnRow) => (col, fnItem) => | |
[...Array(row * col).keys()].reduce((z, x) => { | |
const lastRow = last(z); | |
const initRows = init(z); | |
const item = fnItem(x); | |
if (lastRow.length < col) { | |
const rowUpdated = lastRow.concat(item); |
This file contains 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 unittest | |
### | |
# Utility functions | |
### | |
def fromIndex(i, arr): | |
try: | |
return arr[i] | |
except: |
NewerOlder