Skip to content

Instantly share code, notes, and snippets.

View epetousis's full-sized avatar

Evan Petousis epetousis

View GitHub Profile
@epetousis
epetousis / init.el
Last active October 17, 2022 03:39
Minimum code needed to get Volar working with eglot
(use-package eglot
:config (add-to-list 'eglot-server-programs
'(web-mode . (eglot-volar "vue-language-server" "--stdio"))))
(defclass eglot-volar (eglot-lsp-server) ()
:documentation "A custom class for Volar's langserver.")
;; Volar requires a path to a TypeScript SDK. It normally uses VSCode's preinstalled SDK.
;; tsdk is the correct variable as of https://github.com/johnsoncodehk/volar/pull/1916 being merged, but it may change at any time.
(cl-defmethod eglot-initialization-options ((server eglot-volar))
@epetousis
epetousis / chromium-shell-fhs.nix
Created October 12, 2022 03:34
A shell.nix derivation to create a FHS environment that can be used for Chromium development in NixOS
{ pkgs ? import <nixpkgs> {} }:
# Caveat: I haven't been able to get fonts to display in the final Chromium build, if you work out how to fix this please add.
(pkgs.buildFHSUserEnv {
name = "chromium-dev-env";
# These dependencies may include extraneous packages that aren't actually required for building Chromium.
targetPkgs = pkgs: (with pkgs; [
python3 git ripgrep
perl gcc bison flex gperf pkg-config
nss alsa-lib gtk3 nspr freetype ftgl cairo dbus dbus-glib libgnome-keyring
xorg.xorgserver xorg.xdpyinfo zlib wayland expat libxml2 glib libglibutil xorg.libX11 xorg.libXcomposite xorg.libXdamage xorg.libXext xorg.libXfixes xorg.libXrandr xorg.libXtst gnome.gdm mesa atk atkmm at-spi2-atk at-spi2-core libxkbcommon pango libdrm cups xorg.libxcb gdb udev noto-fonts dejavu_fonts fontconfig pixman pciutils egl-wayland xorg.libXau xorg.libXcursor xorg.libXdmcp xorg.libXi xorg.libXinerama xorg.libXrender libglvnd
@epetousis
epetousis / nomoreengagement.txt
Last active October 17, 2022 03:27
No More "Engagement" - a filter to block social media algorithmic recommendations - the "anti-endless scrolling." Pairs well with chronological timeline ordering.
! Title: No More "Engagement"
! Description: An annoyances filter that blocks sponsored social media posts, and suggestions for more content to view.
! Facebook Sponsors and "Suggested for You"
facebook.com##div[data-pagelet*="FeedUnit"]:has(span[class] + [role*="n"] > span > span + span)
facebook.com##div[data-pagelet*="FeedUnit"]:has(span[class]:first-child + [role*="n"] > span:only-child > span:first-child + span:last-child)
facebook.com##div[data-pagelet*="FeedUnit"]:has(div:not([class]):not([id]):empty ~ div:not([class]):not([id]) > div:not([class]):not([id]) > div:not([class]):not([id]):first-child:has(span[dir="auto"]:only-child) + div:not([class]):not([id]) + div:not([class]):not([id]) + div:not([class]):not([id]):last-child)
! Twitter "Topics to follow"
twitter.com##[data-testid="sidebarColumn"] [href="/i/topics/picker/home"]:upward(section)
twitter.com##[aria-label="Timeline: Your Home Timeline"]>div>div[style^="position: absolute;"],[aria-label$="’s Tweets"]>div>div[style^="position: absolute;"]:no

Keybase proof

I hereby claim:

  • I am epetousis on github.
  • I am eptvd (https://keybase.io/eptvd) on keybase.
  • I have a public key ASC3E9Yn1uoPK9btZvBxctBKMU9rCAt7lrNlJofOHvnFAQo

To claim this, I am signing this object:

@epetousis
epetousis / angle game.scpt
Created June 28, 2012 07:31
A game written in AppleScript where you have to choose the name of a random angle.
set score to 0
repeat 10 times
set angleno to random number from 1 to 360
set angleans to (choose from list {"Acute", "Right", "Obtuse", "Straight", "Reflex", "Revolution"} with prompt "My angle is " & angleno & "˚. What am I?") as string
if 1 ≤ angleno and angleno ≤ 89 then
if angleans is "Acute" then
set score to score + 1
display dialog "Correct! Your score is " & score & "." buttons {"OK", "Quit"} cancel button 2
else
display dialog "Incorrect! The correct name is an acute angle." buttons {"OK", "Quit"} cancel button 2
@epetousis
epetousis / compile.sh
Created December 29, 2011 12:31
Tools for loading a kernel panic image into the kernel of OSX
#Instead of building everything manually, you could use this script. Just open Terminal and write chmod 755, press the space bar and then drag this file in.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR"
echo "Compiling load_panic_image.c"
gcc load_panic_image.c -o load_panic_image
echo "Finished compiling load_panic_image.c"
echo "Compiling panic_test.c"
gcc panic_test.c -o panic_test
echo "Finished compiling panic_test.c"
echo "Done! Newly compiled commands can be found at $DIR"
@epetousis
epetousis / age.scpt
Created December 20, 2011 09:45
Calculate age by birth year with a simple algorithm. Very simple AppleScript.
set {year:y} to (current date)
display dialog "Enter your birth year." default answer ""
set birthdate to text returned of result
set age to y - birthdate
display dialog age
@epetousis
epetousis / passgen.scpt
Created November 22, 2011 05:20
A AppleScript to generate a password.
repeat
set passwrd to {}
display dialog "How many characters do you want this password to have? NOTE: Don't enter anything other than a number." default answer "64" buttons {"This amount"}
set char_amnt to text returned of result
repeat (char_amnt) times
set end of passwrd to some item of "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
end repeat
display dialog "Your password is:" default answer passwrd as string buttons {"Copy to clipboard and quit", "Another one"}
set the_button to button returned of result
if the_button is "Copy to clipboard and quit" then
@epetousis
epetousis / osxshowallfiles.sh
Created November 8, 2011 07:30
Show all files in OSX
defaults write com.apple.Finder AppleShowAllFiles YES