Skip to content

Instantly share code, notes, and snippets.

@alifeee
alifeee / jump-to-duckduckgo-results.js
Last active November 11, 2024 10:52
jump to duckduckgo lite search results (TamperMonkey Script) - <https://www.tampermonkey.net/>
// ==UserScript==
// @name jump between DuckDuckGo Lite results
// @namespace http://tampermonkey.net/
// @version 2024-11-11
// @description when on https://lite.duckduckgo.com/lite, jump quickly between search results by pressing CTRL+1, CTRL+2, etc.
// @author alifeee
// @homepage https://gist.github.com/alifeee/7936b864bbc6fefb6d74162a1a81123d
// @match https://lite.duckduckgo.com/lite*
// @icon https://alifeee.co.uk/robot.png
// @grant none
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 9 columns, instead of 3 in line 4.
List Entry Name,List Entry Number,Link,Heritage Category,Grade,Location,OS Grid Reference,latitude,longitude
SEWER GAS LAMP,1246769,https://historicengland.org.uk/listing/the-list/list-entry/1246769,Listing,II,SEWER GAS LAMP BISHOPCOURT ROAD Non Civil Parish SHEFFIELD| Sheffield,SK3547184041,53.35207495059936,-1.4685722449868464
SEWER GAS LAMP AT JUNCTION WITH WESTHILL LANE,1271101,https://historicengland.org.uk/listing/the-list/list-entry/1271101,Listing,II,SEWER GAS LAMP AT JUNCTION WITH WESTHILL LANE BROOMHALL STREET Non Civil Parish SHEFFIELD| Sheffield,SK3479987154,53.38009982572962,-1.4783263352645517
SEWER GAS LAMP AT JUNCTION WITH NICHOLSON ROAD,1246499,https://historicengland.org.uk/listing/the-list/list-entry/1246499,Listing,II,SEWER GAS LAMP AT JUNCTION WITH NICHOLSON ROAD KENT ROAD Non Civil Parish SHEFFIELD| Sheffield,SK3560284732,53.35827704651085,-1.4665266837756366
SEWER GAS LAMP AT JUNCTION WITH MONCKTON ROAD,1247376,https://historicengland.org.uk/listing/the-list/list-entry/12473
@alifeee
alifeee / .convert image
Last active November 8, 2024 23:45
nautilus convert image script (place in `~/.local/share/nautilus/scripts/`)
#!/bin/bash
# convert an image from something to something else
original_image="${1}"
echo "given file: ${original_image}"
if [ ! -f "${original_image}" ]; then
read -p "file does not exist, press ENTER to quit" ENTER
exit 1
@alifeee
alifeee / clone.desktop
Last active November 8, 2024 17:12
quickly clone a github repository (Gnome desktop launcher)
# https://gist.github.com/alifeee/bb0499e1272f312b82497031d28e91f2
# place in /usr/share/applications/clone.desktop
[Desktop Entry]
Version=0.1.0
Name=Git Clone
Comment=Clone a GitHub repository
Exec=/home/alifeee/Desktop/clone.sh
Terminal=true
Type=Application
Categories=Utility;Application;
@alifeee
alifeee / guide.sh
Last active September 1, 2024 12:48
bash script to get the upcoming programmes on BBC TV channels (TV guide)
#!/bin/bash
# get upcoming programs for a BBC TV channel
# https://gist.github.com/alifeee/acf55f9141f534e90eabbb7fceffaf44
# i.e., from the links
# https://www.bbc.co.uk/iplayer/guide/bbcone
# https://www.bbc.co.uk/iplayer/guide/bbctwo
# https://www.bbc.co.uk/iplayer/guide/bbcthree
# https://www.bbc.co.uk/iplayer/guide/bbcfour
# requires:
# pcregrep, jq
@alifeee
alifeee / google-form-to-github-issue.md
Last active August 17, 2024 21:41 — 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
Last active September 1, 2024 11:51
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
# ███░░░░░░░░░
bar () {
# $1 $2 $3 are progress total total_segments
# shows progress/total using total_segments characters
if [ $1 == "0" ] && [ $2 == "0" ]; then
@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 / ffmpeg-commands.md
Last active October 28, 2024 16:13
FFmpeg commands

FFmpeg Commands

see video information

# see all information
ffmpeg -i input.mp4
# format resolution nicely
ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 input.mp4
@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