a | b | result |
---|---|---|
1 | 2 | 2 |
2 | 3 | 8 |
3 | 4 | 20 |
4 | 5 | 40 |
5 | 6 | 70 |
6 | 7 | 112 |
7 | 8 | 168 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Org Babel code block to import an Org table into an in-memory SQLite DB to enable SQL queries on aforementioned table.
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 oftable
in string form. It must be identical to the name of thetable
parameter above.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(cl-defun chance (&key (win "You win.") &key (lose "You lose.")) | |
(interactive) | |
(message (if (<= (* 100 (cl-random 1.0)) (read-number "Chance (%): ")) win lose)) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FEED_DOMAIN = u'http://yummymelon.com/devnull' | |
FEED_ATOM = u'feeds/main.xml' | |
FEED_ALL_ATOM = u'feeds/all.atom.xml' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Copyright 2012 Yummy Melon Software LLC | |
# Author: Charles Y. Choi | |
# | |
import os | |
import sys | |
import getopt | |
import subprocess | |
import shutil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo '**' `date` >> $HOME/Documents/journal/journal.txt | |
emacs -nw +10000000 $HOME/Documents/journal/journal.txt | |
NewerOlder