Skip to content

Instantly share code, notes, and snippets.

@alifeee
alifeee / how-to-blog.md
Last active April 21, 2024 23:52
how to create a blog?

How to start blogging

You might not think you should blog. I think you should.

I like your thoughts! I want to be able to read them!

Here are some other reasons:

@alifeee
alifeee / nginx and HTTPS setup.md
Last active April 17, 2024 14:38
nginx-setup

Nginx setup on Ubuntu

How to set up nginx on an ubuntu server

Steps

install

sudo apt install nginx
{
"basics": {
"name": "Alfie Renn",
"label": "Software Engineer",
"image": "https://cv.alfierenn.dev/profile-picture.png",
"email": "alfie@alfierenn.dev",
"phone": "",
"url": "https://alifeee.co.uk",
"summary": "Hi! I'm Alfie: physics graduate, toki pona speaker, and software engineer. I love to make beautiful things with code (mainly using HTML/CSS/JavaScript and Python), including websites, apps, and graphs. With all my work I create good quality, robust, and well-tested code, as well as powerful automation and well-organised git repositories, empowering collaboration. Do check out my website and GitHub!",
"location": {
@alifeee
alifeee / google-form-to-github-issue.md
Last active April 5, 2024 15:46 — forked from bmcbride/google-form-to-github-issue.md
Create a new GitHub Issue from a Google Form submission

Wiring up a Google Form to GitHub is not that difficult with a little bit of Apps Script automation. All you need is a Google account, a GitHub account, and a web browser...

Set up your GitHub Personal Access Token

Personal access tokens provide an easy way to interact with the GitHub API without having to mess with OAuth. If you don't already have a personal access token with repo or public_repo access, visit your GitHub settings page and generate a new token.

Be sure to copy your token some place safe and keep it secure. Once generated, you will not be able to view or copy the token again.

Set up the Form & Spreadsheet

  1. Create a Google Form.
@alifeee
alifeee / bar.sh
Created March 26, 2024 20:03
Simple bar chart generation with bash
#!/bin/bash
# make bar chart from $prog, $total, $n_seg as $1 $2 $3
# example:
# > ./bar.sh 25 100 12
# ███░░░░░░░░░
awk -v prog=$1 -v TOTAL=$2 -v TOTSEG=$3 'BEGIN {
frac = prog / TOTAL;
segs = frac * TOTSEG;
segs_int = int(sprintf("%.0f", segs));
{
"last_modified": "2024-03-25T00:44:15.551843Z",
"bookmarks": {
"TOP 10 personal websites/blogs": [
{
"title": "Tom Forth's Homepage",
"url": "https://www.tomforth.co.uk/",
"date_added": "2023-05-29T18:23:46.689000Z",
"last_modified": "2023-11-12T22:19:05.160000Z"
},
@alifeee
alifeee / naked.sh
Created March 17, 2024 17:06
Remove all CSS styles from HTML files with bash
#!/bin/bash
# script to remove stylesheets, style tags, and inline styles from an HTML file
# 1. remove <link rel="stylesheet" ...>
# 2. remove <style> ... </style>
# 3. remove style="..." attributes
# notes:
# perl "0777" is so that perl sees newlines as "any character" (so <link> can wrap onto new lines)
# "|gms" helps with the same thing. see https://regex101.com/
# example:
# ./naked.sh index.html > index-naked.html
@alifeee
alifeee / bash-graphs.md
Last active March 15, 2024 18:54
Plot graphs using the terminal (bash)

Bash Graphs

Plot graphs using the terminal. E.g.,

> cat sensor.txt | awk -F ':| *' '{print $2}' | eplot -d -t CO2 2> /dev/null

  4000 +-------------------------------------------------------------------+
       |         +      +.+.+       +         +         +        +         |
       |                :    .+                                CO2 +.....+ |
@alifeee
alifeee / ffmpeg-commands.md
Created March 14, 2024 21:42
FFmpeg commands

FFmpeg Commands

Turn mp4 into gif

Used here. From here.

ffmpeg -y -i input.mp4 -filter_complex "fps=5,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen=max_colors=32[p];[s1][p]paletteuse=dither=bayer" output.gif
@alifeee
alifeee / ruby-and-jekyll-on-linux.md
Created March 14, 2024 20:24
How to use Ruby and Jekyll on Linux

Using Ruby on Linux

Install Ruby + Gems

sudo apt-get install ruby-full
gem install bundler
bundle config set --local path 'vendor/bundle'
bundle install