Skip to content

Instantly share code, notes, and snippets.

View p2d0's full-sized avatar
🎯
Focusing

Andron p2d0

🎯
Focusing
View GitHub Profile
@p2d0
p2d0 / flameshot_hyprland.fish
Last active May 25, 2025 06:12
Flameshot Hyprland save cursor position #fish
function flameshot_hyprland --description "Save cursor position when launching flameshot on Hyprland"
set mouse_pos (hyprctl cursorpos | string split -n ", ")
# Launch flameshot in background
flameshot gui &
# Wait until a client with class "flameshot" appears
while not hyprctl clients -j | jq -e '.[] | select(.class == "flameshot")' > /dev/null
sleep 0.05
end
@p2d0
p2d0 / !org-visibility-fix.el
Last active May 24, 2025 15:26
Org CHILDREN Visibility Fix for nested plain lists
(defun org-fold-show-children-fixed (&optional level)
"Show all direct subheadings of this heading.
Prefix arg LEVEL is how many levels below the current level should be
shown. If direct subheadings are deeper than LEVEL, they are still
displayed.
When `org-cycle-include-plain-lists' is 'integrate, this function
will also fold plain lists within the body of the current heading
and its direct children to show only their top-level items."
(interactive "p")
(unless (org-before-first-heading-p)
@p2d0
p2d0 / script.user.js
Last active November 19, 2023 14:22
Bing Prompt Autoinsert
// ==UserScript==
// @name Bing Prompt Autoinsert
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Insert prompt in Bing search textarea if it's empty
// @author p2d0
// @match https://www.bing.com/*
// @license GPLv3
// @grant none
// ==/UserScript==
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
@p2d0
p2d0 / cloudSettings
Last active October 3, 2018 13:33
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-09-12T12:22:46.020Z","extensionVersion":"v3.1.2"}