Skip to content

Instantly share code, notes, and snippets.

View lucasew's full-sized avatar
🤓
Learning

Lucas Eduardo lucasew

🤓
Learning
  • Universidade Tecnológica Federal do Paraná
  • Santa Helena - PR
View GitHub Profile
@jaawerth
jaawerth / 0_zalgo.md
Last active April 11, 2024 02:49
Yep, now we're compiling to cursed fennel, THEN evaluating to lua. You don't even want to see the Lua, really.

zalgo.fnl

  1. Like many Lisps, Fennel is extremely permissive about what it considers to be valid identifiers in code so long as delimiters like ()[]{} are properly respected and known identifiers/symbols (builtin macros/special forms, known functions, etc) are left alone.
  2. And by anything, I do mean anything.
  3. Zalgo-text generators have been pretty popular lately; they more or less just dump patterns of garbage unicode codepoints between the actual characters in strings until computers can no longer properly render it. It's pretty funny; sometimes it will look different in different contexts even in the same application on the same machine.
  4. So why the hell not, let's have Fennel compile itself to zalgo.

zalgo fnl

What?

Arch Linux ARM on Crostini

Screenshot

I got Arch Linux ARM installed on a Lenovo Chromebook Duet! I mostly used the instructions from the Arch Wiki as reference.

0. Before we begin

@AndersonTorres
AndersonTorres / zig-em-30-minutos.org
Last active July 10, 2024 04:28
Zig em 30 Minutos (Tradução)
@hizkifw
hizkifw / cloudflare-worker-youtube-dl.js
Last active July 13, 2024 21:37
Download YouTube videos with Cloudflare Worker
/**
* cloudflare-worker-youtube-dl.js
* Get direct links to YouTube videos using Cloudflare Workers.
*
* Usage:
* GET /?v=dQw4w9WgXcQ
* -> Returns a JSON list of supported formats
*
* GET /?v=dQw4w9WgXcQ&f=251
* -> Returns a stream of the specified format ID
@Muzietto
Muzietto / useDelayedEffect.js
Last active March 21, 2022 17:18
useDelayedEffect - using setTimeout in React functional components (custom hook)
import { useEffect, useRef } from 'react';
function useDelayedEffect(effect, changingStateVars = [], delay = 1000) {
const mutable = useRef();
const delayedEffect = () => {
mutable.current = setTimeout(effect, delay);
return () => {
clearTimeout(mutable.current);
@rohan-molloy
rohan-molloy / 01-Network-Isolation-of-Services-with-Systemd.md
Last active July 9, 2024 23:47
This tutorial will look at how network namespaces can be defined in systemd service unit definitions

Network Isolation of Services with Systemd

Network namespaces are an important component of containerization in Linux. A network namespace (netns) allows a running process to see different network interfaces, routes, and firewall rules from the rest of the system. There are a number of use cases for network namespaces, such as running multiple servers, testing/staging environments and providing isolation of services.

Creating a Network Namepsace

We begin by creating a generic systemd service for creating a named network namespace. I add the following to /usr/lib/systemd/system/netns@.service. In systemd, the @ mean the service takes a parameter which is passed to the unit via %i. E.g, we can run sudo systemctl start netns@webserver.service.

@lheckemann
lheckemann / 0-readme.md
Last active March 11, 2024 13:11
Expression for a buildEnv-based declarative user environment.

Expression for a buildEnv-based declarative user environment

This is one way of managing your user profile declaratively.

Alternatives include:

  • an attrset-based nix-env-based environment, installed using nix-env -ir rather than nix-env --set. LnL has an overlay which shows a way of doing this.
  • home-manager, which provides NixOS-like config for your $HOME

Note that this is incompatible with regular imperative use of nix-env, e.g. nix-env -iA nixpkgs.hello. It has the advantage of allowing the installation of multiple outputs of the same package much better than nix-env's builtin profile builder does.

@Pulimet
Pulimet / AdbCommands
Last active July 17, 2024 12:55
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@Maddosaurus
Maddosaurus / Alternative_Keypad.md
Last active February 9, 2021 01:02
Binding Multimedia keys in i3

Alternative bindings for the 540p using pactl and i3 - Keyboard

 # set laptop display to lower res - thats better
 exec  xrandr --output eDP1 --mode 1920x1080
 
 # set Numlock to on at login time
 exec --no-startup-id numlockx on
 
 # start pidgin on launch
@dannguyen
dannguyen / sqlmd.sh
Last active June 13, 2022 20:05
A command-line function that runs a SQLite query and gets a Markdown-ready table; See console demo at https://asciinema.org/a/89573
### sqlmd
# Bash function for outputting SQLite results in Markdown-friendly table
### Dependency:
# csvlook can be found here: http://csvkit.readthedocs.io/en/540/scripts/csvlook.html
### USAGE
# $ sqlmd "SELECT name, age FROM people;" optional_db_name_argument.sqlite
### OUTPUT