Skip to content

Instantly share code, notes, and snippets.

View darlanalves's full-sized avatar
🏠
Writing some code when I'm not busy writing code

Darlan Alves darlanalves

🏠
Writing some code when I'm not busy writing code
View GitHub Profile
import path from 'path';
console.log(Object.keys(path));
@darlanalves
darlanalves / border.css
Created June 22, 2023 14:45
Gradient border color on a box
.border {
position: relative;
background-clip: padding-box;
border: 1px solid transparent;
border-radius: var(--brand-borderRadius-large);
}
.border::before {
content: "";
position: absolute;
@darlanalves
darlanalves / http.mjs
Created August 31, 2023 12:28
Http server for local development in Node.js
#!/usr/bin/env node
// Save this file somewhere and make it executable: `chmod +x http.mjs`, then add to $PATH.
// Just run `http.mjs` from any folder to serve the files.
import { createServer } from 'node:http';
import { join } from 'node:path';
import { createReadStream, existsSync } from 'node:fs';
import process from 'node:process';
#!/usr/bin/env node
// generate a shell command from a text input
import { request } from 'node:https';
import { exec } from 'node:child_process';
import { createInterface } from 'node:readline/promises';
import { stdin as input, stdout as output } from 'node:process';
async function call() {