Skip to content

Instantly share code, notes, and snippets.

View jerlendds's full-sized avatar
💭
🦷🧵🦾

jerlendds jerlendds

💭
🦷🧵🦾
View GitHub Profile
import requests
class PlacesAutocomplete:
"""https://developers.google.com/maps/documentation/places/web-service/autocomplete?hl=id
Args:
components (str) : expects country code e.g. country:ca
place_types (str) : e.g. (cities)
key (str) : Google Places autocomplete API key
#!/usr/bin/python
# -*- coding: utf-8 -*-
# tuic - textual user interface controller
# Experiments With Curses | 2021, July 17
# I'm currently working on writing a simple TUI for a web crawler
# that supports scraping and analyzing anything you want to write a plugin for.
# This file creates two windows and draws boxes around the created windows
# The windows respond to the terminal resizing and the terminal display will be redrawn to reflect the new size
# KNOWN ISSUES: When terminal size becomes too small the program crashes
from dataclasses import dataclass
@dataclass
class HexCode(str):
hex: str
def rgb(self):
hex_string = self.hex.lstrip('#')
lv = len(hex_string)
return tuple(int(hex_string[i:i + lv // 3], 16) for i in range(0, lv, lv // 3))
@jerlendds
jerlendds / get_cse_set.py
Last active August 26, 2021 00:08
Retrieve all CSE links from a start.me webpage by passing in the page id
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from typing import List
import requests
import json
def get_startme_links(page_ids: List[str] = None):
if page_ids is None:
raise ValueError(f"expected list of start.me ids, received: {page_ids}")
#!/bin/bash
PROJECT_NAME=todo
SEMVER_FILE=./version.sh
version=0.0.0
if [ -f "$SEMVER_FILE" ]; then
source $SEMVER_FILE
version=$SEMVER
fi
[
{
"label": "GEOSINTsearch",
"description": "Searches within posts from Twitter, Reddit and 4Chan and presents anything that contains a Google Maps link",
"value": "https://cse.google.com/cse?cx=015328649639895072395:sbv3zyxzmji"
},
{
"label": "Pasted tekst",
"description": "Look if any specifc text has been posted before",
"value": "https://cse.google.com/cse/publicurl?cx=013991603413798772546:nxs552dhq8k"
@jerlendds
jerlendds / mp4-to-gif
Last active February 14, 2024 03:31
mp42gif
#!/bin/bash
ffmpeg \
-i "$1" \
-r "$2" \
-vf "scale=512:-1,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" \
"$1.gif"
@jerlendds
jerlendds / .bashrc.sh
Last active June 26, 2025 22:54
.bashrc
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
alias ls='ls --color=auto'
alias grep='grep --color=auto'
@jerlendds
jerlendds / gitgraph.sh
Created June 26, 2025 23:06
gitgraph
#!/bin/env bash
# https://stackoverflow.com/a/61487052
# Create some nice table-like logs for a beautiful output
while IFS=+ read -r graph hash time branch message;do
# Count needed amount of white spaces and create them
whitespaces=$((9-$(sed -nl1000 'l' <<< "$graph" | grep -Eo '\\\\|\||\/|\ |\*|_' 2>/dev/null | wc -l)))
whitespaces=$(seq -s' ' $whitespaces|tr -d '[:digit:]')
# Show hashes besides the tree ...
@jerlendds
jerlendds / config
Created June 26, 2025 23:23
.ssh/config
Host codeberg.org
HostName codeberg.org
IdentitiesOnly yes
HostName codeberg.org
IdentityFile ~/.ssh/id_codeberg
Host github.com
IdentitiesOnly yes
HostName github.com
IdentityFile ~/.ssh/id_github