Skip to content

Instantly share code, notes, and snippets.

View AlmogBaku's full-sized avatar
👨‍🦰
The Father of Contexts

Almog Baku AlmogBaku

👨‍🦰
The Father of Contexts
View GitHub Profile
@AlmogBaku
AlmogBaku / bitly.go
Last active May 8, 2024 15:36
Golang Bitly: simple, stupid shortener written in go
package bitly
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
const BaseURL = "https://api-ssl.bitly.com/v4"
@AlmogBaku
AlmogBaku / encoder.go
Created October 9, 2021 09:50
Sarama protobuf encoder
package protoencoder
import (
"github.com/Shopify/sarama"
"google.golang.org/protobuf/proto"
)
type encoder struct {
msg proto.Message
}
@AlmogBaku
AlmogBaku / README.md
Last active October 17, 2021 19:39
Filter OpenAPI JSON by tags

Usage

node filter.js <swagger.json> <tags,seperated,by,commas>

How does it work?

  1. Iterate over the ".paths"
  2. If has relevant tag, keep it. Otherwise, delete it
  3. For relevant paths: recursively fetch for references
  4. Recurcively look for references in the "definitions", and build a complete reference map
@AlmogBaku
AlmogBaku / 0-install-new-env.md
Last active April 15, 2025 10:52
New environment

Installations required on a new environment

  1. Install Bitwarden from App Store
  2. Install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Install Xcode Command Line Tools
    1.  xcode-select --install
@AlmogBaku
AlmogBaku / MediumConverter.py
Last active November 28, 2024 06:31
Medium to Markdown
import mimetypes
import os
import markdownify
import requests
mimetypes.init()
class MediumConverter(markdownify.MarkdownConverter):
@AlmogBaku
AlmogBaku / landing_page_gen.py
Created July 30, 2024 11:50
The example of the Prompt Engineering Tips article
# This snippet is used as an example for the Prompt Engineering Tips article
# The code was partially generated, and NOT PRODUCTION READY at any level. It's written in a way that shows the point
# of each tip, and the prompts are actually bad (even though they are functional, and for a prompt engineering tips
# article; lol)
#
# It should be seen as a pseudocode, and not as a final implementation, production code will require carefully
# SOP modeling, and a much more detailed process
#
# The goal is to give you a high-level perspective of the Tips detailed in the article, for readers who need to see
# "the whole picture" to understand the concept