Skip to content

Instantly share code, notes, and snippets.

@lysender
lysender / export-import-gpg-keys.md
Created July 1, 2020 03:35
Export and import GPG Keys

Export public key

gpg --export your_address@example.net > my_key.pub 

The file can then be shared to other people.

Export public key in armor ascii format

@eric1234
eric1234 / README.md
Last active May 2, 2024 08:26
Protect page with simple password

Purpose

Unauthorized access to a PHP page prompts the user for a password. Once the password is entered the original page will show.

Features

  • The access is recorded in the session so it only needs to be
@ruvnet
ruvnet / lion_x_rUv.py
Created April 12, 2024 21:28
LionAGI x rUv v0,01
import os
import asyncio
import subprocess
import importlib
import sys
from dotenv import load_dotenv
from lionagi import Session
from e2b_code_interpreter import CodeInterpreter
from llama_index.core import (
VectorStoreIndex,
@DoktorMike
DoktorMike / videoconversionsamples.sh
Last active May 2, 2024 08:23
Useful commands for converting videos using ffmpeg
#!/bin/bash
# Examples taken from https://opensource.com/article/17/6/ffmpeg-convert-media-file-formats
# Convert a webm file to a matroska format with a vp9 encoding and keeping the same audio encoding.
# Also changes the bitrate to 1Mb/s
ffmpeg -i input.webm -c:a copy -c:v vp9 -b:v 1M output.mkv
# Same but change the frame rate to 30 FPS and dropping the bitrate conversion
ffmpeg -i input.webm -c:a copy -c:v vp9 -r 30 output.mkv
# Same but only setting the video size to a predetermined format HD 720 in this case

AlpineJS with ViteJS

ViteJS is a modern JavaScript build tool that can be used to build modern JavaScript frameworks including ReactJS and VueJS to name only two. In this tutorial you will explore how to use ViteJS with AlpineJS. This will prepare you for using ViteJS with ReactJS or other modern web framework.

Modern JavaScript built tools like ViteJS, ParcelJS & react-create-app (built with webpack) embrace ES Modules. Meaning that external dependencies are installed via npm and imported. So no more script, style or link tags. HTML, CSS & JavaScript are bundled into compact bundle.

Create app using Vite

Let's start exploring ViteJS by creating a new application. Using this command:

@0xjac
0xjac / private_fork.md
Last active May 2, 2024 08:21
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@shreyasssk
shreyasssk / signing-keys.md
Last active May 2, 2024 08:21
Docker Image Signing

Signing Docker Images

For this demo I will be using a simple hello-world docker image, and tag it as shreyasssk/signatures:1

This creates a digital signature.

$ docker trust key generate key1

This command creates a .pub key in the directory where the

@hurricane-voronin
hurricane-voronin / README.md
Last active May 2, 2024 08:20
Naming Classes Without a 'Manager'
@jjsquady
jjsquady / nextjs-deploy.md
Last active May 2, 2024 08:20
Deploying NEXTJS site with nginx + pm2

How to setup next.js app on nginx with letsencrypt

next.js, nginx, reverse-proxy, ssl

1. Install nginx and letsencrypt

$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt

Also enable nginx in ufw

@stevdza-san
stevdza-san / HyperlinkText.kt
Last active May 2, 2024 08:19
Embedd a Hyperlink within a Text using Jetpack Compose.
import androidx.compose.foundation.text.ClickableText
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.unit.TextUnit