This file contains hidden or 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
function includesCaseInsensitive(string: string, stringToSearch: string) { | |
return new RegExp(stringToSearch, "i").test(string); | |
} | |
const hey = includesCaseInsensitive("Follow me on Github!", "github"); | |
console.log(hey); |
This file contains hidden or 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 { isWindows } from "https://raw.githubusercontent.com/denoland/deno_std/0.150.0/_util/os.ts"; | |
export async function lintEnv() { | |
const binary = `./bin/dotenv-linter${isWindows ? ".exe" : ""}`; | |
const commands = [ | |
`find .config/environment/ -name *.env_* -delete | true`, | |
`${binary} fix .config/environment/.*`, | |
// `${binary} compare .config/environment/.*`, | |
]; |
This file contains hidden or 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 fs = require('fs'); | |
const readFileLines = filename => | |
fs | |
.readFileSync(filename) | |
.toString('UTF8') | |
.split('\n'); |
This file contains hidden or 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
[alias] | |
co = checkout | |
cob = checkout -b | |
coo = !git fetch && git checkout | |
br = branch | |
brd = branch -d | |
st = status | |
aa = add -A . | |
unstage = reset --soft HEAD^ | |
cm = commit -m |
This file contains hidden or 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
interface Pizza { | |
type: "pizza"; | |
slices: number; | |
} | |
interface Hamburger { | |
type: "hamburger"; | |
vegetarian: boolean; | |
} |
This file contains hidden or 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
export class NestedError<ErrorLike extends Error> extends Error { | |
private nestedError: ErrorLike; | |
constructor(config: { message?: string; nestedError: ErrorLike }) { | |
const { message = "", nestedError } = config; | |
super(message); | |
this.nestedError = nestedError; |
This file contains hidden or 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
export function denoRun(args: string[], options: Partial<Deno.RunOptions> = {}) { | |
return Deno.run({ | |
cmd: ["deno", ...args], | |
stdout: "null", | |
stderr: "null", | |
...options, | |
}); | |
} |
This file contains hidden or 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 -S deno run --allow-run | |
const checkFormatprocess = Deno.run({ | |
cmd: ["deno", "fmt", "--check", "."], | |
stdout: "null", | |
stderr: "null", | |
}); | |
const lintProcess = Deno.run({ | |
cmd: ["deno", "lint", "."], |
This file contains hidden or 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
#include <fstream> | |
#include <iostream> | |
#define SOURCE_SIZE 10000 | |
#define MEMORY_SIZE 30000 | |
using std::cout; | |
using std::endl; | |
void bf_execute(char *src, int *mem, int loop) { |
This file contains hidden or 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
VALID_VOWELS = ["A", "E", "I", "O", "U", "a", "e", "i", "o", "u"] | |
consonants = "bcdfghjklmnpqrstvwxz" + "BCDFGHJKLMNPQRSTVWXZ" | |
def is_vowel(string): | |
return string in VALID_VOWELS | |
RULERS = {"vowels": "Alice", "consonants": "Bob", "y": "nobody"} |