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
#!/usr/bin/env bash | |
# Inspired by https://github.com/ThePrimeagen/.dotfiles/blob/602019e902634188ab06ea31251c01c1a43d1621/bin/.local/scripts/tmux-sessionizer | |
# Just for zellij | |
# alows you to use `fzf` to navigate into a desire folder and either start or attach into a zellij session | |
# If you run it from inside zellij, it will open the newly selected folder in a new pane | |
# Demo of the original: https://youtu.be/bdumjiHabhQ?t=269 | |
# 1. Place the script in your path |
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
/* | |
* Conditional types can become tedious to maintian as nested ternary syntax is hard to understand | |
* The following suggests a different approach, using a mapped key: value pair where adding additional rules and - | |
* restrictions becomes much easier to read and maintain. | |
* [TSPlayground](https://www.typescriptlang.org/play?ssl=38&ssc=20&pln=38&pc=24#code/KYOwrgtgBAgiCWECGAbKBvAsAKCnqAIgPIDiUAvFAEQAmA9gOZUA0O+UAwjACoXUDGSAC4s2+AGIBJAMoAJPlQBm8AM4ALKjgC+OXdngghwAE6Kk-YIUYAFY3QAOKjGLwAjJMYDWALiiu6dCjASCAA3Np6Bkam5pbiqmq2Dk5YuPgqAO6IvkLGYMAR2DhRJmYWsAjIKACySPbOaXgA2nCIqAB0xCQAur4ENnaOrI1QLZUdUnK9UPHqSY6FekIAnvZxAXwAPLzAAB5GIDROnsDLdIoVbTV1AHwAFCFXvtzMUDTCSL6tVbX2TdzdACUFBuUAAbnR4DRwkVsCs1lAAEriDaUbZQPYHI5QE5nC7fVC-e7vISfS4-Or-IEg8GQ6F6fh0EAqIRQRQBXwouh8B7jFCvRTBIRgYzAYHkUHoKA6bCM5ms4xc3zI1FQO6C4QisU09AynAAen1UAAosY7MYnFkhGoDUaYMYGJBQKzzlB4ZYAORSzLZPwBIIhULSj1QVRQEB0VlIFQqeAMEBIVxBN3c+weJAQYDRKCu91QD39BjzFQe9q2qBEVwAK2A-FZKHg0VQUGQyxzIBQbZUa348EUbc8EYyICg9kGJiE8GAKleIRo+Z9EBD9Gn4cjGN2qlZBjdq09heLpZw7LodwJKE6pFe3 |
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
/* | |
This removes consecutive sequences from an array of characters. | |
See examples below + a working example @ https://jsfiddle.net/63v4pbq7/5/ | |
*/ | |
dedupeSequence = (seq) => { | |
let sequences = []; | |
// The longest sequence can be exacly half of the values | |
const maxLength = Math.floor(seq.length / 2); | |
const stringSequence = seq.join(""); |
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
"languageserver": { | |
"daml": { | |
"command": "daml", | |
"args": ["damlc", "ide", "--RTS", "+RTS", "-M6G", "-N"], | |
"filetypes": ["daml"] | |
}, | |
} |
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
# Relies on ripgrep: https://github.com/BurntSushi/ripgrep | |
# | |
# Params: | |
# <library-name> a string with or without quotes | |
# | |
# Usage: | |
# $ ./extracAllNamedImports <library-name> | |
# Output | |
# $ ./getNamedImportsByLibrary.sh date-fns |
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
// Threading macros, also known as arrow macros, | |
// convert nested function calls into a linear flow of function calls, | |
// improving readability. The idea is similar to 'pipelining' | |
const double = str => `${str} ${str}`; | |
const reverse = str => str.split("").reverse().join(''); | |
const capitalize = str => str.charAt(0).toUpperCase() + str.slice(1); | |
const pad = (maxLength, chr = ' ') => str => str.toString().padEnd(maxLength, chr); | |
const thread = function thread(...args) { |
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 { PropertyControls, ControlType } from "framer"; | |
import { data } from "./Examples"; | |
export class ClickTrigger extends React.Component<any> { | |
static propertyControls: PropertyControls = { | |
number: { type: ControlType.Number, defaultValue: 0 } | |
}; | |
onClick = () => { |
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 { PropertyControls, ControlType, Override } from "framer"; | |
import { data } from "./Examples"; | |
const style: React.CSSProperties = { | |
height: "100%", | |
display: "flex", | |
alignItems: "center", | |
justifyContent: "center", | |
textAlign: "center", | |
color: "#8855FF", |
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 { render } from "react-dom"; | |
import "./styles.css"; | |
function App(props) { | |
return ( | |
<div className="App"> | |
<h1> {props.text}</h1> | |
</div> |
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 { render } from "react-dom"; | |
import "./styles.css"; | |
function App(props) { | |
return ( | |
<div className="App"> | |
<h1> {props.text}</h1> | |
</div> |
NewerOlder