Skip to content

Instantly share code, notes, and snippets.

# Refer to:
#How to extract meta description from urls using python? - Stack Overflow:
#https://stackoverflow.com/questions/38009787/how-to-extract-meta-description-#from-urls-using-python
import appex
import clipboard
def main():
if not appex.is_running_extension():
@RyanGreenup
RyanGreenup / git_changes_fzf.sh
Created February 19, 2021 02:57
Review Git changes using fzf
git log | grep '^commit' | sed 's/^commit\ //' |\
fzf --preview 'git diff {}^! |\
bat --color always'
@RyanGreenup
RyanGreenup / shelling-simulation.jl
Created March 22, 2021 05:31
Shelling Simulation in Julia
# using PyPlot
using GR
using ColorSchemes
N = 2000
try
mkdir("~/Sync/Documents/tmp/gifs")
catch
end
library(ggplot2)
# Enter the data in such a way to match the Plot
data <-
rbind(
c("C", 0.97, 1135),
c("C++", 0.84, 3542),
c("Go", 3.75, 894),
c("Rust", 0.93, 763),
@RyanGreenup
RyanGreenup / SetCranMirror.bas
Created August 1, 2021 02:32
Set the mirror for R so it doesn't ask when installing packages, use stow to manage symlinks.
#!/bin/bash
IFS="\n"
# Set Directories ............................................
DotFiles="~/DotFiles/"
R_DotFiles="${DotFiles}R/"
# Main Function.............................................
main() {
## Make the directory
@RyanGreenup
RyanGreenup / skim_local_mediawiki.bash
Created August 2, 2021 06:51
If yuu're running a local mediawiki, this will fzf over the filenames and offer a text preview before opening the page in the browser
#!/bin/bash
SERVER_DIR="/srv/http/"
DB="${SERVER_DIR}/mediawiki/data/my_wiki.sqlite"
IP="localhost"
PORT="80"
page_name="$(sqlite3 "${DB}" 'SELECT page_title FROM page;' | sk --ansi --preview "sqlite3 "${DB}" 'SELECT old_text FROM text WHERE old_id is ( SELECT content_id FROM content where content_sha1 is ( SELECT rev_sha1 FROM revision WHERE rev_id is ( SELECT page_latest FROM page WHERE page_title is \"{}\")));' | bat --color=always -l org")"
firefox "http://${IP}:${PORT}/mediawiki/index.php/${page_name}"
## * Packages
library(mise)
mise()
## * Constnats .............................................
## Observed Values
obs <- rbind(
c(1070, 1090, 1090),
c(1090, 1020, 990)
)
@RyanGreenup
RyanGreenup / self-signed-certificate-with-custom-ca.md
Created September 17, 2021 06:15 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@RyanGreenup
RyanGreenup / Fezzik_Example.md
Created January 23, 2023 04:16
Cache Julia SysImages for faster run time

Using SysImages to Speed up Julia

Install Fezzik

First install Fezzik, this has been around since 2019 and actively maintained, but it's only available from source:

using Pkg
## Write in the data
o <- rbind(
c(264, 127, 99),
c(161, 116, 67)
)
colnames(o) <- c("Border", "Grass", "Sand")
rownames(o) <- c("Moringa", "Vicinus")
## First let's get our chi value
## Expected values