Skip to content

Instantly share code, notes, and snippets.

View UltiRequiem's full-sized avatar
:shipit:
I ask not for a lighter burden, but for broader shoulders.

Eliaz Bobadilla UltiRequiem

:shipit:
I ask not for a lighter burden, but for broader shoulders.
View GitHub Profile
function includesCaseInsensitive(string: string, stringToSearch: string) {
return new RegExp(stringToSearch, "i").test(string);
}
const hey = includesCaseInsensitive("Follow me on Github!", "github");
console.log(hey);
@UltiRequiem
UltiRequiem / Taskfile.ts
Created August 3, 2022 01:34
shipsigma-apps
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/.*`,
];
const fs = require('fs');
const readFileLines = filename =>
fs
.readFileSync(filename)
.toString('UTF8')
.split('\n');
[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
@UltiRequiem
UltiRequiem / pizza.ts
Created June 14, 2022 01:13
TypeScript Array Type Guards explicados en dos minutos
interface Pizza {
type: "pizza";
slices: number;
}
interface Hamburger {
type: "hamburger";
vegetarian: boolean;
}
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;
@UltiRequiem
UltiRequiem / denoRun.ts
Last active March 30, 2022 16:49
Run a deno subcommand
export function denoRun(args: string[], options: Partial<Deno.RunOptions> = {}) {
return Deno.run({
cmd: ["deno", ...args],
stdout: "null",
stderr: "null",
...options,
});
}
@UltiRequiem
UltiRequiem / lint.ts
Created March 30, 2022 16:23
Check and Lint deno code format
#!/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", "."],
@UltiRequiem
UltiRequiem / brainfuck.cpp
Created February 25, 2022 16:56
A simple, not completly working Brain F**ck compiler on C++ | When did I learn C++???
#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) {
@UltiRequiem
UltiRequiem / over_complicated.py
Created February 14, 2022 20:38
centaui_prime
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"}