Skip to content

Instantly share code, notes, and snippets.

@abo-abo
abo-abo / flycheck-ruff.el
Created February 20, 2023 21:01
Emacs ruff flycheck config
(require 'flycheck)
;; From https://github.com/flycheck/flycheck/issues/1974#issuecomment-1343495202
(flycheck-define-checker python-ruff
"A Python syntax and style checker using the ruff utility.
To override the path to the ruff executable, set
`flycheck-python-ruff-executable'.
See URL `http://pypi.python.org/pypi/ruff'."
:command ("ruff"
"--format=text"
@abo-abo
abo-abo / j.org
Created March 17, 2015 18:27
My J notes in org-mode

Basics

Precedence

There’s none: only evaluation from right to left. Although adverbs and conjunctions are applied first.

Global Variables

=: is like `setq’

gvar =. 23
fun1 =: 3 : 0
gvar + y
@abo-abo
abo-abo / qwerty.svg
Created February 27, 2015 18:00
qwerty.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abo-abo
abo-abo / default.py
Created December 29, 2014 12:42
my custom Pygments style: ./pygments-main/pygments/styles/default.py
# -*- coding: utf-8 -*-
"""
pygments.styles.default
~~~~~~~~~~~~~~~~~~~~~~~
The default highlighting style.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@abo-abo
abo-abo / word-toggle.el
Created December 23, 2014 17:54
Emacs word toggles
;;;###autoload
(defun capitalize-word-toggle ()
(interactive)
(let ((start (car
(save-excursion
(backward-word)
(bounds-of-thing-at-point 'symbol)))))
(if start
(save-excursion
(goto-char start)
@abo-abo
abo-abo / query.sql
Last active September 8, 2020 08:03
Use https://developers.google.com/bigquery/ to select top 100 repos by number of commits
select repository_name, count(repository_name) as pushes, repository_description, repository_url
from [githubarchive:github.timeline]
where type="PushEvent"
and repository_language="Emacs Lisp"
and parse_utc_usec(created_at) >= parse_utc_usec('2014-01-01 00:00:00')
group by repository_name, repository_description, repository_url
order by pushes desc
limit 100
@abo-abo
abo-abo / ido-helm.el
Created February 11, 2014 15:11
Emacs call helm from ido
(require 'helm-buffers)
(require 'delsel)
(add-hook
'ido-setup-hook
(lambda()
(define-key ido-buffer-completion-map "\C-i" 'ido-buffer-helm)))
(defun ido-buffer-helm ()
(interactive)
@abo-abo
abo-abo / calign.el
Created November 7, 2013 21:55
A small arguments alignment hack for C/C++-like languages.
(defun extract-argument-positions (str)
"Given a single line C/C++ string, return list of arguments in form:
\(start-position end-position string\) for each argument"
(let ((args (list))
(pos 0))
(while (string-match "\\(?: [^ (\n]+\\)\\(?:,[\n ]\\|)\\|,$\\|;$\\|[ ]+=[ ]+\\)" str pos)
(push (list (match-beginning 0)
(match-end 0)
(substring (match-string-no-properties 0 str) 0 -1))
args)
@abo-abo
abo-abo / org-agenda-quick-jump
Created July 20, 2013 11:35
org-mode agenda quick month/year selection with hjkl and 0-9.
(defvar lawlist-month)
(defvar lawlist-year nil)
(defun lawlist-org-agenda-view-mode-dispatch ()
"Select the month in agenda view."
(interactive)
(message "View: [1-9] [o]CT [n]OV [d]EC, j(next), k(prev).")
(let* ((a (read-char-exclusive))
(year (or lawlist-year
(setq lawlist-year
@abo-abo
abo-abo / hyper.org
Created July 19, 2013 16:12
elisp/clojure/python basic operations comparison.

hyperpolyglot

elispclojurepython
generationnumber-sequencerangerange
vectorvector⁅⁆
make-vector make-list make-string
length[[id:ced27672-063f-4205-8add