Skip to content

Instantly share code, notes, and snippets.

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

Dru Vagale fourthdimension

🏠
Working from home
View GitHub Profile
@fourthdimension
fourthdimension / config.fish
Last active May 1, 2024 02:00
Fish Config with Starship Theme
fish_add_path /opt/homebrew/bin
alias ls='exa -al --color=always --group-directories-first --icons' # preferred listing
alias la='exa -a --color=always --group-directories-first --icons' # all files and dirs
alias l='exa -ahl --color=always --group-directories-first --icons' # long format
alias ll='exa -ahl --color=always --group-directories-first --icons' # long format
alias lt='exa -aT --color=always --group-directories-first --icons' # tree listing
alias l.="exa -a | egrep '^\.'" # show only dotfiles
alias ..='cd ..'
@fourthdimension
fourthdimension / ghcs.fish
Created May 1, 2024 01:33
Fish Shell - Wrapper around `gh copilot suggest` to suggest a command based on a natural language description of the desired output effort.
function ghcs --description 'Wrapper around `gh copilot suggest` to suggest a command based on a natural language description of the desired output effort. Supports executing suggested commands if applicable.'
# Check if any arguments were provided
if not set -q argv[1]
echo "Please provide a description of the desired output."
return 1
end
# Combine all arguments into a single query string
set -l query (string join " " $argv)
@fourthdimension
fourthdimension / ghce.fish
Created May 1, 2024 01:25
Fish Shell - Wrapper around `gh copilot explain` to explain a given input command in natural language.
function ghce --description 'Wrapper around `gh copilot explain` to explain a given input command in natural language.'
set -l GH_DEBUG "$GH_DEBUG"
for arg in $argv
switch $arg
case '-d' '--debug'
set GH_DEBUG 'api'
case '-h' '--help'
echo "USAGE
ghce [flags] <command>
@fourthdimension
fourthdimension / gist:81cc9be1e3bf7c218cf9d5fc2c3e1f17
Last active April 14, 2020 23:26
Migrate from one GIT to another remote GIT Server
git clone --mirror OLD_GIT_URL
git remote add neworigin NEW_GIT_URL
git push neworigin --mirror
@fourthdimension
fourthdimension / gist:07db0aad969cf6b1e1f4b51676dfb3f2
Created November 16, 2018 03:24
Add edit link in ACF Relationship Field
add_filter('acf/fields/relationship/result', 'acf_append_edit_link_to_relationship_results', 10, 4);
function acf_append_edit_link_to_relationship_results($title, $post, $field, $post_id) {
$title = sprintf('[<a href="%s" target="_blank">%s</a>] ', get_edit_post_link($post_id), __('Edit')) . $title;
return $title;
}
<select>
<option value="AF">Afghanistan</option>
<option value="AX">Åland Islands</option>
<option value="AL">Albania</option>
<option value="DZ">Algeria</option>
<option value="AS">American Samoa</option>
<option value="AD">Andorra</option>
<option value="AO">Angola</option>
<option value="AI">Anguilla</option>
<option value="AQ">Antarctica</option>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Snap For Magic - Enter Us a Snap!</title>
<style type="text/css">
body, html
{
margin: 0; padding: 0; height: 100%; overflow: hidden;
}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Recipe",
"author": "Shellys",
"cookTime": "PT20M", **** 20M means 20minutes ****
"prepTime": "PT30M",
"recipeYield": "<#> servings", **** for http://www.shellys.co.in/recipe/khichuri/ - 2 servings ****
"datePublished": "2015-05-18", **** Date recipe page was modified ****
"description": "Your recipe description goes here", **** Recipe Description ****
wget --recursive --level=inf --page-requisites --convert-links robots=off --adjust-extension --span-hosts --domains=www.campbellsoup.ca,campbellsoup.ca,campbells-soup-362252ef.s3.amazonaws.com http://campbellsoup.ca
Reference links:
https://superuser.com/questions/129085/make-wget-download-page-resources-on-a-different-domain
https://stackoverflow.com/questions/4602153/how-do-i-use-wget-to-download-all-images-into-a-single-folder
<div id="unsupportedBrowserMsg" style="border:2px solid red;background-color:white;opacity:0.7;margin-bottom:20px;">
<h3 style="color:red;font-weight: bold;">*** IMPORTANT ***</h3>
<p style="color:red;">Your browser is not supported. You must use a newer browser which is 64bit or supports WebGL.</p>
<p><a href="https://interplay.zendesk.com/hc/en-us/articles/115009103987-Technical-Specs-and-Hardware-Requirements" style="color:red;text-decoration: underline;" target="_blank">Review Technical Specifications &amp; Hardware Specs</a></p>
<p style="color:red;">You may proceed at your own risk. Please note that Technical Support will not be available.</p>
</div>