An animated cheatsheet for smartparens using the example configuration specified here by the smartparens author. Inspired by this tutorial for paredit.
| C-M-f | sp-forward-sexp |
| C-M-b | sp-backward-sexp |
![]() | |
| { | |
| "compilerOptions": { | |
| // project options | |
| "lib": [ | |
| "ESNext", | |
| "dom" | |
| ], // specifies which default set of type definitions to use ("DOM", "ES6", etc) | |
| "outDir": "lib", // .js (as well as .d.ts, .js.map, etc.) files will be emitted into this directory., | |
| "removeComments": true, // Strips all comments from TypeScript files when converting into JavaScript- you rarely read compiled code so this saves space | |
| "target": "ES6", // Target environment. Most modern browsers support ES6, but you may want to set it to newer or older. (defaults to ES3) |
An animated cheatsheet for smartparens using the example configuration specified here by the smartparens author. Inspired by this tutorial for paredit.
| C-M-f | sp-forward-sexp |
| C-M-b | sp-backward-sexp |
![]() | |
| # To run: | |
| # osascript firefox-open-tab.applescript http://technosophos.com | |
| # | |
| # References: | |
| # https://support.mozilla.org/en-US/questions/1130718 | |
| # https://stackoverflow.com/questions/3645763/how-do-i-instruct-applescript-to-open-a-new-firefox-window-with-a-link | |
| on firefoxRunning() | |
| tell application "System Events" to (name of processes) contains "firefox" | |
| end firefoxRunning |
| (defun my-fancy-newline () | |
| "Add two newlines and put the cursor at the right indentation | |
| between them if a newline is attempted when the cursor is between | |
| two curly braces, otherwise do a regular newline and indent" | |
| (interactive) | |
| (if (and (equal (char-before) 123) ; { | |
| (equal (char-after) 125)) ; } | |
| (progn (newline-and-indent) | |
| (split-line) | |
| (indent-for-tab-command)) |
| import textwrap | |
| def refill_docstring(func, *args, **kwargs): | |
| """Fix the text wrapping in a function's docstring. | |
| This can be useful when creating doc strings dynamically. | |
| Additional args are options to textwrap.TextWrapper.""" | |
| wrapper = textwrap.TextWrapper(*args, **kwargs) | |
| # Remove trailing whitespace from all lines |