Skip to content

Instantly share code, notes, and snippets.

Avatar

Eliaz Bobadilla UltiRequiem

View GitHub Profile
View docker-compose.yml
version: "3.8"
services:
postgres:
image: postgres
container_name: postgres
restart: always
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
@UltiRequiem
UltiRequiem / heey.py
Created Nov 2, 2022
monitor setup py
View heey.py
from os import popen, system
PRINCIPAL_MONITOR = popen("xrandr --query | grep primary").read().split()[0]
class Monitor:
def __init__(self, name, side):
self.name = name
self.side = side
@UltiRequiem
UltiRequiem / index.html
Created Sep 27, 2022
arrow-like containers
View index.html
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="main.css" />
</head>
<body>
<div class="cool red-bg">
<h2>One</h2>
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Aliquam culpa
reiciendis quod tempora totam in unde ullam necessitatibus molestias
View includesCaseInsensitive.ts
function includesCaseInsensitive(string: string, stringToSearch: string) {
return new RegExp(stringToSearch, "i").test(string);
}
const hey = includesCaseInsensitive("Follow me on Github!", "github");
console.log(hey);
View Taskfile.ts
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/.*`,
];
View readFileLines.js
const fs = require('fs');
const readFileLines = filename =>
fs
.readFileSync(filename)
.toString('UTF8')
.split('\n');
View .gitconfig
[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 Jun 14, 2022
TypeScript Array Type Guards explicados en dos minutos
View pizza.ts
interface Pizza {
type: "pizza";
slices: number;
}
interface Hamburger {
type: "hamburger";
vegetarian: boolean;
}
View nestedError.ts
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 Mar 30, 2022
Run a deno subcommand
View denoRun.ts
export function denoRun(args: string[], options: Partial<Deno.RunOptions> = {}) {
return Deno.run({
cmd: ["deno", ...args],
stdout: "null",
stderr: "null",
...options,
});
}