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
| ;;;-*-EMACS-LISP-*- | |
| ;;; pip install howdoi | |
| (defun how-do-i (task count) | |
| (interactive "sTask: \np") | |
| (let ((language (replace-regexp-in-string "-mode" "" (symbol-name major-mode)))) | |
| (shell-command (format "howdoi -n %d %s %s" count language task) t))) | |
| (provide 'how-do-i) |
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
| Verifying that +leighklotz is my blockchain ID. https://onename.com/leighklotz |
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
| package main | |
| import "fmt" | |
| func main() { | |
| fmt.Printf("Named Result is %d\n", named_return_value()) | |
| fmt.Printf("Explicit Result is %d\n", explicit_return_value()) | |
| } | |
| func named_return_value() (balance int) { |
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
| #!/bin/bash | |
| function usage() { | |
| echo "usage:" | |
| name=`basename $0` | |
| echo "$name: print Host and Hostname aliases from ~/.ssh/config" | |
| echo "$name foo: grep for foo in above output" | |
| echo "$name -e|--exact foo: grep for '^foo ' in above output and print only hostname. example: ping \$(sshaliases --exact foo)" | |
| echo "$name -h|--help: this help" | |
| } |
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
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
| ;;; Leigh Klotz, 2023-04-08 | |
| ;;; | |
| ;;; This section is human-written, mostly :-) | |
| ;;; | |
| ;;; I created this file with GitHub Codex, mosly from the prompt | |
| ;;; of the first two comment lines. | |
| ;;; | |
| ;;; For Copilot Emacs Integration I followed | |
| ;;; https://robert.kra.hn/posts/2023-02-22-copilot-emacs-setup/#copilot-api--integration |
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
| ;;;-*-Mode; APL;-*- | |
| ⎕IO←0 | |
| ⎕←'Hello, world!' | |
| ⎕←'Hello, world!'⍝ comment | |
| ⍝ calculate fibonacci | |
| fib←{⍺⍺⍵⍵-1⍵⍵-2} | |
| fib 10 | |
| ⍝ 55 |
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
| #include "main.h" | |
| int main(int argc, char *argv[]) | |
| { | |
| printf("Hello World: %d", argc); | |
| for (int i = 0; i < argc; i++) | |
| { | |
| printf("%s", argv[i]); | |
| } | |
| return 0; |
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
| export PATH="/usr/local/cuda-11.7/bin:$PATH" | |
| export LD_LIBRARY_PATH="/usr/local/cuda-11.7/lib64:$LD_LIBRARY_PATH" | |
| # ldconfig | |
| klotz@tensor:~$ | |
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
| In Terraform, there is no built-in function to deeply merge two maps. However, you can achieve this by combining multiple functions and applying some custom logic. Here's an example of how you can deeply merge two maps in Terraform: | |
| ```hcl | |
| locals { | |
| map1 = { | |
| key1 = "value1" | |
| key2 = { | |
| nested_key1 = "nested_value1" | |
| } | |
| key3 = { |
OlderNewer