Skip to content

Instantly share code, notes, and snippets.

View bikemule's full-sized avatar

bikemule

  • Kraken Technologies
  • Brooklyn, NY
View GitHub Profile
@Gavinok
Gavinok / eglot-codelens.el
Created March 12, 2024 22:10
Add support for code lenses in eglot for emacs
;; eglot-codelens.el --- Add support for codelenses to eglot -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
;;; Extending eglot to support lenses
;;;; Findings
;; Lenses often support the option to be used as a code action
;; some servers rely on custom code actions implemented by the client
;; - [[https://github.com/emacs-lsp/lsp-mode/issues/2250]] mentions this
@sebastiancarlos
sebastiancarlos / minimal_dir.py
Last active August 8, 2024 04:17
Like dir(), but filters out __*__ attributes, standard library packages, and built-ins, to give a better idea of the object's custom attributes.
# explicitly define the interface
__all__ = ["minimal_dir"]
from functools import cache
@cache
def get_stdlib_packages():
""" Get list that should include all stdlib package/module names.
Not perfect. Has false positives.
@DarrenSem
DarrenSem / ytSubs.js
Last active September 15, 2024 16:41
ytSubs.js - YouTube subtitles - English (auto-generated) CC (closed captions) - Usage: node ytSubs.js videoIdOrUrl, or Web browser BOOKMARKLET into a new window
// ytSubs.js (SEE DISCLAIMER) - via @DarrenSem https://gist.github.com/DarrenSem (22Mar2024)
// YouTube subtitles - English (auto-generated) CC (closed captions)
// Usage: node ytSubs.js videoIdOrUrl
// or Web browser BOOKMARKLET (contents open in a new window)
// ES6 clickable Bookmarklet = 3923 chars:
//javascript:void function(){"use strict";var e=String.fromCharCode;const n=!1,d=globalThis,{process:i}=d,t=console,u=async(e,n,d="text")=>fetch(e,n).then(e=>e[d]()),a=e=>{try{e=(e||"")+"";const n=e.match(/"captionTracks":.*"isTranslatable"\:.*?}]/),d=JSON.parse(`{${(n||[""])[0]}}`).captionTracks||[],i=d.map(e=>{const n=e.name;return[l(n.simpleText||n.runs&&n.runs[0].text),e.baseUrl+"&fmt=json3"]});return i}catch(n){}},r=e=>{e=new Date(e);let n=e.getDate();return isNaN(n)?null:`${(n+"").padStart(2,"0")}${e.toLocaleString("default",{month:"short"})}${e.getFullYear()}`},f=e=>{e="string"!=typeof e&&e?new URL(e):{href:e||""};const n=e&&e.href.trim()||"",d=n.replace(/(https?:\/\/)?\/*(.+?)\/?$/,"https://$2"),i=d
@habamax
habamax / emacs-python-treesitter-eglot.org
Last active August 12, 2024 15:32
Setup Emacs for Python with Treesitter and Eglot

Emacs, Python, Treesitter and Eglot

Treesitter (“better”/faster syntax highlighting)

  1. Make sure you have Emacs with treesitter support:

    M-: (treesit-available-p) RET should return t

  2. Make sure you have installed python treesitter grammar
@MaximilianKohler
MaximilianKohler / How to send bulk-mass email.md
Last active September 11, 2024 12:15
How to send bulk/mass email with Amazon SES. 10,000-100,000 one-time emails, or thousands per day. Set up your own web server for newsletters. Mailchimp alternative

How to send bulk/mass email

The short answer is that you need to set up your own web server (Hetzner, AWS, DigitalOcean, etc.), install an email software on it (Listmonk, Mailwizz, Mautic), and use an SMTP like Amazon SES. It's not that hard. If you're on Windows, Putty and FileZilla will be your main programs to access your server. When using CSV files for your contacts, you want to use UTF-8 format.

There are some detailed guides below for Sendy and Listmonk. But even if you have/want to hire someone to set it up for you, they should be able to do so for under $60 (check Fiverr). So it's still the most affordable option.

When I searched for this I had a very hard time finding a right answer because all the results were SEO blogs advertising their newsletter services (Mailchimp, Convertkit, etc.), which is not the same thing.

My use case is that I have a Google form collecting tens of thousands of applications. And I need to re

@premek
premek / mv.sh
Last active March 5, 2024 17:43
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
#
# Also see:
# - imv from renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)
@tsuyoshicho
tsuyoshicho / starship.bash
Created April 1, 2020 13:59
starship bash code (starship init bash --full-code-print) sample - dump 20200401
# We use PROMPT_COMMAND and the DEBUG trap to generate timing information. We try
# to avoid clobbering what we can, and try to give the user ways around our
# clobbers, if it's unavoidable. For example, PROMPT_COMMAND is appended to,
# and the DEBUG trap is layered with other traps, if it exists.
# A bash quirk is that the DEBUG trap is fired every time a command runs, even
# if it's later on in the pipeline. If uncorrected, this could cause bad timing
# data for commands like `slow | slow | fast`, since the timer starts at the start
# of the "fast" command.
@GLMeece
GLMeece / Steps_to_Terminal_Enlightenment_on_a_Mac.md
Last active August 27, 2024 10:26
Steps to Terminal Enlightenment on a Mac (tweaking your terminal for fun and profit)
@sleepyfox
sleepyfox / 2019-07-25-users-hate-change.md
Last active September 13, 2024 08:39
'Users hate change'

'Users hate change'

This week NN Group released a video by Jakob Nielsen in which he attempts to help designers deal with the problem of customers being resistant to their new site/product redesign. The argument goes thusly:

  1. Humans naturally resist change
  2. Your change is for the better
  3. Customers should just get used to it and stop complaining

There's slightly more to it than that, he caveats his argument with requiring you to have of course followed their best practices on product design, and allows for a period of customers being able to elect to continue to use the old site, although he says this is obviously only a temporary solution as you don't want to support both.