Skip to content

Instantly share code, notes, and snippets.

View jpedro's full-sized avatar
🐤
"True courage is knowing you’re wrong but refusing to admit it"

Pedro Barbosa jpedro

🐤
"True courage is knowing you’re wrong but refusing to admit it"
View GitHub Profile
@jpedro
jpedro / tailwind.md
Last active January 24, 2025 18:10 — forked from devinschumacher/post.md
Common Webpage Layouts With TailwindCSS Using CSS Grid & Flex box (w/ Code Examples)

Common Layouts

Creating common layouts With Tailwind using css grid & Flex box.

  • CSS Grid: for the main page layout (header, main content, sidebar, footer)
@jpedro
jpedro / gist:57f12efa738cf1176aa7125fe1ddefaa
Created August 14, 2024 04:11 — forked from kbaribeau/gist:4495181
The source code for the unix `ping` command, taken from here: http://ftp.arl.army.mil/~mike/ping.html
# This is a shell archive. Remove anything before this line, then
# unpack it by saving it in a file and typing "sh file". (Files
# unpacked will be owned by you and have default permissions.)
#
# This archive contains:
# Makefile ping.1 ping.c ping.shar newping.1 newping.c
echo x - Makefile
cat > "Makefile" << '//E*O*F Makefile//'
@jpedro
jpedro / status.sh
Last active March 30, 2024 12:59
Quick and dirty HTTP status check
#!/usr/bin/env bash
set -uo pipefail
STATUS_CHUNKS="${STATUS_CHUNKS:-10}"
URL="${1:-}"
if [[ "$URL" == "" ]]
then
echo >&2 "Usage: $0 URL"
exit 1
@jpedro
jpedro / HelloWorld.java
Created January 9, 2024 11:34 — forked from lolzballs/HelloWorld.java
Hello World Enterprise Edition
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();
@jpedro
jpedro / tree.lua
Created December 13, 2023 11:44 — forked from rsc/tree.lua
tree comparison using lua coroutines
#!/usr/local/bin/lua
function T(l, v, r)
return {left = l, value = v, right = r}
end
function visit(t)
if t ~= nil then -- note: ~= is "not equal"
visit(t.left)
coroutine.yield(t.value)
@jpedro
jpedro / udpserv.go
Created August 12, 2023 01:02 — forked from miekg/udpserv.go
Simple udp server in Go
package main
import (
"log"
"net"
)
func main() {
// listen to incoming udp packets
pc, err := net.ListenPacket("udp", ":1053")
@jpedro
jpedro / ANSI.md
Created July 7, 2023 20:05 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@jpedro
jpedro / tor.md
Created July 4, 2023 04:33 — forked from maximousblk/tor.md
A super simple guide to starting up your own Tor hidden service

Host your own Tor hidden service!

A super simple guide to spinning up a Tor hidden service. [tl;dr]

Ubuntu 20.04 LTS was used for the making of this guide.

Install Tor

you can install Tor using the following command

@jpedro
jpedro / introrx.md
Created May 8, 2023 07:58 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@jpedro
jpedro / README.MD
Created March 10, 2023 23:19 — forked from Buckwich/README.MD
Sankey Diagram with Google Spreadsheets

Sankey Diagrams within Google Spreadsheets

This Gist is there to help you creating a Sankey Diagram from your Google Spreadsheets.

Fork of @njoerd114

Changes:

  • update usage instruction for new Apps Script IDE
  • does not need document Id (@steren)
  • supports named sheet (not default, see customization in code.gs)