Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct
This file contains hidden or 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
| # pip3 install pymupdf | |
| import fitz # PyMuPDF | |
| import sys | |
| input_path = sys.argv[1] | |
| output_path = sys.argv[2] | |
| TARGET_RATIO = 1488 / 2266 # ≈ 0.6569 (portrait iPad Mini 7) |
This file contains hidden or 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
| "use strict"; | |
| function template(html) { | |
| return function parse(context) { | |
| const keys = Object.keys(context); | |
| const params = keys.map(k => context[k]); | |
| return new Function( | |
| ...keys, | |
| 'return (`' + html + '`)') | |
| (...params); |
This file contains hidden or 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
| $ xattr -d -r com.apple.quarantine <file_path> |
This file contains hidden or 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
| // register custom keycodes | |
| enum custom_keycodes { | |
| // ... | |
| MAC_TASK, | |
| // ... | |
| }; | |
| bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |
| // ... | |
| switch (keycode) { |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <style> | |
| * { | |
| touch-action: none; | |
| } | |
| canvas { | |
| width: 600px; | |
| height: 600px; |
This file contains hidden or 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
| <?php declare(strict_types=1); | |
| interface Spaceship | |
| { | |
| } | |
| interface Car | |
| { | |
| } |
This file contains hidden or 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
| // ==UserScript== | |
| // @name Add status highlights for assignments on Canvas | |
| // @version 0.1 | |
| // @include https://canvas.instructure.com/courses/*/assignments | |
| // @author edykim | |
| // @grant none | |
| // ==/UserScript== | |
| (function () { | |
| function install_status_marker(window, $) { | |
| "use strict"; |
This file contains hidden or 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/python | |
| import sys | |
| from PyPDF2 import PdfFileWriter, PdfFileReader | |
| filename = sys.argv[1] | |
| newFilename = filename.replace(".pdf", ".cropped.pdf") | |
| trimWidth = 65 | |
| trimHeight = 35 |
NewerOlder