Skip to content

Instantly share code, notes, and snippets.

View lonelydev's full-sized avatar
🏠
Working from home

Eakan lonelydev

🏠
Working from home
View GitHub Profile
@lonelydev
lonelydev / fastsearch-addition.js
Created February 26, 2024 00:58
Hugo-PaperMod optimised search using fusejs in fastsearch.js
// add this snippet to your version of the fastsearch.js
// I copied the Hugo-PaperMod's fastsearch.js to my local assets/js/
// then added the following code to trigger search after a 600ms delay
// I also listen to the input event
function debounce(fn, delay = 600){
let timeoutId;
// fn could be invoked with more than one argument
return function(...arg){
if (timeoutId) {
clearTimeout(timeoutId);
@lonelydev
lonelydev / home_info.html
Created February 25, 2024 23:08
Modified home_info.html for Hugo-PaperMod
{{- with site.Params.homeInfoParams }}
<article class="first-entry home-info">
<div class="profile_inner">
{{- if .imageUrl -}}
{{- $img := "" }}
{{- if not (urls.Parse .imageUrl).IsAbs }}
{{- $img = resources.Get .imageUrl }}
{{- end }}
{{- if $img }}
{{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}}
@lonelydev
lonelydev / bmc-button.html
Created January 10, 2024 18:13
bmc-button partial template
<!-- Based on the shortcode -
https://github.com/isqua/hugo-shortcodes/blob/main/themes/hugo-shortcodes/layouts/shortcodes/bmc-button.html -->
{{ if .Site.Params.ShowBuyMeACoffeeButton }}
<div class="bmc-button-container">
{{- $slug := default .Site.Params.HugoShortcodes.BuyMeACoffee.Slug | default "" -}}
{{- $text := default .Site.Params.HugoShortcodes.BuyMeACoffee.Text | default "Buy me a coffee" -}}
{{- $font := default .Site.Params.HugoShortcodes.BuyMeACoffee.Font | default "Cookie" -}}
{{- $emoji := default .Site.Params.HugoShortcodes.BuyMeACoffee.Emoji | default "" -}}
@lonelydev
lonelydev / hugo-new-post-shortcut
Last active December 25, 2022 16:22
A little wrapper function to create a new hugo post with the title and timestamped
function hnp() {
post_name=$1
if [[ -z $post_name ]] || [[ ${#post_name} -lt 5 ]]; then
echo "ERROR: Please provide a name for your post! Names must be at least 5 characters long."
echo "Usage: hnp this-is-my-post"
return 1
fi
hugo new "post/"`date +"%Y-%m-%d"`"-$post_name.md"
}
@lonelydev
lonelydev / .asci_home
Created May 24, 2021 20:46
configuration for git and git-bash
( )
( )
( )
( )
) )
( ( /\
(_) / \ /\
________[_]________ /\/ \/ \
/\ /\ ______ \ / /\/\ /\/\
@lonelydev
lonelydev / main.yml
Created April 4, 2021 21:12
Hugo Deploy
name: Hugo deploy
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout blog repo with theme submodules
@lonelydev
lonelydev / settings.json
Last active December 31, 2020 15:36
Windows Terminal - Solarized Dark Theme
// The defaults section is where the solarized theme settings are done.
// originally found the source - https://thecustomizewindows.com/2020/08/windows-terminal-with-solarized-dark-oh-my-zsh-theme/
// This file was initially generated by Windows Terminal 1.0.1401.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
@lonelydev
lonelydev / keybindings.json
Created August 16, 2019 13:39
vscode keybindings.json
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "ctrl+oem_2",
"command": "workbench.action.terminal.focusNext"
},
{
"key": "ctrl+shift+oem_8",
"command": "workbench.action.terminal.new"
},