Skip to content

Instantly share code, notes, and snippets.

View kickingvegas's full-sized avatar

Charles Choi kickingvegas

View GitHub Profile
@kickingvegas
kickingvegas / DefaultKeyBinding.dict
Last active February 14, 2026 22:38
Sample DefaultKeyBinding.dict
/** ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
(defun eli/dired--move-to-next-line (arg jumpfun)
(let ((wrapped nil)
(old-arg arg)
(old-position (progn
;; It's always true that we should move
;; to the filename when possible.
(dired-move-to-filename)
(point)))
;; Up/Down indicates the direction.
(moving-down (if (cl-plusp arg)
@kickingvegas
kickingvegas / dired-double-click-config.el
Created October 7, 2024 19:03
Elisp Dired configuration to change single click to double to open a new file/directory
(add-hook
'dired-mode-hook
(lambda ()
(setq-local mouse-1-click-follows-link 'double)))
(keymap-set dired-mode-map "<mouse-2>" #'dired-mouse-find-file)
@kickingvegas
kickingvegas / cumulative-sum-table.org
Last active October 4, 2024 15:12
Org Table Cumulative Sum Example
abresult
122
238
3420
4540
5670
67112
78168
@kickingvegas
kickingvegas / melpa-package-status.py
Created May 23, 2024 20:01
Script to read MELPA package status
#!/usr/bin/env python3
#
# Copyright 2024 Yummy Melon Software
import os
import sys
import argparse
from subprocess import Popen, PIPE, call
import shutil
from datetime import datetime
@kickingvegas
kickingvegas / cc-org-table-to-sql.org
Last active June 7, 2024 02:21
Org Code Block cc/org-table-to-sqlite

cc/org-table-to-sqlite

Org Babel code block to import an Org table into an in-memory SQLite DB to enable SQL queries on aforementioned table.

Parameters

  • table : Org table object The Org table object is referenced via the #+NAME value assigned to the table. The table must have a header row identifying each column. This name value must be a SQL-legal name.
  • table-name : string Name of table in string form. It must be identical to the name of the table parameter above.
@kickingvegas
kickingvegas / cc-timestamp.el
Created November 30, 2022 19:50
Posix / Human Timestamp Elisp (quick and dirty)
(defun cc/posix-timestamp-to-human (start end)
(interactive "r")
(if (use-region-p)
(let ((regionp (buffer-substring start end)))
(set 'inputTime (time-convert (string-to-number regionp)))
(set 'inputBuf (number-to-string (string-to-number regionp)))
(set 'rfcBuf (format-time-string "%a, %e %b %Y %H:%M:%S %z" inputTime))
(set 'isoBuf (format-time-string "%Y-%m-%dT%H:%M:%S%z" inputTime))
(with-output-to-temp-buffer "*timestamps*"
(princ (concat "| POSIX | " inputBuf " |\n"))
(cl-defun chance (&key (win "You win.") &key (lose "You lose."))
(interactive)
(message (if (<= (* 100 (cl-random 1.0)) (read-number "Chance (%): ")) win lose))
)
@kickingvegas
kickingvegas / apollo11milestones.py
Created July 19, 2019 06:44
Apollo 11 in Real-TIme Mission Milestones in Local Time Python3 Script
#!/usr/bin/env python3
# Copyright 2019 Charles Choi
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@kickingvegas
kickingvegas / gist:5250677
Created March 27, 2013 00:54
pelican feed settings.
FEED_DOMAIN = u'http://yummymelon.com/devnull'
FEED_ATOM = u'feeds/main.xml'
FEED_ALL_ATOM = u'feeds/all.atom.xml'