Skip to content

Instantly share code, notes, and snippets.

@wojteklu
wojteklu / clean_code.md
Last active May 4, 2024 16:57
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@niklasb
niklasb / robot_pwnage.py
Last active May 4, 2024 16:55
Exploit for 'wheel of robots' from insomni'hack 2017
import time
# https://github.com/niklasb/ctf-tools/blob/master/pwnlib/tools.py
from pwnlib.tools import *
TARGET=('localhost',5000)
INTERVAL=0
offset_free = 549184
offset_system = 0x456d0
@CMCDragonkai
CMCDragonkai / regular_expression_engine_comparison.md
Last active May 4, 2024 16:50
Regular Expression Engine Comparison Chart

Regular Expression Engine Comparison Chart

Many different applications claim to support regular expressions. But what does that even mean?

Well there are lots of different regular expression engines, and they all have different feature sets and different time-space efficiencies.

The information here is just copied from: http://regular-expressions.mobi/refflavors.html

@ymoslem
ymoslem / ChatGPT-translation.py
Last active May 4, 2024 16:50
Minimal working code for translation with GPT-4, "gpt-3.5-turbo" (a.k.a. ChatGPT) and "text-davinci-003"
# pip3 install openai
import openai
import time
OPENAI_API_KEY = "your_api_key_here"
openai.api_key = OPENAI_API_KEY
prompt = """French: La semaine dernière, quelqu’un m’a fait part de sa gratitude envers notre travail.
@leocomelli
leocomelli / git.md
Last active May 4, 2024 16:49
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

@thanhhnguyen23
thanhhnguyen23 / http.clj
Created May 4, 2024 16:43 — forked from danielsz/http.clj
Ring-compliant web server from scratch
(ns socket.http
(:require
[clojure.java.io :as io]
[clojure.string :as str]
[clojure.tools.logging :as log])
(:import [java.net ServerSocket]
[java.net SocketException]
[java.nio.file Files]
[java.io File]
[java.io InputStream OutputStream]))
@ovidiuvio
ovidiuvio / gist:b2be70614605356747bd43482ac52dfc
Created May 9, 2023 19:13
Running netbird (tailscale like wireguard solution) on EdgeRouter X
1. Install EdgeRouter wireguard-vyatta-ubnt kernel package from here
curl -L -O https://github.com/WireGuard/wireguard-vyatta-ubnt/releases/download/1.0.20220627-1/e50-v2-v1.0.20220627-v1.0.20210914.deb
dpkg -i e50-v2-v1.0.20220627-v1.0.20210914.deb
2. Install netbird for mipsel from here:
curl -L -O https://github.com/ovidiuvio/netbird/releases/download/v0.19.0-mipsel-4/netbird_0.19.0-mipsel-4_linux_mips_softfloat.tar.gz
tar -xf netbird_0.19.0-mipsel-4_linux_mips_softfloat.tar.gz
sudo mv netbird /usr/bin/
sudo netbird service install
sudo netbird service start
sudo netbird up
@NathanOyewole
NathanOyewole / jsLibraryMappings.xml
Created May 4, 2024 16:41
Hi, welcome! I'd to hear feedbacks from y'all.
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<includedPredefinedLibrary name="Node.js Core" />
</component>
</project>
@Restioson
Restioson / Readme.md
Last active May 4, 2024 16:42
[Obsidian] Search through your Fantasty Statblocks bestiary by CR/type

Monster Search

Search through your Fantasty Statblocks bestiary by monster CR and type, using Dataview!

image

How to add

  1. Make sure that Meta-Bind, Fantasy Statblocks, Dataview and is installed