Skip to content

Instantly share code, notes, and snippets.

@OrionReed
OrionReed / DOM3D.js
Last active March 28, 2024 11:37
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@pyr0ken
pyr0ken / gist:1bce2c0b52ccb76fa9d51b838894f20e
Created February 5, 2024 19:34
backup python script and save in s3

Backup with python and save in S3

#!/usr/bin/python3

import logging
import os
import pytz
import boto3
import subprocess
@janakiramm
janakiramm / langchain_gemini_qa.py
Created March 14, 2024 07:01
Python code to build a Q&A application based on Gemini, Chroma, and VectorDB
### Install required modules and set the envvar for Gemini API Key
#pip install pypdf2
#pip install chromadb
#pip install google.generativeai
#pip install langchain-google-genai
#pip install langchain
#pip install langchain_community
#pip install jupyter
#export GOOGLE_API_KEY="YOUR_GOOGLE_API_KEY"
@janakiramm
janakiramm / langchain_gemini_summarization.py
Created March 14, 2024 09:56
Python code to build a content summarization application based on Gemini and LangChain
### Install required modules and set the envvar for Gemini API Key
#pip install google.generativeai
#pip install langchain-google-genai
#pip install langchain
#pip install langchain_community
#pip install jupyter
#export GOOGLE_API_KEY="YOUR_GOOGLE_API_KEY"
#Import Modules
@gsaslis
gsaslis / 01_Radicle_in_containers.md
Last active March 28, 2024 11:30
Running Radicle Nodes in Containers

Running in Containers

In case you want to run radicle in containers, on the same host (e.g. your laptop), you can use the docker-compose.yml file provided within this repo.

1. Create a profile

  1. Create a folder where you will store the data of your node. e.g. mkdir -p ~/radicle/profiles/bob/.radicle
  2. Set RAD_HOME : export RAD_HOME=~/radicle/profiles/bob/.radicle
  3. Create a key:
  • Pick a good passphrase and store it in your password manager
@brav0charlie
brav0charlie / RBC_Zettelkasten_in_Logseq.css
Created March 28, 2023 20:24
RBC_Zettelkasten_in_Logseq.css: Roam Book Club Zettelkasten CSS in Logseq
/*
File: RBC_Zettelkasten_in_Logseq.css
Description:
This CSS file is my attempt at 'porting' the Roam Book Club Zettelkasten
CSS for use in Logseq.
NOTES:
- There are tags created for the three "projects" in the source css. You're intended
@EdnilsonRobert
EdnilsonRobert / ssh.md
Created August 23, 2019 00:53
Múltiplas chaves SSH para GitHub e GitLab

Múltiplas chaves SSH para GitHub e GitLab

1. Gerar Chaves SSH

ssh-keygen -t rsa -C "user@email.com" -b 4096 -f ~/.ssh/id_rsa_github
ssh-keygen -t rsa -C "user@email.com" -b 4096 -f ~/.ssh/id_rsa_gitlab

2. Copiar chaves para GitHub e GitLab

@suru-dissanaike
suru-dissanaike / make-keys.sh
Last active March 28, 2024 11:24
Create self-signed certificates for Eclipse Mosquitto MQTT broker
#!/bin/bash
IP="192.168.1.22"
SUBJECT_CA="/C=SE/ST=Stockholm/L=Stockholm/O=himinds/OU=CA/CN=$IP"
SUBJECT_SERVER="/C=SE/ST=Stockholm/L=Stockholm/O=himinds/OU=Server/CN=$IP"
SUBJECT_CLIENT="/C=SE/ST=Stockholm/L=Stockholm/O=himinds/OU=Client/CN=$IP"
function generate_CA () {
echo "$SUBJECT_CA"
openssl req -x509 -nodes -sha256 -newkey rsa:2048 -subj "$SUBJECT_CA" -days 365 -keyout ca.key -out ca.crt