#+TITLE: Álvaro Ramírez #+AUTHOR: Álvaro Ramírez #+OPTIONS: toc:nil num:nil ^:nil * [2024-04-05 Fri] Fresh Eyes now on the App Store :PROPERTIES: :CUSTOM_ID: fresh-eyes-now-on-the-app-store :END: A couple of days ago, [[https://xenodium.com/fresh-eyes-20-20-20-for-macos][I introduced Fresh Eyes]], a little macOS utility to help me practice the [[https://en.wikipedia.org/wiki/Computer_vision_syndrome][20-20-20 rule]] and take better care of my vision while on the computer. #+ATTR_HTML: :width 95% [[file:images/fresh-eyes-now-on-the-app-store/big-sur-eyes.gif]] Today, [[https://apps.apple.com/app/id6480411697][Fresh Eyes]] was approved and is now available on the macOS App Store. #+BEGIN_EXPORT html
Fresh eyes icon

download-on-app-store.png
#+END_EXPORT * [2024-04-03 Wed] Fresh Eyes: 20-20-20 for macOS :PROPERTIES: :CUSTOM_ID: fresh-eyes-20-20-20-for-macos :END: I've been lucky to have enjoyed healthy vision throughout my life. That is, until recently. Nothing major, I'll need glasses for some activities. I also learned from the optometrist I should follow the [[https://www.sbs.nhs.uk/information/home-working-looking-after-eyes][20-20-20 rule]] to reduce eye strain. The *20-20-20 rule* is simple: Take a break from looking at your computer screen every *20 minutes* and look away at something roughly *20 feet away* (6 metres) for *20 seconds*. While there are no shortages of macOS timer apps available, I figured it'd be fun to build a 20-20-20 one anyway. Meet *Fresh Eyes*. I've been using it in the last few days. If you'd like to give it a try, send me an email at me@xenodium.com and I'll reply with a TestFlight invite. #+ATTR_HTML: :width 90% [[file:images/fresh-eyes-20-20-20-for-macos/fresh-eyes.gif]] If looking for alternatives, [[https://samuelwflint.com/][Samuel W. Flint]] [[https://emacs.ch/@swflint/112197147526251145][offers a couple of great options]]: - On Emacs: [[https://github.com/alphapapa/hammy.el/tree/master][hammy.el]] by [[https://github.com/alphapapa][Adam Porter (alphapapa)]]. - On Linux/Windows (GTK-based): [[https://workrave.org/][Workrave]] by Raymond Penners & Rob Caeler. ** Update [[https://apps.apple.com/app/id1558358855][Fresh Eyes]] has now [[https://xenodium.com/fresh-eyes-now-on-the-app-store][been approved and is available on the macOS App Store]]. #+BEGIN_EXPORT html
Fresh eyes icon

download-on-app-store.png
#+END_EXPORT * [2024-03-25 Mon] Emacs 29.3 emergency release :PROPERTIES: :CUSTOM_ID: emacs-293-emergency-release :END: It was only last week when I upgraded to Emacs 29.2. Yup, I was late to the party. This week, we have a new release. Emacs 29.3 is an [[https://lists.gnu.org/archive/html/emacs-devel/2024-03/msg00611.html][emergency bugfix release]], so this time I've upgraded promptly. I'm on macOS using the great [[https://github.com/d12frosted/homebrew-emacs-plus][Emacs Plus]] so upgraded via [[https://brew.sh/][Homebrew]] using: #+begin_src sh brew reinstall emacs-plus@29 --with-imagemagick --with-no-frame-refocus --with-native-comp --with-savchenkovaleriy-big-sur-3d-icon --with-poll #+end_src #+ATTR_HTML: :width 60% [[file:images/emacs-293-emergency-release/29.3.png]] ps. Like this splash screen? Check out the [[https://xenodium.com/my-emacs-eye-candy/][Emacs eye candy post]]. * [2024-03-24 Sun] Emacs: Toggling the continuation indicator :PROPERTIES: :CUSTOM_ID: toggling-emacs-continuation-fringe-indicator :END: By default, Emacs typically displays curly arrows when wrapping lines. While likely a handy feature to some, I didn't really find much use for it. At the same time, I never looked into their removal until now. Turns out, there's a =continuation= entry in =fringe-indicator-alist= variable that handles this. Removing this entry also removes the curly arrows. #+begin_src emacs-lisp :lexical no (setq-default fringe-indicator-alist (delq (assq 'continuation fringe-indicator-alist) fringe-indicator-alist)) #+end_src Alternatively, one could write a simple function to toggle displaying the continuation indicator. #+ATTR_HTML: :width 70% [[file:images/toggling-emacs-continuation-fringe-indicator/curly.gif]] #+begin_src emacs-lisp :lexical no (defun toggle-continuation-fringe-indicator () (interactive) (setq-default fringe-indicator-alist (if (assq 'continuation fringe-indicator-alist) (delq (assq 'continuation fringe-indicator-alist) fringe-indicator-alist) (cons '(continuation right-curly-arrow left-curly-arrow) fringe-indicator-alist)))) #+end_src That's it for this post. A tiny tip. Perhaps there's a better way to handle it. If you know, I'd love to know too ([[https://indieweb.social/@xenodium][Mastodon]] / [[https://twitter.com/xenodium][Twitter]] / [[https://www.reddit.com/user/xenodium][Reddit]] / [[mailto:me__AT__xenodium.com][Email]]). * [2024-03-22 Fri] The Org bundle :PROPERTIES: :CUSTOM_ID: the-org-bundle :END: I have [[https://apps.apple.com/us/developer/xenodium-ltd/id304568690][three apps on the App Store]]: [[https://plainorg.com][Plain Org]], [[https://flathabits.com/][Flat Habits]], and [[https://apps.apple.com/us/app/scratch/id1671420139][scratch]]. ** Plain Org / [[https://plainorg.com][plainorg.com]] My more generic solution to access org files on the go and away from Emacs. #+ATTR_HTML: :width 60% [[file:images/the-org-bundle/plainorg-600x0w.png]] ** Flat Habits / [[https://flathabits.com/][flathabits.com]] My take on frictionless habit tracking truly respecting user privacy and their time (absolutely no distractions). #+ATTR_HTML: :width 60% [[file:images/the-org-bundle/flathabits-600x0w.png]] ** =*scratch*= / [[https://apps.apple.com/us/app/scratch/id1671420139][App Store]] Sure, we have tons of note-taking apps but most require more steps than desirable to write something down ASAP. Launch the app and you're good to write. No new note creation, bring keyboard up, etc. #+ATTR_HTML: :width 60% [[file:images/the-org-bundle/scratch-600x0w.webp]] ** Common denominator In addition to being offline-first, no cloud, no login, no ads, no tracking, no social... each app targets a specific purpose, sharing an important common denominator: they all use [[https://orgmode.org/][org markup]] as the underlying storage. ** The Org bundle / [[https://apps.apple.com/us/app-bundle/the-org-bundle/id1717663541][App Store]] While you can still get each of my apps individually, you now have the option to get them all as a single bundle: [[https://apps.apple.com/us/app-bundle/the-org-bundle/id1717663541][The Org bundle]]. #+ATTR_HTML: :width 40% [[file:images/the-org-bundle/bundle.png]] ** Journelly joining the bundle soon... Continuing on the org storage theme, I got another app in the works. Also joining [[https://apps.apple.com/us/app-bundle/the-org-bundle/id1717663541][The Org bundle]], maintaining its privacy-first approach: offline, no cloud, no login, no ads, no tracking, no social... this time in the journaling space. Journelly is currently [[https://xenodium.com/an-ios-journaling-app-powered-by-org-plain-text][in beta, want to join]]? #+ATTR_HTML: :width 60% [[file:images/the-org-bundle/journelly-demo.gif]] * [2024-03-19 Tue] sqlite-mode-extras on MELPA :PROPERTIES: :CUSTOM_ID: sqlite-mode-extras-on-melpa :END: #+ATTR_HTML: :width 75% [[file:images/sqlite-mode-goodies/sqlite-previous.gif]] Emacs 29 [[https://xenodium.com/emacs-29s-sqlite-mode][introduced the handy sqlite-mode]]. Soon after, I tried a couple of experiments [[https://xenodium.com/further-sqlite-mode-extensions/][here]] and [[https://xenodium.com/sqlite-mode-goodies][there]] to bring additional functionality. Folks reached out. The additions seemed useful to them and were keen on upstreaming or pushing to MELPA. While I can't commit to upstreaming at this moment, I can happily meet halfway on MELPA. As of a couple of days, you can find [[https://github.com/xenodium/sqlite-mode-extras][sqlite-mode-extras]] on [[https://melpa.org/#/sqlite-mode-extras][MELPA]] and [[https://github.com/xenodium/sqlite-mode-extras][GitHub]]. Contributions [[https://github.com/xenodium/sqlite-mode-extras/pulls?q=is%3Apr][totally welcome]]. While I haven't heard of issues, please continue treating the package as experimental and exercise safety with your data. Please back up. * [2024-03-19 Tue] Som tam salad dressing recipe (improvised) :PROPERTIES: :CUSTOM_ID: som-tam-salad-dressing-recipe-improvised :END: Lately, I've been slightly obsessed with [[https://cooking.nytimes.com/recipes/1012589-som-tum-green-papaya-salad][Som Tam]], a magnificent salad packing both crunch and flavour. I didn't have all the right ingredients for the full-blown salad at home, so I set out to experiment with the dressing's punchy flavours. While I've gone a little rogue here, I mean no disrespect to the faithful recipe and all its glory. Luckily, I did have fish sauce at home, which I considered the core ingredient, and made do with everything else I could find. This is where I landed: - 2 cloves of garlic - Thai chillies to taste (improvised with chilli flakes) - 2 tablespoons of fish sauce - 1 tablespoons of palm sugar (improvised with honey) - 2 limes squeezed (improvised with lemon) - 1 tablespoon of dried shrimp (didn't have any) - 1 small plum tomato (I used 2 of those bite-size ones) Using my trusty mortar and pestle, I ground and crushed the garlic, chilli flakes, and tomato, forming a paste of sorts. Then added the remaining liquids (fish sauce, honey and lemon) diluting the paste. - 2 tablespoons of roasted peanuts (roasted some cashews) Most recipes seem to suggest using peanuts, though my local Thai restaurant uses cashews. Luckily I had cashews at home, so I'm copied my local. Roasted them on pan for a few minutes. As you can imagine, I didn't just have a green papaya laying around at home, so I experimented with other crunchy veggies. While I won't reveal what the other veggies were (oh man, I've gone way off script), both my other half and I were happy with the results. Som Tam dressing packs an awesome punch. If your salads were feeling a little boring, give this a try! * [2024-03-14 Thu] My first bread (pane dei Castelli recipe) :PROPERTIES: :CUSTOM_ID: my-first-bread-pane-dei-castelli-recipe :END: #+ATTR_HTML: :width 100% [[file:images/my-first-bread-pane-dei-castelli-recipe/my-bread.jpg]] I followed [[https://www.emmafontanella.com/the-easiest-no-knead-bread][The easiest no knead bread recipe]] ([[https://www.youtube.com/watch?v=3xtj9X1jDc0][video]]). ** No-knead method *** Dough - 1 1/4 cups (300g) lukewarm water - 2 teaspoons (8g) salt - 1 teaspoon (3.5g) yeast - 3 cups (420g) all purpose flour Mix thoroughly (I like to use Ciro's spoon mixing method from [[https://www.bbc.com/travel/article/20200415-how-to-make-pizza-like-a-neapolitan-master][this video]]), cover and rest for 6 hours. Stretch and fold if the dough collapsed on itself to rescue. *** Bake - Preheat oven (and dutch oven) at 230°C. - Flour. I didn't have a dutch oven, but my oven-proof saucepans (with lid) did just fine. Carefully take the pan out of the oven, sprinkle the bottom with some flour, and place the dough inside. Cover with lid (careful, also hot) and bake for 30-35 minutes. *** Crust - Reduce heat to 200°C. Remove the lid and bake for another 10 minutes or until you get the crust darkness of your choice. *** Rest Let the bread cool on a cooling rack for 45 mins before cutting. If no rack available, set upsidedown. ** Stretch and fold method *** Dough - 1 1/4 cups (300g) lukewarm water - 2 1/2 teaspoons (10g) salt - 2 teaspoon (7g) yeast - 3 cups (420g) all purpose flour Mix thoroughly (I like to use Ciro's spoon mixing method from [[https://www.bbc.com/travel/article/20200415-how-to-make-pizza-like-a-neapolitan-master][this video]]), cover and rest for 6 hours. Stretch and fold if the dough collapsed on itself to rescue. *** Stretch and fold See [[https://www.emmafontanella.com/the-easiest-no-knead-bread][Emma Fontanella]]'s stretch and fold technique and apply 4-5 times every 30 mins. *** Follow no-knead method Remaining steps are the same as the no-knead method. * [2024-03-11 Mon] Seafood stew recipe :PROPERTIES: :CUSTOM_ID: seafood-stew-recipe :END: I've made this seafood stew a handful of times and it's always delivered. #+ATTR_HTML: :width 100% [[file:images/seafood-stew-recipe/IMG_7030.jpg]] ** Garlic almond paste - 1/8 cup of olive oil. - 8 cloves of garlic chopped. - 1/4 cup almond meal (flour). Cook garlic in low-medium heat until softened. Add almond meal and cook 3-4 mins or until golden. Set aside to cool. - 1 large handful of parsley. Blend the almond mixture to make a paste. Set aside. ** Spices - 1 large onion halved and sliced. In a large pan, cook onion until softened. - 1/8 cup of olive oil. - 1 large red chilli finely chopped (on occasions, I use chilli flakes). - 1 teaspoon of smoked paprika. - 2 bay leaves. Add chilli, paprika, and bay leaves and cook for 30 seconds (or fragrant). ** Liquids - 1/3 cup dry white wine (I've used cooking sake on occasion). - 1000g of passata (typically comes in 500g packs). - 400g plum tomatoes tin (undrained). - 1 teaspoon of saffron threads (soaked in 2 tablespoons of water). - 1 tablespoon of tomato paste. - 2 cups of fish stock (I've used 2 stock cubes + same amount of water). Add the wine, passata, plum tomatoes, saffron, tomato pate, and fish stock. Simmer for 10 minutes. ** Fish - 700g of firm white fish (cut into 5 cm chunks). - 12 mussels. Add the almond paste, fish, and mussels. Cook for 3-4 minutes. - 12 prawns (shelled). Add the prawns. Cook for 3 minutes (or pink). ** Finishing touches Season with salt and pepper to taste. I've added roughly a teaspoon of salt. Garnish generously with parsley and you're good to go. * [2024-01-13 Sat] A Cloudflare Workers primer: hello world :PROPERTIES: :CUSTOM_ID: a-cloudflare-workers-primer-hello-world :END: #+begin_example o______________o | Hello world! | o--------------o \ ^__^ \ (oo)_______ (__)\ )\/\ ||----w | || || #+end_example Keen to get started with your /Hello World/ Cloudflare Worker? Skip to the [[id:cloudflare-worker-hello-world-setup][setup]] section. ** A little background The vast majority of my software development experience has been centered around client-side software. The few times I've needed a server-side component for a hobby project, I've historically provisioned a linux [[https://en.wikipedia.org/wiki/Virtual_machine][virtual machine]] somewhere and ran whatever services I needed. I have to admit though, I don't enjoy the provisioning process, configuration, maintenance, upgrades, database admin, etc. which take time away from the part I enjoy more: building and experimenting with features. While [[https://en.wikipedia.org/wiki/Containerization_(computing)][containers]] have made things somewhat simpler, much of the maintenance tradeoffs remain. These days, the server-managing overhead has been greatly reduced by "[[https://en.wikipedia.org/wiki/Serverless_computing][serverless]]" solutions. Odd terminology for a server offering, but I digress. It more or less refers to removing most of that additional responsibility that comes with managing your own servers and enabling you to focus on building your business logic. Having said that, I've typically shied away from these services, with the possibly irrational fear of vendor lock-in. The thing is, if most of my potential server-side needs merely require an entry point (where I could route/handle incoming requests) and possibly some persistence (maybe a database), I should be able to abstract these things away and build server-side logic against portable abstractions. With that in place, maybe there's little vendor lock-in to worry about? Who knows, the devil's in the detail. If I keep shying away from these services, I'll never know, so maybe I should try some and see. ** Let's try Cloudflare Workers There are no shortages of serverless options offering [[https://en.wikipedia.org/wiki/Function_as_a_service][functions as a service]]. Google Cloud, AWS Lambda, Azure Functions, Vercel Functions, Netlify Functions, Fastly, Cloudflare workers, I could go on... While I haven't researched the different offerings, I had made a mental note to check out Cloudflare Workers as they had [[https://blog.cloudflare.com/introducing-d1][announced D1]], their database backed by SQLite ...and who doesn't love SQLite? ;) OK, I'm no expert here, but I have had a pleasant experience whenever I've used it. These days, even [[https://xenodium.com/emacs-29s-sqlite-mode/][Emacs 29 got some SQLite love]], which prompted me to add [[https://xenodium.com/sqlite-mode-goodies/][cell navigation/navigation]] and [[https://xenodium.com/further-sqlite-mode-extensions/][try other experiments]]. ** D1 / SQLite in beta Keep in mind that D1 is in public beta and not yet recommended for large production workloads. From the [[https://developers.cloudflare.com/d1/][Cloudflare site]]: #+begin_quote "While the D1 team expects breaking changes and issues to be minimal, they may still occur. The D1 team generally does not recommend running large production workloads on beta products." #+end_quote ** Workers cost In terms of pricing (as of 2024-01-13), the [[https://developers.cloudflare.com/workers/platform/pricing][free tier]] enables workers to handle up 100,000 requests per day. Plenty for trying things out. In any case, we're only checking out Cloudflare's offering, so let's move on... ** Settings up a new Cloudflare Worker (via web dash) :PROPERTIES: :ID: cloudflare-worker-hello-world-setup :END: Cloudflare has a tiny snippet on their [[https://workers.cloudflare.com/][Workers landing page]] that sets things up rather quickly, but _I won't be using it_. #+begin_src sh ~/ $ npm create cloudflare -- my-app ~/ $ cd my-app ~/ $ npx wrangler deploy Published https://my-app.world.workers.dev #+end_src ⚠️ /Note: before you get copying and pasting, read on./ Cloudflare's snippet is helpful, but it does quite a bit under the hood. I'm somewhat of a node and serverless noob, so I wanted to understand things a little more and figure out the bare minimum needed to start a minimal Cloudflare Worker project. Instead, we'll first click here and there over at https://dash.cloudflare.com to spin off our new worker from the web and later continue from the command line. #+ATTR_HTML: :width 100% [[file:images/a-cloudflare-workers-primer-hello-world/cf-new-0.png]] #+ATTR_HTML: :width 100% [[file:images/a-cloudflare-workers-primer-hello-world/cf-new-1.png]] Give the worker a name. We'll call it "todos" to give ya a little sneak peak at what the next post is possibly about... But you can call it whatever you'd like. Keep in mind you'll need to use this name to refer to your new worker. #+ATTR_HTML: :width 100% [[file:images/a-cloudflare-workers-primer-hello-world/cf-new-2.png]] Congrats, you've now deployed a new worker. You can access it via the URL that looks something like https://todos.somewhere.workers.dev #+ATTR_HTML: :width 70% [[file:images/a-cloudflare-workers-primer-hello-world/hello-dark.png]] This is great and all, but we want to build something with this new worker, so let's set up our local development environment... ** Prerequisites You'll need [[https://nodejs.org/][node.js]] installed on your machine. I happen to be on macOS, so I installed node via [[https://brew.sh/][Homebrew]]. #+begin_src sh brew install node #+end_src ** Create a new node project We want to start with a bare bones node project, so let's do just that. #+begin_src sh mkdir HelloCloudflareWorker cd HelloCloudflareWorker npm init -y #+end_src ** Install TypeScript (compiler) I like some guardrails when targetting Javascript, so I'll use the [[https://www.typescriptlang.org][TypeScript]] compiler in this project. Let's install it. #+begin_src sh npm install --save-dev typescript npx tsc --init #+end_src ** Install Cloudflare Typescript types To have Cloudflare types information accessible to the TypeScript compiler, we'll need to install that too. #+begin_src sh npm install --save-dev @cloudflare/workers-types #+end_src ** Install Wrangler (Cloudflare tooling) To manage your worker from the command-line, you'll need Cloudflare's [[https://developers.cloudflare.com/workers/wrangler/][wrangler]] tool. Let's install it. #+begin_src sh npm install --save-dev wrangler #+end_src ** Point Wrangler to our worker We're done installing things now. Let's point wrangler to our new worker by creating its config file. =wrangler.toml= #+begin_src sh name = "todos" main = "worker/worker.ts" #+end_src ** Worker entry point By default, the worker we created using Cloudflare's dash has the following entry point: #+begin_src js export default { async fetch(request, env, ctx) { return new Response( 'Hello World!'): } } #+end_src However, this isn't yet included in our development environment. We need to write our first bit of code. You may have noticed our =wrangler.toml= is pointing to the main entry point (=worker/worker.ts=) and this file doesn't exist yet. Let's create it, though be sure to also create its owning directory: #+begin_src sh mkdir worker #+end_src Now we can create our very own =worker/worker.ts=. Let's make the first change that shapes worker to our liking. Rather than just printing "Hello World", let's style things up using our [[https://en.wikipedia.org/wiki/Cowsay][cow friend]]. We'll create =worker/worker.ts= and include the spiffed up message. =worker/worker.ts= #+begin_src js import { Env, ExecutionContext } from '@cloudflare/workers-types'; export default { async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise { let defaultResponse = ` o______________o | Hello World! | o--------------o \\ ^__^ \\ (oo)\_______ (__)\\ )\\/\\ ||----w | || ||` return new Response(defaultResponse); } }; #+end_src It's worth mentioning the import statement, since it brings Cloudflare's type information for both =Env= and =ExecutionContext=. ** Running worker locally Okay, we now have our =worker/worker.ts= code ready to go. Let's run it locally. For that we use the wrangler utility. #+begin_src sh npx wrangler dev #+end_src #+ATTR_HTML: :width 90% [[file:images/a-cloudflare-workers-primer-hello-world/dev.png]] With that, you'll notice the worker is now running locally and waiting to be visited at http://localhost:8787. #+ATTR_HTML: :width 70% [[file:images/a-cloudflare-workers-primer-hello-world/moo.png]] ** Deploying worker When we first created the worker via https://dash.cloudflare.com, it automatically deployed to https://todos.somewhere.workers.dev. But our mods only ran locally. Let's deploy, again with the wrangler utility. #+begin_src sh npx wrangler deploy #+end_src #+ATTR_HTML: :width 70% [[file:images/a-cloudflare-workers-primer-hello-world/deploying.png]] We're good to go. Let's point our browser to the worker's public location. #+ATTR_HTML: :width 70% [[file:images/a-cloudflare-workers-primer-hello-world/deployed.png]] ...and with that, we have a functional Cloudflare Worker and a local development environment to shape things up however we'd like. What would you use the Worker for? Gave this primer a try? I'd love to hear from ya ([[https://indieweb.social/@xenodium][Mastodon]] / [[https://twitter.com/xenodium][Twitter]] / [[https://www.reddit.com/user/xenodium][Reddit]] / [[mailto:me__AT__xenodium.com][Email]]). /Enjoying this content? Find it useful?/ /Consider ✨[[https://github.com/sponsors/xenodium][sponsoring me]]✨ or buy ✨[[https://apps.apple.com/us/developer/xenodium-ltd/id304568690][my iOS apps]]✨./ * [2024-01-01 Mon] A chatgpt-shell compose ux experiment :PROPERTIES: :CUSTOM_ID: a-chatgpt-shell-compose-ux-experiment :END: It's been roughly 9 months since I [[https://xenodium.com/a-chatgpt-emacs-shell/][experimented]] with wiring the [[https://openai.com/blog/chatgpt][ChatGPT]] API to an Emacs [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Shell-Prompts.html][comint]] buffer in [[https://github.com/xenodium/chatgpt-shell][chatgpt-shell]]. ChatGPT's request-response nature maps fairly well to a shell's mode of interaction. In the past, I've also talked about [[https://xenodium.com/yasnippet-in-emacs-eshell/][blurring the lines between shell and editor]]. That is, using Emacs as your shell ([[https://www.masteringemacs.org/article/complete-guide-mastering-eshell][eshell]] being my favourite) enables compounding goodies from both shell and editor when both are used from the same app. Keeping interactions within the same app also cuts down on some of that friction that comes with context switching between your text editor and the browser for [[https://en.wikipedia.org/wiki/Large_language_model][llm]] things. Today, my interactions with llms typically consists of copying and pasting details from other Emacs buffers, crafting a query, and finally submitting by pressing enter (RET) from a shell like [[https://github.com/xenodium/chatgpt-shell][chatgpt-shell]]. #+ATTR_HTML: :width 90% [[file:images/a-chatgpt-shell-compose-ux-experiment/shell-find-bug.gif]] With the entire interaction happening from Emacs, we're already cutting a fair amount of friction... But we can do better, specially when copying, pasting, and crafting those multi-line queries (you don't want to prematurely submit those shell queries by inadvertently pressing RET when you want a newline). ** chatgpt-shell-prompt-compose This is where =chatgpt-shell-prompt-compose= comes in, an opinionated experiment bringing some of my favourite "compose" features over from the likes of [[https://github.com/magit][magit]] commit buffers, [[https://www.gnu.org/software/emacs/manual/html_node/org/Using-capture.html][org capture]], [[https://www.djcbsoftware.nl/code/mu/mu4e/][mu4e]] compose, and so on... You can bring a compose buffer up by invoking =M-x chatgpt-shell-prompt-compose=. From there, you can both craft and send your queries. If you're a magit fan, the process should feel fairly familiar with crafting a git commit message by editing away and quickly committing (via =C-c C-c= binding). Similarly, you can also abort with the familiar =C-c C-k= binding. #+ATTR_HTML: :width 90% [[file:images/a-chatgpt-shell-compose-ux-experiment/10k.gif]] I use this compose utility often enough that I bound it to =C-c C-e=, though this may not be your cup of tea (needs overriding other mode maps). #+begin_src emacs-lisp (use-package chatgpt-shell :commands (chatgpt-shell chatgpt-shell-prompt-compose) :bind (("C-c C-e" . chatgpt-shell-prompt-compose) :map org-mode-map ("C-c C-e" . chatgpt-shell-prompt-compose) :map eshell-mode-map ("C-c C-e" . chatgpt-shell-prompt-compose) :map mu4e-compose-mode-map ("C-c C-e" . chatgpt-shell-prompt-compose) :map emacs-lisp-mode-map ("C-c C-e" . chatgpt-shell-prompt-compose))) #+end_src While the compose buffer displays a single query/response at a time, it also follows on from previous requests. You can press =r= to reply and continue the conversation. #+ATTR_HTML: :width 90% [[file:images/a-chatgpt-shell-compose-ux-experiment/marathon.gif]] The compose buffer is fairly stateless and mostly serves as viewport over the last query in the shell itself. If you invoke =chatgpt-shell-prompt-compose= with a prefix (ie. C-u), it wipes the shell history. You can do it from the compose buffer itself, if you forgot to prior to launching. You can also use the =o= binding to jump to the "other buffer" (the shell carrying the conversation history). #+ATTR_HTML: :width 90% [[file:images/a-chatgpt-shell-compose-ux-experiment/other.gif]] If using the =r= and =o= bindings in a compose buffer sounds a little strange, fear not. The compose buffer is writeable while crafting queries, thus you can safely insert any character. Once a query is submitted (via =C-c C-c=), the buffer automatically becomes read-only, and thus unlocking single-character bindings. Another magit commit favorite of mine is using the =M-p= or =M-n= bindings to insert previous messages via =git-commit-prev-message= or =git-commit-next-message=. With that in mind, I also brought =M-p= and =M-n= over to the editable compose buffer. #+ATTR_HTML: :width 90% [[file:images/a-chatgpt-shell-compose-ux-experiment/previous-next-history.gif]] If cycling isn't efficient enough, you can also use the typical =M-r= binding to search and insert from history. #+ATTR_HTML: :width 90% [[file:images/a-chatgpt-shell-compose-ux-experiment/search-history.png]] Now, getting back to removing some of that copy-pasting friction... Selecting text in any buffer and invoking =M-x chatgpt-shell-prompt-compose= (or =C-c C-e= in my case) automatically pastes the region into the compose buffer. You get to tweak your query before submitting (via that familiar =C-c C-c=), in a more flexible buffer (compared to a shell). /Note: You can also invoke the compose command with a region as many times as you'd like. Each region is sent to the compose buffer, so you can craft more involved queries before submission./ #+ATTR_HTML: :width 90% [[file:images/a-chatgpt-shell-compose-ux-experiment/find-and-fix-bug.gif]] While I typically prefer short query responses (using diffs like the example above), I sometimes want full snippets as follow-ups. I found myself typing /"show entire snippet"/ often enough, that I now use one of those single-character bindings (=e=) for this purpose. #+ATTR_HTML: :width 90% [[file:images/a-chatgpt-shell-compose-ux-experiment/show-entire-snippet.gif]] ** Compose bindings I've showcased most of the compose key bindings, here's the whole lot (so far anyway), which you can also view from =chatgpt-shell-prompt-compose='s documentation. *** Editing - =C-c C-c= to send the buffer query. - =C-c C-k= to cancel compose buffer. - =M-r= search through history. - =M-p= cycle through previous item in history. - =M-n= cycle through next item in history. *** Read-only - =C-c C-c= After sending offers to abort query in-progress. - =q= Exits the read-only buffer. - =g= Refresh (re-send the query). Useful to retry on disconnects. - =n= Jump to next source block. - =p= Jump to next previous block. - =r= Reply to follow-up with additional questions. - =e= Send "Show entire snippet" query. - =o= Jump to other buffer (ie. the shell itself). - =C-M-h= Mark block at point. ** Buyer beware: it's all pretty experimental When I started playing with the compose buffer idea, I wasn't too sure whether or not its usage would stick, so I basically hacked =chatgpt-shell-prompt-compose= to pieces. A cheap prototype of sorts to validate the idea before fully committing to a more involved solution. I'll eventually rewrite =chatgpt-shell-prompt-compose= as either a major or minor mode if there's enough interest. For now, I'll continue using as is to validate its usefulness. If you give =chatgpt-shell-prompt-compose= a try, I'd love to hear your feedback ([[https://indieweb.social/@xenodium][Mastodon]] / [[https://twitter.com/xenodium][Twitter]] / [[https://www.reddit.com/user/xenodium][Reddit]] / [[mailto:me__AT__xenodium.com][Email]]). /Enjoying this content? Find it useful? Consider [[https://github.com/sponsors/xenodium][sponsoring]]./ * [2023-12-22 Fri] A Murder at the End of the World: Are you Vi or Emacs? :PROPERTIES: :CUSTOM_ID: are-you-vi-or-emacs :END: I've enjoyed watching [[https://www.imdb.com/title/tt15227418/][A Murder at the End of the World]]. The show may resonate with folks following the tech world. Won't say much more than that... What I can maybe say is, the shows features [[https://www.reddit.com/r/emacs/][Reddit]], [[https://brave.com/][Brave browser]], terminal usage (ifconfig, nmap, hydra, responder), and a reference to the good 'ol [[https://en.wikipedia.org/wiki/Editor_war][Vi vs Emacs rivalry]], which I hope folks these days don't take further than friendly teasing between dear cousins. In any case, being an Emacs nut, the scene gave me a good tickle. It's a great show, with a lovely Emacs cherry on top! While the show title and description didn't immediately draw me in, I'm glad I gave it a chance. #+ATTR_HTML: :width 100% [[file:images/are-you-vi-or-emacs/vi-or-emacs.webp]] #+ATTR_HTML: :width 100% [[file:images/are-you-vi-or-emacs/what-is-emacs.webp]] * [2023-12-17 Sun] An basic Mullvad WireGuard setup for macOS :PROPERTIES: :CUSTOM_ID: a-quick-mullvad-macos-setup :END: Needed a VPN to test an API from a different location. Gave [[https://mullvad.net/en][Mullvad]] a try. Pretty neat, you can generate an account number without providing an email address. You can also pre-pay with a ton of options, including cash, crypto, credit cards, PayPal, wire transfers... After seeing your account credited, one can download a [[https://mullvad.net/en/account/wireguard-config][generated WireGuard configuration]]. Also a WireGuard noob, so took this opportunity to give it a try. The [[https://apps.apple.com/us/app/wireguard/id1451685025?mt=12][WireGuard macOS app]] has an "Import Tunnel(s) from File..." option where you can import the .conf file downloaded from [[https://mullvad.net/en/account/wireguard-config][Mullvad's generated config]]. After that, all I had to do was click the "Activate" button and [[https://en.wikipedia.org/wiki/Bob%27s_your_uncle][Bob's your uncle]]. #+ATTR_HTML: :width 95% [[file:images/a-quick-mullvad-macos-setup/wg-redact.png]] You can test your connection via: #+begin_src bash curl https://am.i.mullvad.net/connected #+end_src #+RESULTS: : You are connected to Mullvad (server xxxxxx). Your IP address is xxx.xxx.xxx.xxx I had a brief stint at using the command-line alternative via homebrew =brew install wireguard-go wireguard-tools=, but that seems to fail silently: #+begin_src sh wg-quick up xxxxx [#] wireguard-go utun [+] Interface for xxxxx is utun7 [#] wg setconf utun7 /dev/fd/63 [#] ifconfig utun7 inet xxx.xxx.xxx.xxx/xx xxx.xxx.xxx.xxx alias [#] ifconfig utun7 inet6 xxxx:xxxx:xxxx:xxxx::x:xxxx/xxx alias [#] ifconfig utun7 up [#] route -q -n add -inet6 ::/1 -interface utun7 [#] route -q -n add -inet6 8000::/1 -interface utun7 [#] route -q -n add -inet xxx.xxx.xxx.xxx/x -interface utun7 [#] route -q -n add -inet xxx.xxx.xxx.xxx/x -interface utun7 [#] route -q -n add -inet xxx.xxx.xxx.xxx -gateway xxx.xxx.xxx.xxx [#] networksetup -getdnsservers Wi-Fi [#] networksetup -getsearchdomains Wi-Fi [#] networksetup -getdnsservers iPhone USB [#] networksetup -getsearchdomains iPhone USB [#] networksetup -getdnsservers Thunderbolt Bridge [#] networksetup -getsearchdomains Thunderbolt Bridge [#] networksetup -getdnsservers xxxxx [#] networksetup -getsearchdomains xxxxx [#] networksetup -setdnsservers iPhone USB xxx.xxx.xxx.xxx [#] networksetup -setsearchdomains iPhone USB Empty [#] networksetup -setdnsservers xxxxx xxx.xxx.xxx.xxx [#] networksetup -setsearchdomains xxxxx Empty [#] networksetup -setdnsservers Wi-Fi xxx.xxx.xxx.xxx [#] networksetup -setsearchdomains Wi-Fi Empty [#] networksetup -setdnsservers Thunderbolt Bridge xxx.xxx.xxx.xxx [#] networksetup -setsearchdomains Thunderbolt Bridge Empty [+] Backgrounding route monitor #+end_src #+begin_src bash curl https://am.i.mullvad.net/connected #+end_src #+RESULTS: : You are not connected to Mullvad. Your IP address is xxx.xxx.xxx.xxx I'm on a Macbook M1 Pro, running macOS Sonoma. If you got =wg-quick= working on Sonoma, I'd love to hear from ya ([[https://indieweb.social/@xenodium][Mastodon]] / [[https://twitter.com/xenodium][Twitter]] / [[https://www.reddit.com/user/xenodium][Reddit]] / [[mailto:me__AT__xenodium.com][Email]]). * [2023-12-06 Wed] An iOS journaling app powered by org plain text :PROPERTIES: :CUSTOM_ID: an-ios-journaling-app-powered-by-org-plain-text :END: I've been experimenting with building a rich text editing component for iOS, powered by [[https://orgmode.org/][org]] markup. The idea is to offer a mobile-friendly editing experience, backed by our beloved plain text format. #+ATTR_HTML: :width 60% [[file:images/an-ios-journaling-app-powered-by-org-plain-text/rich-text-experiment.gif]] To make things a little more interesting, I'm introducing a new org-based app to help anyone with regular journaling. #+BEGIN_EXPORT html
👉 Meet ✨Journelly✨
#+END_EXPORT #+ATTR_HTML: :width 60% [[file:images/an-ios-journaling-app-powered-by-org-plain-text/journelly.jpg]] Plain text /is/ the serialization format. No conversion/import/export needed. #+ATTR_HTML: :width 60% [[file:images/an-ios-journaling-app-powered-by-org-plain-text/journelly.gif]] Though it's early days, it's fairly functional. Been using it daily for some time. You can opt in to use an external org file and sync with your beloved Emacs. Want to give it a try? Want a TestFlight invite? Send me an email address (any would do) at either of these: [[https://indieweb.social/@xenodium][Mastodon]] / [[https://twitter.com/xenodium][Twitter]] / [[https://www.reddit.com/user/xenodium][Reddit]] / [[mailto:me__AT__xenodium.com][Email]]. The topic of org being fairly Emacs-oriented, though a strength for someone far down the rabbit hole, it is [[https://indieweb.social/@ringtailringo@mastodon.social/111533733278287863][understandable to call it out for someone in a different position]]. Lucky for us, org markup is plain text and can be implemented by apps other than Emacs, like Journelly itself for iOS and even more experimentally on macOS: #+ATTR_HTML: :width 100% [[file:images/an-ios-journaling-app-powered-by-org-plain-text/macos.png]] And like Journelly for iOS, I got other org things available on iOS: #+BEGIN_EXPORT html
As an Org mode fan, so I wrote Plain Org for iOS. It's on the App Store.
Inspired by Atomic Habits, I wrote Flat Habits for iOS. Also on the App Store.
I needed an Emacs-inspired scratch buffer on iOS (who doesn't?), so I built one.
#+END_EXPORT - As an [[https://orgmode.org/][Org mode]] fan, so I wrote [[https://plainorg.com/][Plain Org]] for iOS. It's on the [[https://apps.apple.com/app/id1578965002][App Store]]. - Inspired by [[https://jamesclear.com/atomic-habits][Atomic Habits]], I wrote [[https://flathabits.com/][Flat Habits]] for iOS. Also on the [[https://apps.apple.com/app/id1558358855][App Store]]. - I needed an Emacs-inspired [[https://xenodium.com/scratch-a-minimal-scratch-area][*scratch*]] buffer on iOS (who doesn't?), so I [[https://xenodium.com/scratch-a-minimal-scratch-area/][built one]]. Just like the stuff I do or [[https://xenodium.com][write about]]? [[https://github.com/sponsors/xenodium][Sponsor me]]. * [2023-11-29 Wed] Building your own bookmark launcher :PROPERTIES: :CUSTOM_ID: building-your-own-bookmark-launcher :END: #+ATTR_HTML: :style text-align:right; /✨[[https://github.com/sponsors/xenodium][sponsor]]✨ this content/ I've been toying with the idea of managing browser bookmarks from [[https://www.gnu.org/software/emacs/][you know where]]. Maybe dump a bunch of links into an org file and use that as a quick and dirty bookmark manager. We'll start with a flat list plus fuzzy searching and see how far that gets us. The org file would look a little something like this: #+CAPTION: bookmarks.org #+begin_src org My bookmarks - [[https://lobste.rs/t/emacs][Emacs editor (Lobsters)]] - [[https://emacs.stackexchange.com][Emacs Stack Exchange]] - [[https://www.reddit.com/r/emacs][Emacs subreddit]] - [[https://emacs.ch][Emacs.ch (Mastodon)]] - [[https://www.emacswiki.org][EmacsWiki]] - [[https://planet.emacslife.com/][Planet Emacslife]] #+end_src Next we need fuzzy searching, but first let's write a little elisp to extract all links from the org file: #+begin_src emacs-lisp :lexical no (require 'org-element) (require 'seq) (defun browser-bookmarks (org-file) "Return all links from ORG-FILE." (with-temp-buffer (let (links) (insert-file-contents org-file) (org-mode) (org-element-map (org-element-parse-buffer) 'link (lambda (link) (let* ((raw-link (org-element-property :raw-link link)) (content (org-element-contents link)) (title (substring-no-properties (or (seq-first content) raw-link)))) (push (concat title "\n" (propertize raw-link 'face 'whitespace-space) "\n") links))) nil nil 'link) (seq-sort 'string-greaterp links)))) #+end_src The snippet uses =org-element= to iterate over links to collect/return them in a list. We join both the title and url, so searching can match either of these values. We also add a little formatting (new lines/face) to spiff things up. #+begin_src emacs-lisp :results value code (browser-bookmarks "/private/tmp/bookmarks.org") #+end_src #+RESULTS: #+begin_src emacs-lisp (#("Planet Emacslife\nhttps://planet.emacslife.com/\n" 17 46 (face whitespace-space)) #("EmacsWiki\nhttps://www.emacswiki.org\n" 10 35 (face whitespace-space)) #("Emacs.ch (Mastodon)\nhttps://emacs.ch\n" 20 36 (face whitespace-space)) #("Emacs (Stack Exchange)\nhttps://emacs.stackexchange.com\n" 23 54 (face whitespace-space)) #("Emacs (Reddit)\nhttps://www.reddit.com/r/emacs\n" 15 45 (face whitespace-space)) #("Emacs (Lobsters)\nhttps://lobste.rs/t/emacs\n" 17 42 (face whitespace-space))) #+end_src We can now feed our list to our preferred narrowing framework (ivy, helm, ido, vertico) and use it to quickly select a bookmark. In the past, I've [[https://xenodium.com/emacs-utilities-for-your-os/][used the likes of ivy-read]] directly, though have since adopted the humble but mighty =completing-read= which hooks up to any of the above frameworks. With that in mind, let's use =completing-read= to make a selection and split the text to extract the corresponding URL. Feed it to =browse-url=, and you got your preferred browser opening your bookmark. #+begin_src emacs-lisp :lexical no (defun open-bookmark () (interactive) (browse-url (seq-elt (split-string (completing-read "Open: " (browser-bookmarks "/private/tmp/bookmarks.org")) "\n") 1))) #+end_src I remain a happy ivy user, so we can see its fuzzy searching in action. #+ATTR_HTML: :width 100% [[file:images/building-your-own-bookmark-launcher/emacs-bookmark.gif]] At this point, we now have our bookmark-launching Emacs utility. It's only an =M-x open-bookmark= command away, but we want to make it accessible from anywhere in our operating system, in my case macOS. Let's enable launching from the command line, though before we do that, let's craft a dedicated frame for this purpose. #+begin_src emacs-lisp :lexical no (defmacro present (&rest body) "Create a buffer with BUFFER-NAME and eval BODY in a basic frame." (declare (indent 1) (debug t)) `(let* ((buffer (get-buffer-create (generate-new-buffer-name "*present*"))) (frame (make-frame '((auto-raise . t) (font . "Menlo 15") (top . 200) (height . 20) (width . 110) (internal-border-width . 20) (left . 0.33) (left-fringe . 0) (line-spacing . 3) (menu-bar-lines . 0) (minibuffer . only) (right-fringe . 0) (tool-bar-lines . 0) (undecorated . t) (unsplittable . t) (vertical-scroll-bars . nil))))) (set-face-attribute 'ivy-current-match frame :background "#2a2a2a" :foreground 'unspecified) (select-frame frame) (select-frame-set-input-focus frame) (with-current-buffer buffer (condition-case nil (unwind-protect ,@body (delete-frame frame) (kill-buffer buffer)) (quit (delete-frame frame) (kill-buffer buffer)))))) #+end_src Most of the snippet styles our new frame and invokes the body parameter. While I don't typically resort to macros, we get a little syntatic sugar here, so we can invoke like so: #+begin_src emacs-lisp :lexical no (defun present-open-bookmark-frame () (present (browse-url (seq-elt (split-string (completing-read "Open: " (browser-bookmarks "/private/tmp/bookmarks.org")) "\n") 1)))) #+end_src Wrapping our one-liner with the =present-open-bookmark-frame= function enables us to easily invoke from the command line, with something like #+begin_src sh emacsclient -ne "(present-open-bookmark-frame)" #+end_src #+ATTR_HTML: :width 100% [[file:images/building-your-own-bookmark-launcher/command.gif]] Now that we can easily invoke from the command line, we have the flexibility to summon from anywhere. We can even bind to a key shortcut, available anywhere (not just Emacs). I typically do this via [[http://www.hammerspoon.org/][Hammerspoon]], with some helpers, though there are likely simpler options out there. #+begin_src lua function emacsExecute(activate, elisp) if activate then activateFirstOf({ { bundleID="org.gnu.Emacs", name="Emacs" } }) end local socket, found = emacsSocketPath() if not found then hs.alert.show("Could not get emacs socket path") return "", false end local output,success = hs.execute("/opt/homebrew/bin/emacsclient -ne \""..elisp.."\" -s "..socket) if not success then hs.alert.show("Emacs did not execute: "..elisp) return "", false end return output, success end function openBookmark() appRequestingEmacs = hs.application.frontmostApplication() emacsExecute(false, "(present-open-bookmark-frame)") activateFirstOf({ { bundleID="org.gnu.Emacs", name="Emacs" } }) end hs.hotkey.bind({"alt"}, "W", openBookmark) #+end_src With that, we have our Emacs-powered bookmark launcher, available from anywhere. #+ATTR_HTML: :width 100% [[file:images/building-your-own-bookmark-launcher/launcher.gif]] While we used our Emacs frame presenter to summon our universal bookmark launcher, we can likely the same mechanism for other purposes. Maybe a clipboard (kill ring) manager? #+ATTR_HTML: :width 100% [[file:images/building-your-own-bookmark-launcher/kill-ring.png]] What would you use it for? Get in touch ([[https://indieweb.social/@xenodium][Mastodon]] / [[https://twitter.com/xenodium][Twitter]] / [[https://www.reddit.com/user/xenodium][Reddit]] / [[mailto:me__AT__xenodium.com][Email]]). /Enjoying this content? Find it useful? Consider ✨[[https://github.com/sponsors/xenodium][sponsoring]]✨./ * [2023-11-25 Sat] Native Emacs/macOS UX integrations via Swift modules :PROPERTIES: :CUSTOM_ID: native-emacsmacos-ux-integrations-via-swift-modules :END: Once you learn a little [[https://en.wikipedia.org/wiki/Emacs_Lisp][elisp]], [[https://www.gnu.org/software/emacs/][Emacs]] becomes this hyper malleable editor/platform. A live playground of sorts, where almost everything is up for grabs at runtime. Throw some elisp at it, and you can customize or extend almost anything to your heart's content. I say almost, as there's a comparatively small native core, that would typically require recompiling if you wanted to make further (native) mods. But that isn't entirely true. [[https://www.masteringemacs.org/article/whats-new-in-emacs-25-1][Emacs 25]] enabled us to further extend things by loading native [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Dynamic-Modules.html][dynamic modules]], back in 2016. Most of my Emacs-bending adventures have been powered by elisp, primarily on macOS. I also happen to have an iOS dev background, so when [[https://github.com/SavchenkoValeriy][Valeriy Savchenko]] [[https://www.reddit.com/r/emacs/comments/wemj1z/writing_emacs_dynamic_modules_in_swift/][announced]] his project bringing [[https://github.com/SavchenkoValeriy/emacs-swift-module][Emacs dynamic modules powered by Swift]], I added it to my never-ending list of things to try out. Fast-forward to a year later, and [[https://github.com/roife][Roife]]'s [[https://www.reddit.com/r/emacs/comments/17vrmrk/emt_emacs_macos_tokenizer_for_enhanced_cjk_word/][introduction]] to [[https://github.com/roife/emt][emt]] finally gave me that much-needed nudge to give [[https://github.com/SavchenkoValeriy/emacs-swift-module][emacs-swift-module]] a try. While I wish I had done it earlier, I also wish [[https://github.com/SavchenkoValeriy/emacs-swift-module][emacs-swift-module]] had gotten more visibility. Native extensions written in Swift can open up some some neat integrations using native macOS UX/APIs. While I'm new to Savchenko's [[https://github.com/SavchenkoValeriy/emacs-swift-module][emacs-swift-module]], the project has [[https://savchenkovaleriy.github.io/emacs-swift-module/documentation/emacsswiftmodule/][wonderful documentation]]. It quickly got me on my way to build an experimental dynamic module introducing a native context menu for sharing files from my beloved editor. #+ATTR_HTML: :width 90% [[file:images/native-emacsmacos-ux-integrations-via-swift-modules/emacs-share.webp]] Most of the elisp/native bridging magic happens with fairly little Swift code: #+begin_src swift try env.defun( "macos-module--share", with: """ Share files in ARG1. ARG1 must be a vector (not a list) of file paths. """ ) { (env: Environment, files: [String]) in let urls = files.map { URL(fileURLWithPath: $0) } let picker = NSSharingServicePicker(items: urls) guard let view = NSApp.mainWindow?.contentView else { return } let x = try env.funcall("macos--emacs-point-x") as Int let y = try env.funcall("macos--emacs-point-y") as Int let rect = NSRect( x: x + 15, y: Int(view.bounds.height) - y + 15, width: 1, height: 1 ) picker.show(relativeTo: rect, of: view, preferredEdge: .maxY) } #+end_src This produced an elisp =macos-module--share= function I could easily access from elisp like so: #+begin_src emacs-lisp :lexical no (defun macos-share () "Share file(s) with other macOS apps. If visiting a buffer with associated file, share it. While in `dired', any selected files, share those. If region is active, share files in region. Otherwise share file at point." (interactive) (macos-module--share (vconcat (macos--files-dwim)))) #+end_src On a side note, =(macos--files-dwim)= chooses files depending on context. That is, [[https://xenodium.com/emacs-dwim-do-what-i-mean/][do what I mean (DWIM) style]]. If there's a file associated with current buffer, share it. When in [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][dired]] (the directory editor, aka file manager), look at region, selected files, or default to file at point. #+begin_src emacs-lisp :lexical no (defun macos--files-dwim () "Return buffer file (if available) or marked/region files for a `dired' buffer." (if (buffer-file-name) (list (buffer-file-name)) (or (macos--dired-paths-in-region) (dired-get-marked-files)))) (defun macos--dired-paths-in-region () "If `dired' buffer, return region files. nil otherwise." (when (and (equal major-mode 'dired-mode) (use-region-p)) (let ((start (region-beginning)) (end (region-end)) (paths)) (save-excursion (save-restriction (goto-char start) (while (< (point) end) ;; Skip non-file lines. (while (and (< (point) end) (dired-between-files)) (forward-line 1)) (when (dired-get-filename nil t) (setq paths (append paths (list (dired-get-filename nil t))))) (forward-line 1)))) paths))) #+end_src I got one more example of a native macOS integration I added. Being an even simpler one, and in hindsight, I prolly should have introduced it first. In any case, this one reveals [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][dired]] files in macOS's Finder app (including the selection itself). #+ATTR_HTML: :width 100% [[file:images/native-emacsmacos-ux-integrations-via-swift-modules/reveal.webp]] #+begin_src swift try env.defun( "macos-module--reveal-in-finder", with: """ Reveal (and select) files in ARG1 in macOS Finder. ARG1 mus be a vector (not a list) of file paths. """ ) { (env: Environment, files: [String]) in NSWorkspace.shared.activateFileViewerSelecting(files.map { URL(fileURLWithPath: $0) }) } #+end_src The corresponding elisp is nearly identical to its =macos-share= sibling: #+begin_src emacs-lisp :lexical no (defun macos-reveal-in-finder () "Reveal file(s) in macOS Finder. If visiting a buffer with associated file, reveal it. While in `dired', any selected files, reveal those. If region is active, reveal files in region. Otherwise reveal file at point." (interactive) (macos-module--reveal-in-finder (vconcat (macos--files-dwim)))) #+end_src My Swift module experiment introduces two native macOS UX integrations, now available via =M-x macos-share= and =M-x macos-reveal-in-finder=. I've pushed all code to it's own [[https://github.com/xenodium/EmacsMacOSModule][repo]]. I hope this post brings visibility to the wonderful [[https://github.com/SavchenkoValeriy/emacs-swift-module][emacs-swift-module]] project and sparks new, native, and innovative integrations for those on macOS. Can't wait to see what others can do with it. /Enjoying this content? Find it useful? Consider ✨[[https://github.com/sponsors/xenodium][sponsoring]]✨./ * [2023-11-16 Thu] Migrating/re-encrypting pass's password store :PROPERTIES: :CUSTOM_ID: migratingre-encrypting-passs-password-store :END: Note to self, I needed to migrate/re-encrypt someone's password store (aka pass). Straightforward: Get the new key, probably already in gpg key chain. Try listing it: #+begin_src sh gpg --list-keys #+end_src To re-encrypt, =pass init= with new key is enough. It'll prompt for old pass key. #+begin_src sh cd path/to/.password-store pass init NEW-GPG-KEY #+end_src * [2023-10-30 Mon] How I smash burgers :PROPERTIES: :CUSTOM_ID: how-i-smash-burgers :END: I'm neither a burger expert nor a connoisseur of any kind, yet I sure have a lot of fun smashing burgers at home. Needless to say, I shamelessly enjoy gobbling them too! #+CAPTION: my smash burger #+ATTR_HTML: :width 60% [[file:images/how-i-smash-burgers/burger-cut.png]] I'll share details on how I smash my burgers, but here's a quick ingredient list, if that's all you need. - Mince beef (20%-30% fat). - Streaky bacon. - Brioche burger buns. - American cheese slices (cheddar individual slices work too). - Lettuce. - Tomatoes. - Onions. - Pickles. - Jalapeños. - Garlic. - Chipotle powder. - Mayonnaise. - Salt. - Pepper. - Oil. - Greaseproof paper. - Butter. ** The calling My quest to smash burgers at home didn't start until earlier this year, while watching the [[https://www.imdb.com/title/tt9764362/][The Menu]]. I just could't stop [[https://indieweb.social/@xenodium/109734285674122246][craving the burger]] from that scene, so I set out to start smashing my own. #+ATTR_HTML: :width 98% [[file:images/how-i-smash-burgers/the-menu.webp]] ** The gear Don't rush to buy anything fancy. Your existing gear will likely do the job just fine. I'd say try a few things out and only upgrade when needed. I'll share the gear I use and where I felt I needed tweaking. ** Skillet While I didn't have a griddle at home, I did have a couple of trusty [[https://www.lodgecastiron.com/][Lodge]] *skillets* ([[https://www.lodgecastiron.com/product/round-cast-iron-classic-skillet?sku=L8SK3][cast iron]] and [[https://www.lodgecastiron.com/product/carbon-steel-skillet?sku=CRS12][carbon steel]]). Both work great for burgers, though I have a slight preference for the carbon steel one, as it's the bigger of the two and gives a little more room for manoeuvring, specially when smashing two burgers at a time. #+ATTR_HTML: :width 250px [[file:images/how-i-smash-burgers/cast-iron.png]] #+ATTR_HTML: :width 250px [[file:images/how-i-smash-burgers/carbon.png]] Heat the skillet up and add a little oil. If the oil starts smoking, be quick to drop the patties and start smashing. ** Grill Spatula (too big/stiff for skillet) Somewhat inspired by the film, I got myself a wide spatula so I could firmly press those patties against the skillet, and to flip of course. While this kind of spatula may work well on a spacious griddle, I felt constrained on a relatively small cast iron. Specially when flipping. I went looking for an alternative. #+ATTR_HTML: :width 250px [[file:images/how-i-smash-burgers/spatula.png]] ** Spatula + smasher (my winning combo) Over at the [[https://reddit.com/r/castiron/][r/castiron]] subreddit, I discovered fish spatulas. They are fairly agile on cast irons but also work great for loosening burger patties before flipping. [[file:images/how-i-smash-burgers/ready.webp]] While effective for flipping, fish spatulas are obviously no good for smashing. So I got myself a burger smasher. This combo worked well for me. [[file:images/how-i-smash-burgers/smash.webp]] When smashing, use greaseproof paper to prevent the patties from sticking to the smasher. ** Ingredients While I've drawn inspiration from others, I've landed on my own preferred ingredients. I'm sure that will continue changing over time. Pick and choose as your heart desires. ** Minced/ground beef Minced beef with higher fat content (around 20-30%) is often recommended for a couple of reasons: - Flavour: Fat equals flavour in cooking. The higher fat content will melt during cooking and become 'self-basting', resulting in a juicier and more flavourful burger. - Texture: The fat in the beef melts under heat, helping the burger achieve a crispy, caramelized exterior known as the [[https://en.wikipedia.org/wiki/Maillard_reaction][Maillard reaction]], which contrasts nicely against the soft, juicy interior. In the UK, I can typically find minced beef with 15%-20% fat content at the main supermarkets. #+ATTR_HTML: :width 200px [[file:images/how-i-smash-burgers/pattie.png]] Be sure to salt and pepper to taste (as in picture) on one side. Once flipped on pan, salt and pepper the other side. ** Bacon I tend to prefer smoked streaky bacon, but hey these will be your burgers. Your burgers, your rules. #+ATTR_HTML: :width 250px [[file:images/how-i-smash-burgers/streaky.png]] ** Buns (brioche) I hear potato buns are great for burgers. I've yet to try them. So far, I've settled for brioche. I happen to find these near me, so I've gone with them. #+ATTR_HTML: :width 350px [[file:images/how-i-smash-burgers/brioche.png]] Butter the buns and brown on the skillet for a minute. Check the buns often. Brioche buns can burn quickly. ** American cheese American cheese is often the burger cheese of choice. #+ATTR_HTML: :width 98% [[file:images/how-i-smash-burgers/american-cheese.webp]] While American cheese isn't widely available in the UK, the individually wrapped orange-looking cheddar cheese slices work just fine. #+ATTR_HTML: :width 250px [[file:images/how-i-smash-burgers/cheese.png]] ** Toppings I like my burgers with lettuce, tomatoes, onions, pickles, and occasionally jalapeños. For pickles, I typically just take cornichons and slice them up. #+ATTR_HTML: :width 350px [[file:images/how-i-smash-burgers/toppings_x0.30.png]] ** Burger sauce (chipotle/garlic/mayo) While classic burger sauce is often made with mayo, ketchup, pickles, and mustard, I've gone fairly rogue here. You see, I love chipotle mayo. I'm also a fan of garlic mayo, so I figured why not both? Turns out these three ingredients work great together. I like to draw out the flavours by first mixing the garlic and chipotle with a little hot water. - 1 garlic clove. - 2 teaspoons of chipotle powder. - 1 tablespoon of hot water. - Pinch of salt. #+ATTR_HTML: :width 210px [[file:images/how-i-smash-burgers/sauce1.png]] #+ATTR_HTML: :width 210px [[file:images/how-i-smash-burgers/sauce2.png]] #+ATTR_HTML: :width 210px [[file:images/how-i-smash-burgers/sauce3.png]] ...and then thicken with mayo. - 1/4 cup of mayo. #+ATTR_HTML: :width 210px [[file:images/how-i-smash-burgers/sauce4.png]] #+ATTR_HTML: :width 210px [[file:images/how-i-smash-burgers/sauce5.png]] These are very rough measurements, tweak to your preference. Make more garlicky, spicier, or soften things by adding garlic, chipotle, or mayo. ** Assembling I like to assemble in the following order from the bottom bun up. 1. Sauce on bottom bun. 2. Lettuce. 3. Tomatoes. 4. Onions. 5. 2 patties (melted cheese on both). 6. Bacon. 7. Pickles. 8. Jalapeños. 9. Sauce on top bun (oops, I forgot in the picture). #+ATTR_HTML: :width 60% [[file:images/how-i-smash-burgers/open.png]] ...and here's the final product. #+ATTR_HTML: :width 60% [[file:images/how-i-smash-burgers/burger-cut.png]] If you gave smashing burgers a go, I'd love to hear about it. Also any tips are very much welcome. Get in touch ([[https://indieweb.social/@xenodium][Mastodon]] / [[https://twitter.com/xenodium][Twitter]] / [[https://www.reddit.com/user/xenodium][Reddit]] / [[mailto:me__AT__xenodium.com][Email]]). * [2023-10-24 Tue] Open in Xcode at line number :PROPERTIES: :CUSTOM_ID: open-in-xcode-at-line-number :END: I live mostly in Emacs. I say mostly 'cause well, I'm fairly pragmatic about it. If there's a workflow elsewhere that's more appropriate for my needs, I'll happily use that instead. While I'd love to do my web browsing from my beloved editor, Firefox ticks the right boxes for me. I do most of my iOS coding in Emacs. It's a hybrid of sorts between Emacs and Xcode. If I need to use the debugger, Xcode is a clear winner for me. If I happen to be visiting a Swift file in an Emacs buffer, I typically used the handy =crux-open-with= from [[https://github.com/bbatsov/crux][crux]] to open in Xcode, and continue from there. This worked OK, but I always wished opening in Xcode would also jump to the same line number as the Emacs point (cursor) location. This is particularly useful if I had just spotted where I'd like to set a breakpoint in an Emacs buffer and need to transition over to Xcode. It turns out, there's a nifty command line utility for that. [[https://www.unix.com/man-page/osx/1/xed/][xed]], the Xcode text editor invocation tool. It enables telling Xcode what file to open and at what line number: #+begin_src sh xed -line 141 path/to/some/file.swift #+end_src With that in mind, I've added my own version of =crux-open-with=, using [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]]. When running on macOS, the function checks whether or not I'm visiting a buffer for a programming language, and opens the file in Xcode at the same line number. #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-open-externally () "Open file(s) externally." (interactive) (dwim-shell-command-on-marked-files "Open externally" (if (eq system-type 'darwin) (if (derived-mode-p 'prog-mode) (format "xed --line %d '<>'" (line-number-at-pos (point))) "open '<>'") "xdg-open '<>'") :shell-args '("-x" "-c") :silent-success t :utils (if (eq system-type 'darwin) "open" "xdg-open"))) #+end_src #+ATTR_HTML: :width 80% [[file:images/open-in-xcode-at-line-number/xed_x0.8_x2.webp]] =dwim-shell-commands-open-externally= is now [[https://github.com/xenodium/dwim-shell-command/commit/19be1c2f3792c95f04fd369cb931a52f7df9cfd5][added to dwim-shell-commands.el]]. ps. If you find opening the same file in a different context handy, you may also like the package [[https://github.com/rmuslimov/browse-at-remote][browse-at-remote]] that opens the visited file at its corresponding remote location (for example, GitHub). I can never remember the name of the function ([[https://github.com/rmuslimov/browse-at-remote][browse-at-remote]]), so I aliased it to something I'd remember and moved on... #+begin_src emacs-lisp :lexical no (defalias 'ar/open-at-github #'browse-at-remote)) #+end_src * [2023-10-06 Fri] Trimming video screenshots :PROPERTIES: :CUSTOM_ID: trimming-video-screenshots :END: A quick one... I recently wanted to trim the black borders around a video screenshot. While I could use an image editor to manually select and trim, I wondered if there was an [[https://imagemagick.org/][imagemagick]] trick somewhere out there for such a thing... and of course there was: #+begin_src sh magick convert -fuzz 3% -define trim:percent-background=0% -trim +repage path/to/input.png path/to/output.png #+end_src Pretty neat. It does the job, but I won't remember it next time. May as well make another [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] function out of it and conveniently invoke from Emacs via a memorable name plus fuzzy search. #+ATTR_HTML: :width 80% [[file:images/trimming-video-screenshots/trim.gif]] #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-image-trim-borders () "Trim image(s) border (useful for video screenshots)." (interactive) (dwim-shell-command-on-marked-files "Trim image border" "magick convert -fuzz 3% -define trim:percent-background=0% -trim +repage '<>' '<>_trimmed.<>'" :utils "magick")) #+end_src While the screenshot I've just used was a little blurry, it's from the movie [[https://www.imdb.com/title/tt1104001/][Tron Legacy]], and it features Emacs eshell. This is old news, though [[https://irreal.org/blog/?p=9573][well covered]]. #+ATTR_HTML: :width 95% [[file:images/trimming-video-screenshots/eshell_trimmed.png]] =dwim-shell-commands-image-trim-borders= is now [[https://github.com/xenodium/dwim-shell-command/commit/5bed2f6b40761db4913c8d8f58bb147c71a9ceb7][added to dwim-shell-commands.el]] * [2023-10-06 Fri] Displaying image details in mode line :PROPERTIES: :CUSTOM_ID: displaying-image-details-in-mode-line :END: A benefit of running Emacs as a GUI app, is that you can view images from your beloved editor. This is super handy to take a quick peek at any image. Sometimes, I'd like a little more than just viewing the image. I'd like to see basic image details like type, dimensions, and file size. The [[https://imagemagick.org/][imagemagick]] =identify= utility is pretty handy for that. #+begin_src bash identify -format "%m %wx%h %b" path/to/image.png #+end_src #+RESULTS: : PNG 2387x1055 2.28454MB I could easily invoke =shell-command= for this or even create a [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] function (maybe I will), but if this info was proactively displayed in the mode line, I wouldn't have to fetch it myself. Since I know I can use the =identify= command for this, I may as well see if I can plug it into the mode line. Turns out this wasn't too bad by setting =setting mode-line-format=. I added a little logic to only include image details while in =image-mode= and rely on =process-lines= to fetch the details. This function returns a list, which is a happy coincidence since =mode-line-format= also expects a list. #+begin_src emacs-lisp :lexical no (setq-default mode-line-format '(" " mode-line-front-space mode-line-client mode-line-frame-identification mode-line-buffer-identification (:eval (when (eq major-mode 'image-mode) ;; Needs imagemagick installed. (process-lines "identify" "-format" "[%m %wx%h %b]" (buffer-file-name)))) " " mode-line-position (vc-mode vc-mode) (multiple-cursors-mode mc/mode-line) " " mode-line-modes mode-line-end-spaces)) #+end_src #+ATTR_HTML: :width 70% [[file:images/displaying-image-details-in-mode-line/buddies.png]] I'd love to hear if there's a pure elisp alternative ([[https://indieweb.social/@xenodium][mastodon]]/[[https://twitter.com/xenodium][twitter]]). I gave =(image-size (image-get-display-property) :pixels)= a try, but that seemed to return the display size in buffer rather than actual file size. * [2023-10-06 Fri] Creating an iCloud account (via tart VM) :PROPERTIES: :CUSTOM_ID: creating-icloud-test-accounts :END: /UPDATE: This method no longer works for creating iCloud accounts. I'd love to know if you find an alternative. Please let me know./ I wanted an additional @icloud.com account for myself. My first thought was to head over to https://developer.apple.com and create a new account, but that requires an existing email address. I wanted an actual @icloud.com email address. #+ATTR_HTML: :width 80% [[file:images/creating-icloud-test-accounts/web.png]] My next thought was to create a new account using the iOS simulator, but that complained about creating too many accounts already. Strange, as I hadn't created any. #+ATTR_HTML: :width 60% [[file:images/creating-icloud-test-accounts/iphone.png]] I could create an account from macOS settings itself, though that would require logging out my current account (and the syncing implications). To get around that, I could maybe create a temporary macOS user. Instead, I somewhat revisited the simulator route and looked for a VM option to run macOS. This gave me an excuse to play with VM options on macOS. I had been meaning to check out [[https://github.com/lima-vm/lima][lima]] as per Hacker News's [[https://news.ycombinator.com/item?id=36668964][Lima: A nice way to run Linux VMs on Mac]]. The Hacker News's [[https://news.ycombinator.com/item?id=36668964][thread]] has a handful of great recommendations. Amongst them, [[https://github.com/cirruslabs/tart/][tart]] (macOS and Linux VMs on Apple Silicon) stood out, as it also gave me the Mac on Mac option. Installing =tart= via [[https://brew.sh/][Homebrew]] followed the typical =brew= command... a breeze via my trusty Emacs [[https://www.masteringemacs.org/article/complete-guide-mastering-eshell][eshell]]: #+begin_src sh brew install cirruslabs/cli/tart #+end_src Cloning a VM image, while straightforward, it did take a little while for the chunky download: #+begin_src sh tart clone ghcr.io/cirruslabs/macos-sonoma-base:latest sonoma-base #+end_src Running the macOS Sonoma VM was a breeze: #+begin_src sh tart run sonoma-base #+end_src ...and with that, I got a full (and disposable) macOS VM I can use to create another @icloud.com account: #+ATTR_HTML: :width 95% [[file:images/creating-icloud-test-accounts/sonoma1.png]] #+ATTR_HTML: :width 95% [[file:images/creating-icloud-test-accounts/sonoma2.png]] While there may be simpler options out there to create an @icloud.com account (please do let me know [[https://indieweb.social/@xenodium][mastodon]]/[[https://twitter.com/xenodium][twitter]]), the VM did the job. I'd been meaning to find a low friction mechanism to run VMs for a different reason, but that's a post for another time. * [2023-10-04 Wed] Virtual machine (VM) bookmarks :PROPERTIES: :CUSTOM_ID: virtual-machine-vm-bookmarks :END: :MODIFIED: [2023-10-04 Wed] :END: - [[https://github.com/abiosoft/colima][colima: Container runtimes on macOS (and Linux) with minima...]]. - [[https://github.com/runfinch/finch][finch: The Finch CLI an open source client for container development]]. - [[https://earthly.dev/blog/lima/][lima VM - Linux Virtual Machines On macOS - Earthly Blog]]. - [[https://news.ycombinator.com/item?id=36668964][lima: A nice way to run Linux VMs on Mac | Hacker News]]. - [[https://github.com/lima-vm/lima][lima: Linux virtual machines]]. - [[https://github.com/beringresearch/macpine][macpine: Lightweight Linux VMs on MacOS]]. - [[https://orbstack.dev/][OrbStack · Fast, light, simple Docker & Linux on macOS]]. - [[https://github.com/cirruslabs/tart/][tart: macOS and Linux VMs on Apple Silicon to use in CI a...]]. - [[https://eclecticlight.co/virtualisation-on-apple-silicon/][Virtualisation on Apple silicon – The Eclectic Light Company]]. * [2023-09-16 Sat] Emacs hangs saving .authinfo.gpg (workaround) :PROPERTIES: :CUSTOM_ID: emacs-hangs-saving-authinfogpg-workaround :END: My Emacs (v29.1) was hanging when saving changes to .authinfo.gpg. Turns out, I ran into a [[http://git.savannah.gnu.org/cgit/emacs.git/commit/etc/PROBLEMS?id=1b9812af80b6ceec8418636dbf84c0fbcd3ab694][known issue]] with a workaround. Downgrading gnupgp to a version older than 2.4.1 sorts things out. I'm on macOS. Downgraded by downloading the 2.4.0 Homebrew formula at https://raw.githubusercontent.com/Homebrew/homebrew-core/59edfe598541186430d49cc34f42671e849e2fc9/Formula/gnupg.rb and installing with: #+begin_src sh brew unlink gnupg brew install ~/Downloads/gnupg.rb #+end_src * [2023-09-15 Fri] Redact that buffer :PROPERTIES: :CUSTOM_ID: redact-that-buffer :END: As I was getting ready to take an Emacs screenshot in the [[https://xenodium.com/emacs-send-to-kindle/][previous post]], I figured I may want to redact email addresses before moving forward. I had a quick look for existing options and found [[https://github.com/bkaestner/redacted.el][redacted.el]], built-in =toggle-rot13-mode=, and [[https://github.com/alphapapa/unpackaged.el#obfuscate-buffer-text-with-lorem-ipsum-words][unpackaged/lorem-ipsum-overlay]]. All great options. I wanted a solution I could feed a single regular expression to obscure matches. I also wanted toggling capabilities, so I had a quick go at it... #+ATTR_HTML: :width 98% [[file:images/redact-that-buffer/redact-regexp.gif]] I also wanted the ability to redact the entire buffer content, so feeding a space to the regexp query also translates to =[[:graph:]]=, effectively redacting all visible characters. #+ATTR_HTML: :width 98% [[file:images/redact-that-buffer/redact-all.gif]] The solution is overlay-based, ensuring the buffer content remains unchanged. The function may have its own rough edges, yet it certainly scratched the itch for the current need. I'll leave ya with the snippet. #+begin_src emacs-lisp :lexical no (defun ar/toggle-redact-buffer () "Redact buffer content matching regexp. A space redacts all." (interactive) (let* ((redacted) (regexp (string-trim (read-regexp "Redact regexp" 'regexp-history-last))) (matches (let ((results '())) (when (string-empty-p regexp) (setq regexp "[[:graph:]]") (setq regexp-history-last regexp) (add-to-history 'regexp-history regexp)) (save-excursion (goto-char (point-min)) (while (re-search-forward regexp nil t) (push (cons (match-beginning 0) (match-end 0)) results))) (nreverse results)))) (mapc (lambda (match) (dolist (overlay (overlays-in (car match) (cdr match))) (setq redacted t) (delete-overlay overlay)) (unless redacted (overlay-put (make-overlay (car match) (cdr match)) 'display (make-string (- (cdr match) (car match)) ?x)))) matches))) #+end_src * [2023-09-15 Fri] Send note to Kindle :PROPERTIES: :CUSTOM_ID: emacs-send-to-kindle :END: While on Mastodon, I spotted [[https://indieweb.social/@summeremacs@fashionsocial.host][@summeremacs]] looking into [[https://indieweb.social/@summeremacs@fashionsocial.host/111058226788825431][sending Emacs text selections to a Kindle via email]]. This sparked my interest as I previously looked into [[https://xenodium.com/emailing-pdfs-to-kindle-from-mu4e/][sending pdfs to my Kindle]] via [[https://github.com/djcb/mu][mu4e]]. Kindle offers a neat service where you can email a file to your =@kindle.com= address and it automatically shows up in your Kindle library. I already do email from my beloved editor, and like most Emacs things, it's powered by [[https://en.wikipedia.org/wiki/Emacs_Lisp][elisp]]. In other words, it's basically up for grabs if you'd like to glue it to anything else, so I did... I can now select a region and invoke =M-x send-to-kindle-as-txt= to send it over to my Kindle. #+ATTR_HTML: :width 80% [[file:images/emacs-send-to-kindle/send-to-my-kindle.gif]] Soon enough, the note shows up on my Kindle. #+ATTR_HTML: :width 70% [[file:images/emacs-send-to-kindle/listed.png]] Opening the note reveals the same content we had previously selected and sent from our malleable editor. #+ATTR_HTML: :width 70% [[file:images/emacs-send-to-kindle/repeated.png]] While it looks kinda magical, it's fairly simple under the hood. It takes the region content, writes it to a txt file, creates an email message buffer attaching the file, and finally sends via =message-send-and-exit=. If =M-x send-to-kindle-as-txt= is invoked with a =C-u= prefix, you get to inspect the message buffer right before sending via =C-c C-c=. #+ATTR_HTML: :width 95% [[file:images/emacs-send-to-kindle/email.png]] Here's the full snippet. #+begin_src emacs-lisp :lexical no (defcustom send-to-kindle-from-email nil "Your own email address to send from via mu4e." :type 'string :group 'send-to-kindle) (defcustom send-to-kindle-to-email nil "Your Kindle email address to send pdf to." :type 'string :group 'send-to-kindle) (defun send-to-kindle-as-txt (review) (interactive "P") (unless send-to-kindle-from-email (setq send-to-kindle-from-email (read-string "From email address: "))) (unless send-to-kindle-to-email (setq send-to-kindle-to-email (read-string "To email address: "))) (let* ((content (string-trim (if (region-active-p) (buffer-substring (region-beginning) (region-end)) (buffer-string)))) (note-name (let ((name (string-trim (read-string "Note name: ")))) (if (string-empty-p name) (nth 0 (string-split (substring content 0 (min 40 (length content))) "\n")) name))) (path (concat (temporary-file-directory) note-name)) (txt (concat path ".txt")) (buffer (get-buffer-create (generate-new-buffer-name "*Email txt*")))) (with-temp-buffer (insert content) (write-file txt)) (with-current-buffer buffer (erase-buffer) ;; Disable hooks (let ((message-mode-hook nil)) (message-mode)) (insert (format "From: %s To: %s Subject: %s --text follows this line-- <#multipart type=mixed> <#part type=\"text/plain\" filename=\"%s\" disposition=attachment> <#/part> <#/multipart>" send-to-kindle-from-email send-to-kindle-to-email note-name txt)) (unless review (message-send-and-exit))) (when review (switch-to-buffer buffer)))) #+end_src By the way, and I only just learned this today... To take a screenshot on a Kindle Paperwhite, tap on these opposite corners. #+ATTR_HTML: :width 70% [[file:images/emacs-send-to-kindle/tap-screenshot.png]] * [2023-09-10 Sun] SHA-256 hash from URL, the easy way :PROPERTIES: :CUSTOM_ID: sha-256-hash-from-url-the-easy-way :END: From time to time, I need to generate a SHA-256 hash from a file hosted on some server. For me, this flow typically goes something along the lines of: - Copy the file URL from browser. - Drop to Emacs eshell. - Change current directory. - Type "curl -o file" - Paste the file URL. - Run curl command. - Type "shasum -a 256 file". - Run [[https://linux.die.net/man/1/shasum][shasum]] command. - Copy the generated hash. - Maybe delete the downloaded file? We can maybe shave some steps off by downloading directly from the browser, though that may also bring additional clicks and navigating to a download location. Amongst the steps, [[https://linux.die.net/man/1/shasum][shasum]] is the star player, and its output can be seen below. #+begin_src bash shasum -a 256 path/to/downloaded/file #+end_src #+RESULTS: : 3da351027e5b1495c7c7fe4abbf8d7ac9625da3604be5a35c9a9cbb92f6f955a path/to/downloaded/file Not a huge deal. One can copy the hash from the output, but why go through multiple small manual steps when I know I can get Emacs to simplify the lot? I've expedited a similar flow in the past when [[https://xenodium.com/emacs-clone-git-repo-from-clipboard/][cloning git repos]]. Let's simplify again so hashing a hosted file boils down to: - Copy the file URL from browser. - Run an Emacs interactive command. This is where I pull out [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] (a little package I wrote) and glue the lot to get an expedited experience. #+ATTR_HTML: :width 100% [[file:images/sha-256-hash-from-url-the-easy-way/hash.gif]] There isn't much to the function other than glueing a little elisp and a shell script via =dwim-shell-command= for some buffer/error handling. #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-sha-256-hash-file-at-clipboard-url () "Download file at clipboard URL and generate SHA-256 hash." (interactive) (let ((url (current-kill 0))) (unless (string-match-p "^http[s]?://" url) (user-error "No URL in clipboard")) (dwim-shell-command-on-marked-files "Generate SHA-256 hash from clipboard URL." (format "temp_file=$(mktemp) function cleanup { rm -f $temp_file } trap cleanup EXIT curl --no-progress-meter --location --fail --output $temp_file %s || exit 1 shasum -a 256 $temp_file | awk '{print $1}'" (shell-quote-argument url)) :utils '("curl" "shasum") :on-completion (lambda (buffer process) (if-let ((success (= (process-exit-status process) 0)) (hash (with-current-buffer buffer (string-trim (buffer-string))))) (progn (kill-buffer buffer) (kill-new hash) (message "Copied %s to clipboard" (propertize hash 'face 'font-lock-string-face))) (switch-to-buffer buffer)))))) #+end_src =dwim-shell-commands-sha-256-hash-file-at-clipboard-url= is now in [[https://github.com/xenodium/dwim-shell-command/blob/main/dwim-shell-commands.el][dwim-shell-commands.el]], the optional counterpart in [[https://github.com/xenodium/dwim-shell-command/][dwim-shell-command]]. ** UPDATE There's better way. Thanks to [[https://emacs.ch/@pkal][Philip Kaludercic]] for [[https://emacs.ch/@pkal/111041928308815477][suggesting]] =curl -s example.com | sha256sum - | cut -d " " -f1= and [[https://emacs.ch/@sachac][Sacha Chua]] who pinged me about it. Also note I'm now relying on the =<>= template, since dwim-shell-command replaces it with the clipboard/kill ring. #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-sha-256-hash-file-at-clipboard-url () "Download file at clipboard URL and generate SHA-256 hash." (interactive) (unless (string-match-p "^http[s]?://" (current-kill 0)) (user-error "No URL in clipboard")) (dwim-shell-command-on-marked-files "Generate SHA-256 hash from clipboard URL." "curl -s '<>' | sha256sum - | cut -d ' ' -f1" :utils '("curl" "sha256sum") :on-completion (lambda (buffer process) (if-let ((success (= (process-exit-status process) 0)) (hash (with-current-buffer buffer (string-trim (buffer-string))))) (progn (kill-buffer buffer) (kill-new hash) (message "Copied %s to clipboard" (propertize hash 'face 'font-lock-string-face))) (switch-to-buffer buffer))))) #+end_src * [2023-09-05 Tue] Inline previous result and why you should edebug :PROPERTIES: :CUSTOM_ID: inline-previous-result-and-why-you-should-edebug :END: Artur Malabarba's [[https://endlessparentheses.com/debugging-emacs-lisp-part-1-earn-your-independence.html][Debugging Elisp Part 1: Earn your independence]] is nearly a decade old, yet it rings just as true today. Learning to Edebug really /"is the right decision for anyone who doesn't know how to Edebug."/ Why, you may ask? He best puts it as /"running into errors is not only a consequence of tinkering with your editor, it is the only road to graduating in Emacs."/ For me personally, it /earned me that independence/ to bend Emacs my way. Don't like how something works? Pull up the debugger to help me understand how a package or function works. I've done this countless of times to bend things my way. Speaking of edebug, I had been meaning to tweak edebug's result display behaviour for quite some time. As you step through code, edbug prints the result of previous expressions to the minibuffer. This works well, but I couldn't help but feel like my eyes were constantly jumping between the code and the minibuffer at the bottom of the window. #+ATTR_HTML: :width 70% [[file:images/inline-previous-result-and-why-you-should-edebug/edebug-minibuffer.gif]] I wanted to minimize the eye jumping experience, so I figured I could likely bend things my way and print the result at point. How did I go about it? The same way I often do. Figure out what function is called for a given key binding via [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Key-Help.html][describe-key]] or my favourite replacement helpful-key from [[https://github.com/Wilfred/helpful][helpful.el]]. This led me to =edebug-next-mode= in =edebug.el=. At that point, I could have set a breakpoint in =edebug-next-mode= and eventually step into the relevant code, but hey we had a better clue. We knew that all output started with "Result:", so we could just search for that string in =edebug.el= instead. Jackpot! =edebug-compute-previous-result= and its adjacent =edebug-previous-result= are just the right functions: #+begin_src emacs-lisp :lexical no (defun edebug-compute-previous-result (previous-value) (if edebug-unwrap-results (setq previous-value (edebug-unwrap* previous-value))) (setq edebug-previous-result (concat "Result: " (edebug-safe-prin1-to-string previous-value) (eval-expression-print-format previous-value)))) (defun edebug-previous-result () "Print the previous result." (interactive) (message "%s" edebug-previous-result)) #+end_src We can see that =edebug-previous-result= invokes =message= which is responsible for displaying the debugged expression's result in the minibuffer. Modifying this functions behaviour would be enough to achieve inline display, but I also want to remove "Result:" from the displayed message. Neither of these functions offer configurability, so we'll resort to advising both functions. That is, [[https://en.wikipedia.org/wiki/Monkey_patch][monkey patch]] them (errm I know... lovely). #+begin_src emacs-lisp :lexical no (defun adviced:edebug-compute-previous-result (_ &rest r) "Adviced `edebug-compute-previous-result'." (let ((previous-value (nth 0 r))) (if edebug-unwrap-results (setq previous-value (edebug-unwrap* previous-value))) (setq edebug-previous-result (edebug-safe-prin1-to-string previous-value)))) (advice-add #'edebug-compute-previous-result :around #'adviced:edebug-compute-previous-result) #+end_src =adviced:edebug-compute-previous-result= removes "Result:" in addition to dropping =(eval-expression-print-format previous-value)=, which I don't typically rely on. #+begin_src emacs-lisp :lexical no (require 'eros) (defun adviced:edebug-previous-result (_ &rest r) "Adviced `edebug-previous-result'." (eros--make-result-overlay edebug-previous-result :where (point) :duration eros-eval-result-duration)) (advice-add #'edebug-previous-result :around #'adviced:edebug-previous-result) #+end_src =adviced:edebug-previous-result= is in charge of display via =message=, so all we need is some replacement. I initially played with [[https://github.com/auto-complete/popup-el][popup-tip]] and that [[https://indieweb.social/@xenodium/111008598580447299][did the job just fine]], but [[https://emacs.ch/@fosskers][Colin]] led me to a better path while [[https://emacs.ch/@fosskers/111009811997698187][pointing to Clojure and Common Lisp]]. This reminded me of [[https://github.com/xiongtx/eros][eros: Evaluation Result OverlayS for Emacs Lisp]], which I already used. Swapping =message= for =eros--make-result-overlay= did the trick. Yes, this is a private function, but I can live with that. This code is only an =advice-remove= away from disabling, but hey look at those /inline results/! #+ATTR_HTML: :width 90% [[file:images/inline-previous-result-and-why-you-should-edebug/edebug-inline.gif]] * [2023-08-27 Sun] Further sqlite-mode extensions :PROPERTIES: :CUSTOM_ID: further-sqlite-mode-extensions :END: I've continued poking at Emacs 29's sqlite-mode. Since [[https://xenodium.com/sqlite-mode-goodies/][my last post on extensions]], I've experimented a little with adding a handful of interactive functions: - =sqlite-mode-extras-compose-and-execute=: Compose and execute a query. #+ATTR_HTML: :width 90% [[file:images/further-sqlite-mode-extensions/compose-execute.gif]] - =sqlite-mode-extras-execute=: Execute a query. #+ATTR_HTML: :width 90% [[file:images/further-sqlite-mode-extensions/execute.gif]] - =sqlite-mode-extras-add-row=: Add row to table at point. #+ATTR_HTML: :width 90% [[file:images/further-sqlite-mode-extensions/add-row.gif]] - =sqlite-mode-extras-delete-row-dwim=: Similar to =sqlite-mode-delete= but also enables deleting range in region. #+ATTR_HTML: :width 90% [[file:images/further-sqlite-mode-extensions/delete-rows.gif]] - =sqlite-mode-extras-refresh=: Refreshes the buffer re-querying the database. - =sqlite-mode-extras-ret-dwim=: If on table, toggle expansion. If on row, edit it. - =sqlite-mode-extras-execute-and-display-select-query=: Executes a query and displays results. #+ATTR_HTML: :width 90% [[file:images/further-sqlite-mode-extensions/select-earth.gif]] I've been playing with the following key bindings: #+begin_src emacs-lisp :lexical no (use-package sqlite-mode-extras :bind (:map sqlite-mode-map ("n" . next-line) ("p" . previous-line) ("b" . sqlite-mode-extras-backtab-dwim) ("f" . sqlite-mode-extras-tab-dwim) ("+" . sqlite-mode-extras-add-row) ("D" . sqlite-mode-extras-delete-row-dwim) ("C" . sqlite-mode-extras-compose-and-execute) ("E" . sqlite-mode-extras-execute) ("S" . sqlite-mode-extras-execute-and-display-select-query) ("DEL" . sqlite-mode-extras-delete-row-dwim) ("g" . sqlite-mode-extras-refresh) ("" . sqlite-mode-extras-backtab-dwim) ("" . sqlite-mode-extras-tab-dwim) ("RET" . sqlite-mode-extras-ret-dwim))) #+end_src The code lives in [[https://github.com/xenodium/dotsies/blob/main/emacs/ar/sqlite-mode-extras.el][sqlite-mode-extras.el]] under my [[https://github.com/xenodium/dotsies/tree/main][Emacs config repo]]. Beware, it's fairly experimental and hasn't been tested thoroughly. * [2023-08-22 Tue] My custom Tesco Clubcard pkpass :PROPERTIES: :CUSTOM_ID: my-custom-tesco-clubcard-pkpass :END: My significant other and I had two plastic Tesco Clubcards. I lost mine, so I took a picture of hers. I was fairly certain a barcode photo would scan just as well at self-checkout, and it did. This got me thinking about Apple's Wallet [[https://en.wikipedia.org/wiki/PKPASS][pkpasses]]. I don't really know much about them. Could I potentially create my own =.pkpass=? If I could just include the same barcode as in the photo, it should do the job just fine. Now I should mention, [[https://apps.apple.com/gb/app/tesco-grocery-clubcard/id389581236][Tesco does have an app on the App Store]]. If you just want the official Wallet pass on your iPhone, use that. But I was curious about whether or not I could create my own pass. Turns out I /can/. I followed Apple's [[https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/PassKit_PG/YourFirst.html][building your first pass]] which runs you through [[https://developer.apple.com/help/account/configure-app-capabilities/create-wallet-identifiers-and-certificates][creating Wallet identifiers/certificates]], editing =pass.json=, and downloading/building [[https://developer.apple.com/services-account/download?path=/iOS/Wallet_Support_Materials/WalletCompanionFiles.zip][signpass]] (the utility used to sign =.pass= bundles). The =signpass= utility is included in WalletCompanionFiles.zip, which comes with a handful of sample passes. #+begin_src emacs-lisp :lexical no WalletCompanionFiles │ ├── SamplePasses │ │ │ ├── BoardingPass.pass │ ├── Coupon.pass │ ├── Event.pass │ ├── Event.pkpass │ ├── Generic.pass │ └── StoreCard.pass │ │ │ ├── pass.json │ └── ... └── signpass #+end_src Being a rewards card, I opted to look into =StoreCard.pass=, but like all other passes, the =barcode= itself is what makes each pass scannable. The barcode details are specified in the bundles's =pass.json= file. I needed to figure out the relevant values describing the Tesco barcode. #+begin_src json "barcode": { "format": "???", "message": "???", "messageEncoding": "???" } #+end_src I had no clue what values I should use for a Tesco Clubcard. I did, however, have a photo of the barcode I needed. This is in fact what prompted looking into [[https://xenodium.com/emacs-scan-this-qrcode][scanning barcodes from Emacs]], which worked just great. It gave me all the crucial bits for the Clubcard. #+begin_src json "barcode": { "format": "PKBarcodeFormatCode128", "message": "1234567890123456", // not my actual Clubcard number of course. "messageEncoding": "iso-8859-1" } #+end_src That's all that's needed for the barcode section, the most useful part of the pass. We're not done though. We also need our registered Wallet identifiers, so the =signpass= utility can sign. #+begin_src json "passTypeIdentifier": "my.com.identifier.passmaker", // also not my actual one. "teamIdentifier": "AAABBBCCCD", // nor this one. #+end_src We should be able to sign the pass with the following: #+begin_src sh signpass -p StoreCard.pass #+end_src We're technically done. We now have a working card, but it looks just like the sample store card included in WalletCompanionFiles. #+ATTR_HTML: :width 50% [[file:images/my-custom-tesco-clubcard-pkpass/lemons.png]] What's the fun in that? Now that I can make my own Clubcard, let's customize it! For imagery, I replaced a couple of images in the .pass bundle: #+begin_src c StoreCard.pass │ ├── pass.json ├── icon.png ├── logo.png // replaced └── strip.png // replaced #+end_src I replaced =logo.png= using a [[https://en.wikipedia.org/wiki/File:Tesco_Logo.svg][Tesco logo I found on Wikipedia]]. I had initially removed =strip.png=, but that made the card feel a little empty. I was thinking of using a Tesco carrier bag to bulk the space up. While I didn't find a suitable bag image, I did land on "[[https://banksyexplained.com/very-little-helps-2008/][Very Little Helps, 2008]]". Using my limited [[https://www.gimp.org/][GIMP]] skills, I cropped one of the images and also replaced =strip.png=. The remaining customizations took place in =pass.json= and should be fairly self-explanatory. There's the text shown in all labels as well as three customizable colours (background, label, and foreground). #+begin_src json { "formatVersion": 1, "passTypeIdentifier": "my.com.identifier.passmaker", // also not my actual one. "teamIdentifier": "AAABBBCCCD", // nor this one. "serialNumber": "AnySerialNumberYouWant", "barcode": { "format": "PKBarcodeFormatCode128", "message": "1234567890123456", "messageEncoding": "iso-8859-1" }, "organizationName": "Not Tesco of course", "description": "Not a Tesco reqards card", "logoText": "Clubcard", "foregroundColor": "rgb(255, 255, 255)", "labelColor": "rgb(255, 255, 255)", "backgroundColor": "rgb(2, 81, 158)", // Blue for that Tesco look "storeCard": { "auxiliaryFields": [ { "key": "membership", "label": "Member since 2023", "value": "" }, { "key": "membership2", "label": "Expires sometime", "value": "" } ] } } #+end_src ...and with all that, here's what my very own custom Tesco Clubcard pkpass looks like. As you can appreciate, my image-editing skills aren't all that great, but hey this will do for now. #+ATTR_HTML: :width 50% [[file:images/my-custom-tesco-clubcard-pkpass/bsy.png]] ** Update Redditor u/stupergenius [[https://www.reddit.com/r/programming/comments/15y4c65/comment/jxa1obg/?utm_source=share&utm_medium=web2x&context=3][suggested using the image's original background color]]. Nice suggestion. Tweaked via pass.json: #+begin_src json "foregroundColor": "rgb(2, 81, 158)", "labelColor": "rgb(15, 58, 105)", "backgroundColor": "rgb(166, 202, 214)", #+end_src #+ATTR_HTML: :width 50% [[file:images/my-custom-tesco-clubcard-pkpass/bsy-light.png]] * [2023-08-07 Mon] Extending sqlite-mode (cell navigation + edits) :PROPERTIES: :CUSTOM_ID: sqlite-mode-goodies :END: I recently [[https://xenodium.com/emacs-29s-sqlite-mode/][wrote about Emacs 29's new sqlite-mode]], which enables you to browse sqlite databases from your beloved editor. Out of the box, it supports the following browsing features: - =sqlite-mode-list-data=: List the data from the table under point. - =sqlite-mode-list-column=: List the columns of the table under point. - =sqlite-mode-list-tables=: Re-list the tables from the currently selected database. On the editing side of things it supports row deletion: - =sqlite-mode-delete=: Delete the row under point. While fairly spartan, it lays foundations for additional tools and features. Two features I would like to have: 1. TAB navigation across table rows and columns. 2. Updating the row's field at point. This would give me the familiar behaviour I'm used to in my org tables as well as other common spreadsheet tools. Luckily, this is Emacs, so we can bend it our way... and I sure did! Here's tab navigating forward: #+ATTR_HTML: :width 75% [[file:images/sqlite-mode-goodies/sqlite-forward.gif]] Here's tab navigating backward: #+ATTR_HTML: :width 75% [[file:images/sqlite-mode-goodies/sqlite-previous.gif]] And updating row fields: #+ATTR_HTML: :width 90% [[file:images/sqlite-mode-goodies/sqlite-edits.gif]] Most of the navigation is achieved by querying the current buffer to figure out column positions. Editing was in some ways easier, as I looked at =sqlite-mode-delete= to figure out how it handled the query. To get the more familiar navigation behaviour, I've adjusted my key bindings as follows: #+begin_src emacs-lisp :lexical no (use-package sqlite-mode-extras :bind (:map sqlite-mode-map ("n" . next-line) ("p" . previous-line) ("" . sqlite-mode-extras-backtab-dwim) ("" . sqlite-mode-extras-tab-dwim) ("RET" . sqlite-mode-extras-ret-dwim))) #+end_src The code for =sqlite-mode-extras-tab-dwim=, =sqlite-mode-extras-backtab-dwim=, and =sqlite-mode-extras-ret-dwim= is little rough still (hacky even), but hey still fun. For now, the code lives in [[https://github.com/xenodium/dotsies/blob/main/emacs/ar/sqlite-mode-extras.el][sqlite-mode-extras.el]] under my [[https://github.com/xenodium/dotsies/tree/main][Emacs config repo]]. Improvements/fixes totally welcome! * [2023-08-06 Sun] Emacs 29's sqlite-mode :PROPERTIES: :CUSTOM_ID: emacs-29s-sqlite-mode :END: I've jumped on the Emacs 29 bandwagon! Mickey Petersen has a great rundown of [[https://www.masteringemacs.org/article/whats-new-in-emacs-29-1][What's New in Emacs 29.1]]. Now every so often, I need to take a quick peek at an [[https://www.sqlite.org/index.html][sqlite3]] table. Emacs 29.1 ships [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Database.html][sqlite-mode]], which can help with that. Use =sqlite-mode-open-file= to open a database. Pressing =RET= on a table shows its content via =sqlite-mode-list-data=. =DEL= does as you'd expect and delete a row via =sqlite-mode-delete=. #+ATTR_HTML: :width 75% [[file:images/emacs-29s-sqlite-mode/sqlite-mode.gif]] * [2023-07-30 Sun] Emacs: scan this QR/bar code :PROPERTIES: :CUSTOM_ID: emacs-scan-this-qrcode :END: Another day, another tool brought to my Emacs fingertips. A while ago, I wrote about easily [[https://xenodium.com/copy-from-desktop-to-mobile-via-qr-code/][copying text from desktop to mobile via QR codes]]. Later on, I brought it under [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] as [[https://github.com/xenodium/dwim-shell-command/blob/67da65f97d7f5477e19407d25887c23fab31517d/dwim-shell-commands.el#L593][dwim-shell-commands-clipboard-to-qr]]. This time around, I needed the opposite: to scan a code from an image file. This is where [[https://github.com/mchehab/zbar][zbar]]'s =zbarimg= comes in. These days, I'm mostly on macOS, so I installed via [[https://brew.sh/][Homebrew]]: #+begin_src sh $ brew install zbar #+end_src There's really nothing to the command. You feed it an image, and it outputs the scanned details. Perfect. #+begin_src sh $ zbarimg path/to/code-128.png CODE-128:hello world scanned 1 barcode symbols from 1 images in 0.02 seconds #+end_src The only challenge is my brain. I probably won't remember the name of this wonderful tool next time I need it, so I'll just add it to my [[https://github.com/xenodium/dwim-shell-command/blob/main/dwim-shell-commands.el][dwim-shell-commands.el arsenal]] with a memorable name: #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-image-scan-code () "Scan any code from image(s)." (interactive) (dwim-shell-command-on-marked-files "Scan code" "zbarimg '<>'" :utils "zbarimg")) #+end_src In the future, rather than reaching out to =zbarimg= directly, I'll use my trusty fuzzy search and... voilà! #+ATTR_HTML: :width 85% [[file:images/emacs-scan-this-qrcode/scan-dired.gif]] Because =dwim-shell-command= operates on either =dired= files or current file, we can also apply our new function when viewing the QR code itself. #+ATTR_HTML: :width 85% [[file:images/emacs-scan-this-qrcode/scan-image.gif]] =dwim-shell-commands-image-scan-code= is now [[https://github.com/xenodium/dwim-shell-command/commit/85ebcb0a466ddfe48e543d585e16aff7aee8da5e][pushed to dwim-shell-commands.el]], the optional package in [[https://github.com/xenodium/dwim-shell-command/][dwim-shell-command]]. * [2023-07-25 Tue] A cure for JavaScript fatigue? :PROPERTIES: :CUSTOM_ID: a-cure-for-javascript-fatigue :END: It's been roughly a decade since I wrote any significant amount of JavaScript. Back then, I primarily relied on the [[https://developers.google.com/closure/compiler/][Google Closure Compiler]], now maybe an archaeological artefact? These days, it's hard not to bump into any JavaScript project that doesn't rely on [[https://www.npmjs.com/][npm]], along with many other tools like the [[https://www.typescriptlang.org/][Typescript]] compiler, [[https://eslint.org/][ESLint]], [[https://prettier.io/][Prettier]]... There are a ton of available frameworks too. I was somewhat put off (or maybe just lazy?) by the initial ramp-up to reenter the JavaScript world. I guess that's what some refer to as [[https://medium.com/@ericclemmons/javascript-fatigue-48d4011b6fc4#.prcj59904][Javascript Fatigue]]. I'm giving JavaScript another try, but this time with an Emacs [[https://github.com/xenodium/chatgpt-shell][chatgpt-shell]] standing by. Reentering the JavaScript world as a noob, I often know what I want to enable, but I'm unfamiliar with which project knobs to turn to set things up. While I may want to dig deeper into things in the future, at present I just want to dabble with JavaScript. I want a local project set up as quickly as possible. ChatGPT has been pretty handy at that. The Emacs ChatGPT shell and its minibuffer prompts work fairly well for my needs, yet I often found myself wishing it could behave more like a [[https://magit.vc/][magit]] commit buffer. That is, launch a dedicated buffer (not the shell itself), ask the question, maybe paste some snippets, and send it on its way with that oh so familiar and satisfying =C-c C-c= binding ([[https://www.gnu.org/software/emacs/manual/html_node/emacs/Sending-Mail.html][sending mail]] also says hello). This is where =M-x chatgpt-shell-prompt-compose= comes in. It's a mash between the ChatGPT shell and a magit commit buffer: #+ATTR_HTML: :width 85% [[file:images/a-cure-for-javascript-fatigue/node-chatgpt.gif]] In the background, the buffer is still powered by the shell itself, so you can reuse it to ask clarifying questions. #+ATTR_HTML: :width 85% [[file:images/a-cure-for-javascript-fatigue/compose.gif]] A couple of additional features worth mentioning... Invoking =chatgpt-shell-prompt-compose= with an active region automatically copies the region content over to the compose buffer. This is handy if you'd like to create more elaborate prompts with further editing. So far, this feels more natural than editing text from the shell or the minibuffer, where =RET= doesn't insert new lines. The compose buffer is powered by a background shell (storing history for us). Typing =clear= followed by =C-c C-c= clears the background shell history. =chatgpt-shell-prompt-compose= is available in [[https://github.com/xenodium/chatgpt-shell][chatgpt-shell]] v0.72.1. I've so far bound it to =C-c C-e=, though I've already found some unfortunate clashes. * [2023-07-12 Wed] ChatGPT visits the Emacs doctor :PROPERTIES: :CUSTOM_ID: chatgpt-visits-the-emacs-doctor :END: Emacs is a [[https://youtu.be/urcL86UpqZc?t=177][part-time job]]. A [[https://emacs-lsp.github.io/lsp-mode/][multi-language]] development environment. A [[https://www.emacswiki.org/emacs/LispMachine][lisp machine]]. An [[https://www.djcbsoftware.nl/code/mu/mu4e.html][email client]]. A [[https://www.gnu.org/software/emacs/manual/html_node/emacs/EWW.html][web browser]]. A [[https://youtu.be/AyhPmypHDEw][zettelkasten]]. A [[https://www.emacswiki.org/emacs/SpreadSheet][spreadsheet]]. A [[https://codeberg.org/martianh/mastodon.el][mastodon client]]. A [[https://www.masteringemacs.org/article/complete-guide-mastering-eshell][shell]]. A [[https://github.com/ledger/ledger-mode][ledger]]. A [[https://github.com/alphapapa/org-super-agenda][super agenda]]. An [[https://twitter.com/nixcraft/status/1435140596520218628][operating system]]. Some say it sends [[https://xkcd.com/378/][ripples into the atmosphere]] or [[https://github.com/skeeto/autotetris-mode][plays tetris for you]]. It may even [[https://github.com/johanvts/emacs-fireplace][warm your place up]] during the winter. Can [[https://github.com/TeMPOraL/nyan-mode][meme with you]]. It's an ultra-malleable editor with endless possibilities, powered by your life-long customizations. Oh man, no wonder we need to chat to someone from time to time. You know what I mean? /"[[https://knowyourmeme.com/editorials/guides/what-does-sir-this-is-a-wendys-mean][Sir, this is a Wendy's]]"/. Luckily, we also have the built-in Emacs psychotherapist we can chat to, courtesy of [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Amusements.html][M-x doctor]]. It's powered by [[https://en.wikipedia.org/wiki/Emacs_Lisp][elisp]], and like all Emacs things, it's basically up for grabs. What I mean is, elisp implements many of these features, but also glues the lot for you. Once you learn a little elisp, you can build new Emacs features but also glue others for that magical compound effect. #+ATTR_HTML: :width 85% #+CAPTION: The Emacs doctor [[file:images/chatgpt-visits-the-emacs-doctor/got-a-problem.gif]] A little while ago, I wanted to give [[https://openai.com/blog/chatgpt][ChatGPT]] a try, preferably from Emacs (of course). I figured a shell interface would be a great fit for the interaction. Emacs already shipped with a general command interpreter ([[https://www.gnu.org/software/emacs/manual/html_node/emacs/Shell-Prompts.html][comint]]), so I cobbled together a [[https://xenodium.com/a-chatgpt-emacs-shell/][ChatGPT Emacs shell]]. #+ATTR_HTML: :width 75% #+CAPTION: [[https://github.com/xenodium/chatgpt-shell][chatgpt-shell]] [[file:images/chatgpt-visits-the-emacs-doctor/cyberpunk.gif]] So where am I going with all this? The fine netizens [[https://www.reddit.com/user/emaphis/][r/emaphis]] and [[https://news.ycombinator.com/user?id=salgernon][salgernon]] both planted a great seed: - /"[[https://www.reddit.com/r/emacs/comments/11wdub9/comment/jczrlt7][Now for extra-credit, add the ability for Alt-X doctor to psychoanalyze Chat-GPT]]"/. - /"[[https://news.ycombinator.com/item?id=35259022][So how about a quick M-x psychoanalyze-chatgpt?]]"/ I haven't forgotten about you. Let's take [[https://github.com/xenodium/chatgpt-shell][chatgpt-shell]], /M-x doctor/, our versatile elisp glue, and let's make them talk: #+CAPTION: courtesy of [[https://www.reddit.com/r/emacs/comments/122nm9r/comment/jdv9f1i][thriveth]] and [[https:/asset.dr.dk/imagescaler01/downol.dr.dk/download/bonanza/thumbs/000026814.jpg][dr.dk]]. [[file:images/chatgpt-visits-the-emacs-doctor/000026814.jpg]] There isn't too much to the code, but beware: 1. If you want to run it, you'll need chatgpt-shell [[https://github.com/xenodium/chatgpt-shell#install][installed and set up]]. 2. This was a quick fun hack. No code judging ;) The snippet is further down... Start with =chatgpt-shell-visit-doctor= as the entry point, setting things up for us. It creates both the =*chatgpt*= and =*doctor*= buffers and arranges the windows next to each other. We also set a ChatGPT system prompt to guide things a little: #+begin_quote "Pretend to be an overwhelmed Emacs user who is obsessed with configuring their init.el file. You are in a session talking to a psychotherapist. Limit your output to no more than 20 words. In the course of 5 exchanges between you and the therapist, show improvements. On the 8th exchange after therapist speaks, declare you are cured and only output 'Thank you doc, I think I'm cured!'" #+end_quote ChatGPT and Emacs doctor can go on and on, so we limit ChatGPT responses to 20 words per response and 8 exchanges. We don't want the session to abruptly end without a resolution, so we'll use /Thank you doc, I think I'm cured!/ as our key phrase to end the session. We register =chatgpt-shell--on-chatgpt-patient-response= as a hook to receive ChatGPT output, which we feed to the =*doctor*= buffer. We subsequently get a doctor response that's fed back to ChatGPT via =chatgpt-shell--insert-doc-response=. We add some additional freebies like binding =Ctrl-c Ctrl-c= to =chatgpt-shell-leave-doctor=, so we can bail out of the exchange from the =*chatgpt*= buffer. We also introduced =chatgpt-shell--insert-delayed-text= as a replacement for [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Insertion.html][insert]] to slow things down a little. For visual effects, really. #+begin_src emacs-lisp :lexical no (require 'chatgpt-shell) (defun chatgpt-shell-visit-doctor () (interactive) (setq chatgpt-shell--doctor-in-session t) (when (get-buffer "*doctor*") (kill-buffer "*doctor*")) (delete-other-windows) (split-window-horizontally) (other-window 1) (doctor) (visual-line-mode 1) (when (fboundp 'accent-menu-mode) (accent-menu-mode -1)) (mapc (lambda (shell-buffer) (kill-buffer shell-buffer)) (chatgpt-shell--shell-buffers)) (other-window 1) (setq chatgpt-shell-system-prompts '(("Doc" . "Pretend to be an overwhelmed Emacs user who is obsessed with configuring their init.el file. You are in a session talking to a psychotherapist. Limit your output to no more than 20 words. In the course of 5 exchanges between you and the therapist, show improvements. On the 8th exchange after therapist speaks, declare you are cured and only output \"Thank you doc, I think I'm cured!\"."))) (setq chatgpt-shell-system-prompts nil) (setq chatgpt-shell-system-prompt nil) (with-current-buffer (chatgpt-shell) (define-key chatgpt-shell-mode-map (kbd "C-c C-c") 'chatgpt-shell-leave-doctor) (shell-maker-set-buffer-name (current-buffer) "*chatgpt*")) (chatgpt-shell--insert-doc-response)) (defun chatgpt-shell--doc-conversation () (let ((convo (with-current-buffer "*doctor*" (split-string (buffer-string) "\n\n")))) (seq-remove (lambda (item) (string-empty-p (string-trim item))) (append ;; Replace first doc line, so it drops "Each time you are finished talking, type RET twice." (list "I am the psychotherapist. Please, describe your problems.") (mapcar (lambda (item) (replace-regexp-in-string "\n" " " item)) (cdr convo)))))) (defun chatgpt-shell--doc-response () (let* ((conversation (chatgpt-shell--doc-conversation)) (length (seq-length conversation)) (doc-response (nth (1- length) conversation))) doc-response)) (defun chatgpt-shell--insert-doc-response () (with-current-buffer "*chatgpt*" (goto-char (point-max)) (chatgpt-shell--insert-delayed-text (chatgpt-shell--doc-response)) (call-interactively 'shell-maker-submit))) (defun chatgpt-shell--insert-delayed-text (text) "Insert TEXT into the current buffer, with a delay between each character." (dolist (char (string-to-list text)) (insert char) (sit-for 0.009))) (defun chatgpt-shell--on-chatgpt-patient-response (command output) (if (and chatgpt-shell--doctor-in-session (not (string-match-p (regexp-quote "I'm cured") output))) (progn (with-current-buffer "*chatgpt*" (goto-char (point-max))) (with-selected-window (get-buffer-window "*doctor*") (goto-char (point-max)) (chatgpt-shell--insert-delayed-text output) (call-interactively 'doctor-ret-or-read) (chatgpt-shell--insert-doc-response))) (message "Bye Bye"))) (defun chatgpt-shell-leave-doctor () (interactive) (setq chatgpt-shell--doctor-in-session nil) (call-interactively 'chatgpt-shell-ctrl-c-ctrl-c)) (add-hook 'chatgpt-shell-after-command-functions #'chatgpt-shell--on-chatgpt-patient-response) (global-set-key (kbd "M-q") #'chatgpt-shell-visit-doctor) #+end_src Ok, enough already. Let's see it in action. #+ATTR_HTML: :width 100% [[../images/chatgpt-visits-the-emacs-doctor/chatgpt-doc_optimized.gif][file:images/chatgpt-visits-the-emacs-doctor/chatgpt-doc_optimized.gif]] If you'd like to take a closer look for analysis, here's the official transcript of this fruitful session: #+begin_quote I am the psychotherapist. Please, describe your problems. Each time you are finished talking, type RET twice. I spend hours tweaking my Emacs config, but it's never perfect. I'm overwhelmed and obsessed with customization. Is it because it's not ever perfect you are overwhelmed and obsessed with customization that you came to me? Yes, I can't stop myself from constantly trying to tweak and improve my Emacs configuration. It's consuming me. Emacs? Hah! I would appreciate it if you would continue. Sorry about that. Yes, I came to you because I'm overwhelmed by my obsession with customizing my Emacs configuration. Does it bother you that you are overwhelmed by your obsession with customizing your emacs configuration? Absolutely! I feel trapped in an endless cycle of tweaking and configuring, unable to achieve satisfaction. Why do you say that? I constantly seek perfection in my Emacs config, but it's an unattainable goal that leaves me exhausted and frustrated. When did you first know that it's an unattainable goal that leaves you exhausted and frustrated? I've realized it recently after spending countless hours trying to perfect my Emacs configuration without any lasting satisfaction. Are you sure? Thanks you doc, I think I'm cured. #+end_quote While we can work exclusively with the =*doctor*= buffer making requests directly to the ChatGPT API, where's the fun in that? Getting the buffers to talk to each other enables us to marvel at both the beauty and absurdity of being able to glue anything together in our lovely Emacs world. Happy Emacsing! * [2023-07-09 Sun] chatgpt-shell v0.60.1 updates :PROPERTIES: :CUSTOM_ID: chatgpt-shell-v0601-updates :END: Back in April, I shared [[https://xenodium.com/chatgpt-shell-available-on-melpa/][chatgpt-shell updates]], showcasing [[https://github.com/xenodium/chatgpt-shell][chatgpt-shell]] features. It's been a little while, so here's an update with the latest additions. Like this project? Consider ✨[[https://github.com/sponsors/xenodium][sponsoring]]✨. ** Multi-session support You can run multiple shell instances independently configured to use different versions or system prompts. This was biggest recent change. Please report issues. #+ATTR_HTML: :width 95% [[file:images/chatgpt-shell-v0601-updates/cat-turtle.gif]] ** Display system prompt and version The current shell's version and system prompt are now displayed more prominently in both the shell prompt and buffer name. #+ATTR_HTML: :width 90% [[file:images/chatgpt-shell-v0601-updates/display.png]] With multi-session support, displaying shell details in the buffer name becomes more important as it makes it easier to find shells across your buffer list. ** Rename shell buffers While buffer names are now automatically derived, one can also use =chatgpt-shell-rename-buffer= to use custom buffer names. ** ob-chatgpt-shell improvements Use =:temperature= to specify the [[https://platform.openai.com/docs/api-reference/completions/create#completions/create-temperature][temperature]]. Use =:context CONTEXT-NAME= to pick and choose which source blocks to aggregate as context. Thank you [[https://github.com/jtmoulia][Thomas Moulia]]. Use =:preflight t= to debug =ob-chatgpt-shell= execution. #+ATTR_HTML: :width 60% [[file:images/chatgpt-shell-v0601-updates/preflight.png]] ** chatgpt-shell-write-git-commit Adds =chatgpt-shell-write-git-commit=, so you can generate commit messages using the current region. Thank you [[https://github.com/bigsky77][Simon Judd]]. ** Approximate context length =chatgpt-shell= now uses =chatgpt-shell--approximate-context-length= to approximate the context size and discard history if necessary. This is pretty experimental but seems to work well enough. It's enabled by default to get some feedback. Please file bugs if needed or send PRs to improve. ** =S-= for multiline input In addition to =C-J= to insert multi-line input, =S-= is also supported. Thank you [[https://github.com/shouya][shouya]] for the submission. ** Welcome message A welcome message now makes the help much more discoverable for new or sporadic users. Thank you [[https://github.com/shouya][shouya]] for the suggestion. #+ATTR_HTML: :width 75% [[file:images/chatgpt-shell-v0601-updates/welcome.png]] ** Help me While the [[https://github.com/xenodium/chatgpt-shell][README]] documents the shells and Emacs is [[https://www.emacswiki.org/emacs/SelfDocumentation][self-documenting]], we now have a =help= command to make things a little more discoverable. #+ATTR_HTML: :width 99% [[file:images/chatgpt-shell-v0601-updates/help.png]] ** Hello chatgpt-shell-mode and dall-e-shell-mode Both =chatgpt-shell= and =dall-e-shell= are both based on =shell-maker= and until recently both shared =shell-maker-mode= as their major mode. This didn't play well with yasnippet. Both shells now enable independent major modes: =chatgpt-shell-mode= and =dall-e-shell-mode=. Thank you [[https://github.com/djliden][Daniel Liden]] for the proposal. ** Saving transcript customizations Make transcript saving more customizable via =shell-maker-transcript-default-path= and =shell-maker-transcript-default-filename=. Thank you [[https://github.com/gnusupport][gnusupport]]. ** New ChatGPT model versions New OpenAI model versions were recently released and added to chatgpt-shell: =gpt-3.5-turbo-0613= and =gpt-4-0613=. Thanks you [[https://github.com/suzuki][Norio Suzuki]]. ** Load awesome prompts =M-x chatgpt-shell-load-awesome-prompts= to download and import curated prompts from [[https://github.com/f/awesome-chatgpt-prompts][awesome-chatgpt-prompts]]. Thank you [[https://github.com/dangom][Daniel Gomez]]. #+ATTR_HTML: :width 75% [[file:images/chatgpt-shell-v0601-updates/awesome.png]] ** ob-async We had reports that ob-chatgpt-shell didn't play nice with [[https://github.com/astahlman/ob-async][ob-async]]. Thank you [[https://github.com/wmedrano][William Medrano]] for the solution. ** Configurable prompts Functions like =chatgpt-shell-describe-code= ask ChatGPT to describe the code in region. These functions used hardcoded English prompts. These are now configurable, so users can tweak or translate if preferred. Thank you [[https://github.com/suzuki][Norio Suzuki]]. - =chatgpt-shell-prompt-header-describe-code= - =chatgpt-shell-prompt-header-refactor-code= - =chatgpt-shell-prompt-header-generate-unit-test= - =chatgpt-shell-prompt-header-proofread-region= - =chatgpt-shell-prompt-header-whats-wrong-with-last-command= - =chatgpt-shell-prompt-header-eshell-summarize-last-command-output= * [2023-07-05 Wed] Duplicate this! :PROPERTIES: :CUSTOM_ID: duplicate-this :END: [[http://www.dyerdwelling.family/][James Dyer]] has a nice [[https://www.emacs.dyerdwelling.family/emacs/20230606213531-emacs--dired-duplicate-here-revisited/][post]] sharing his frequent [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][dired]] need to duplicate files. He offers a solution using a custom interactive command. His use-case resonated with me. Similarly, James' recommendation to bind his file-duplicating command to =C-c d= [1] sent a signal to my brain triggering [[https://twitter.com/bbatsov][Bozhidar Batsov]]'s =crux-duplicate-current-line-or-region=. =crux-duplicate-current-line-or-region= is part of a "collection of Ridiculously useful extensions for Emacs" (yeah that's [[https://github.com/bbatsov/crux][crux]]). The command itself does what it says on the tin. Let's duplicate the current line. #+ATTR_HTML: :width 95% [[file:images/duplicate-this/duplicate-line.gif]] Now let's duplicate the current region. #+ATTR_HTML: :width 95% [[file:images/duplicate-this/duplicate-region.gif]] Since I already have a well-internalized key-binding duplicating lines/regions in text buffers, I could extend a similar behaviour to dired files with almost zero adoption effort. In case you haven't noticed, I've made it a [[https://youtu.be/urcL86UpqZc?t=177][part-time job]] to make command line utilities easily accessible from Emacs ([[https://xenodium.com/joining-images-from-the-comfort-of-dired/][1]] [[https://xenodium.com/emacs-dwim-shell-command/][2]] [[https://xenodium.com/emacs-password-protect-current-pdf-revisited/][3]] [[https://xenodium.com/dwim-shell-command-now-on-windows/][4]] [[https://xenodium.com/recordscreenshot-windows-the-lazy-way/][5]] [[https://xenodium.com/emacs-ffmpeg-and-macos-alias-commands/][6]] [[https://xenodium.com/emacs-quick-kill-process/][7]] [[https://xenodium.com/hey-emacs-change-the-default-macos-app-for/][8]] [[https://xenodium.com/hey-emacs-where-did-i-take-that-photo/][9]] [[https://xenodium.com/emacs-open-with-macos-app/][10]] [[https://xenodium.com/emacs-macos-sharing-dwim-style-improved/][11]] [[https://xenodium.com/emacs-macos-share-from-dired-dwim-style/][12]] [[https://xenodium.com/emacs-reveal-in-finder-dwim-style/][13]] [[https://xenodium.com/dwim-shell-command-usages-pdftotext-and-scp/][14]] [[https://xenodium.com/dwim-shell-command-with-template-prompts/][15]] [[https://xenodium.com/seamless-command-line-utils/][16]] [[https://xenodium.com/dwim-shell-command-video-streams/][17]] [[https://xenodium.com/dwim-shell-command-improvements/][18]] [[https://xenodium.com/dwim-shell-command-on-melpa/][19]] [[https://xenodium.com/emacs-dwim-shell-command-multi-language/][20]] [[https://xenodium.com/png-to-icns-emacs-dwim-style/][21]]) via [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]]. Partly because it's fairly quick and partly 'cause it's fun. Jame's post gave me yet another opportunity to exercise my errrm part-time job. This time, duplicating files. All I need is the [[https://www.man7.org/linux/man-pages/man1/cp.1.html][cp]] utility and a template: #+begin_src sh cp -R '<>' '<>' #+end_src I seldom type these template's myself when I want to execute a command (via =M-x dwim-shell-command=). I typically wrap these templates in interactive commands, making them easily accessible via =M-x= and your favorite completion framework. I happen to use [[https://github.com/abo-abo/swiper][ivy]]. #+begin_src emacs-lisp :lexical no (require 'dwim-shell-command) (defun dwim-shell-commands-duplicate () "Duplicate file(s)." (interactive) (dwim-shell-command-on-marked-files "Duplicate file(s)." "cp -R '<>' '<>'" :utils "cp")) #+end_src There's nothing much to the command. Most logic is handled by the template, replacing =<>= with the current file and =<>= with a uniquified version of it. Having said this, there's a bunch of free [[https://xenodium.com/emacs-dwim-do-what-i-mean/][DWIM]] love that kicks in, courtesy of the =dwim-shell-command= package by yours truly. Let's give our new =dwim-shell-commands-duplicate= command a spin. Like =crux-duplicate-current-line-or-region= duplicates the current line, our new command duplicates the current dired file. #+ATTR_HTML: :width 95% [[file:images/duplicate-this/duplicate-file.gif]] Got multiple files to duplicate? Like =crux-duplicate-current-line-or-region=, we can use the region for a similar purpose. #+ATTR_HTML: :width 95% [[file:images/duplicate-this/duplicate-files.gif]] While we have been using the region to duplicate adjacent files, we can also mark specific files. #+ATTR_HTML: :width 95% [[file:images/duplicate-this/duplicate-marked.gif]] Our =cp -R '<>' '<>'= template uses the =-R= (recursive) flag, so we get another freebie. In addition to files, we can also duplicate directories. #+ATTR_HTML: :width 95% [[file:images/duplicate-this/duplicate-dirs.gif]] Lastly, because we're on a DWIM train, if your current buffer happens to be visiting a file, you can =M-x dwim-shell-commands-duplicate= the current file to duplicate it. You're automatically dropped to a dired buffer, with point on the new file (à la [[https://emacsredux.com/blog/2013/09/24/dired-jump/][dired-jump]]). #+ATTR_HTML: :width 95% [[file:images/duplicate-this/duplicate-buffer.gif]] While duplicating files using a template was a mere =cp -R '<>' '<>'= away, we get a bunch of free DWIM magic applied to a handful of use-cases and contexts. What made the file-duplicating use-case extra special is that it maps almost exactly to an equivalent text command. Keep the same key bindings and we almost get a "[[https://endlessparentheses.com/hungry-delete-mode.html][free feature]]". #+begin_src emacs-lisp :lexical no (use-package crux :ensure t :commands crux-open-with :bind (("C-c d" . crux-duplicate-current-line-or-region))) (use-package dwim-shell-command :ensure t :bind (:map dired-mode-map ("C-c d" . dwim-shell-commands-duplicate)) :config ;; Loads all my own dwim shell commands ;; (including `dwim-shell-commands-duplicate') (require 'dwim-shell-commands)) #+end_src You can find my ever-growing list of similar commands over at [[https://github.com/xenodium/dwim-shell-command/blob/main/dwim-shell-commands.el][dwim-shell-commands.el]] (the optional part of the package). Got some nifty usages? Would love to check 'em out. [[https://indieweb.social/@xenodium][Get in touch]]. Like this or [[https://xenodium.com/][other content]]? [[https://github.com/sponsors/xenodium][✨Sponsor✨ via GitHub Sponsors]]. [1]: I actually use =C-x C-d= for =crux-duplicate-current-line-or-region= but same same... ** Update If you're keen on a regex-based approach, [[https://www.reddit.com/user/arthurno1/][u/arthurno1]] [[https://www.reddit.com/r/emacs/comments/14rmvkx/comment/jqtkel8/?utm_source=share&utm_medium=web2x&context=3][offers a great built-in alternative]]: dired-do-copy-regexp (bound to =% C=). * [2023-06-29 Thu] Stitching images from the comfort of dired :PROPERTIES: :CUSTOM_ID: joining-images-from-the-comfort-of-dired :END: I recently wanted a few images stitched together. A perfect job for [[https://imagemagick.org/][ImageMagick]]. A quick search yielded the magical incantation: #+begin_src sh convert image1.jpg image2.jpg image3.jpg +append joined.jpg #+end_src Great, now I know, but I'll rarely use it and will soon forget it. I may as well add it to my [[https://github.com/xenodium/dwim-shell-command/blob/main/dwim-shell-commands.el][repository]] of [[https://en.wikipedia.org/wiki/DWIM][DWIM]] command line utilities, wrapped in a convenient Emacs function, applicable from different contexts... [[https://xenodium.com/emacs-dwim-do-what-i-mean/][know what I mean]]? 🙃 I built [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] for this purpose. You can take the above command and easily turn it into an interactive Emacs command with something like the following: #+begin_src emacs-lisp :lexical no (require 'dwim-shell-command) (defun dwim-shell-commands-join-images-horizontally () "Join all marked images horizontally as a single image." (interactive) (dwim-shell-command-on-marked-files "Join images horizontally" "convert -verbose '<<*>>' +append 'joined.jpg'" :utils "convert")) #+end_src You can select as many images as you'd like from the comfort of your dired and /make the ImageMagick happen/. #+ATTR_HTML: :width 95% [[file:images/joining-images-from-the-comfort-of-dired/burgers.gif]] The snippet does the job just fine, but we can make it smarter. For starters, let's not hardcode the output filename. We'll ask the user instead. While we're asking, let's offer a default filename, but let's not assume the output extension is =.jpg=. Let's guess based on the image selection. While we're at it, let's not override the output file if already exists. Uniquify it. Most of the above can be achieved by either using [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] helpers or its templating language. For example, =<>= ensures that if =joined.png= already exists, it automatically generates =joined(1).png= instead. #+begin_src emacs-lisp :lexical no (require 'dwim-shell-command) (defun dwim-shell-commands-join-images-horizontally () "Join all marked images horizontally as a single image." (interactive) (let ((filename (format "joined.%s" (or (seq-first (dwim-shell-command--file-extensions)) "png")))) (dwim-shell-command-on-marked-files "Join images horizontally" (format "convert -verbose '<<*>>' +append '<<%s(u)>>'" (dwim-shell-command-read-file-name (format "Join as image named (default \"%s\"): " filename) :default filename)) :utils "convert"))) #+end_src Here's the new horizontal command in action... #+ATTR_HTML: :width 95% [[file:images/joining-images-from-the-comfort-of-dired/burger_row_x1.5_optimized.gif]] Notice how this time we didn't mark the images using =dired-mark=, typically bound to =m=. Instead, we made our selection using the region. Also, if you haven't gotten your junk food fix yet, here's the fries equivalent ;) #+ATTR_HTML: :width 95% [[file:images/joining-images-from-the-comfort-of-dired/fries_row_x1.5_optimized.gif]] We'll rinse all and repeat to get the vertical command equivalent. I know, I know, there's fair amount of duplication but c'est la vie. #+begin_src emacs-lisp :lexical no (require 'dwim-shell-command) (defun dwim-shell-commands-join-images-vertically () "Join all marked images vertically as a single image." (interactive) (let ((filename (format "joined.%s" (or (seq-first (dwim-shell-command--file-extensions)) "png")))) (dwim-shell-command-on-marked-files "Join images vertically" (format "convert -verbose '<<*>>' -append '<<%s(u)>>'" (dwim-shell-command-read-file-name (format "Join as image named (default \"%s\"): " filename) :default filename)) :utils "convert"))) #+end_src ...and for our grand finale, we'll vertically join our burgers and fries. Behold! #+ATTR_HTML: :width 95% [[file:images/joining-images-from-the-comfort-of-dired/finale_x1.5_optimized.gif]] These commands are now part of [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]]. To get them, load the optional commands via =(require 'dwim-shell-commands)=. * [2023-06-18 Sun] noweb: the lesser known org babel glue :PROPERTIES: :CUSTOM_ID: noweb-more-glue-for-your-org-toolbox :END: While [[https://orgmode.org/][Org]] babel's [[https://orgmode.org/manual/Noweb-Reference-Syntax.html][noweb]] isn't something I've frequently used for literate programming, its simplicity makes it rather versatile to glue all sorts of babel things I hadn't previously considered. The idea is simple. Add a placeholder like =<>= to an [[https://orgmode.org/manual/Working-with-Source-Code.html][org babel]] source block, and it will be automatically replaced (verbatim) with the content (or result) of referred block before execution. You'll also need the =:noweb yes= header argument. #+begin_src org ,#+NAME: other-block ,#+begin_src swift print("Hello 0") ,#+end_src ,#+RESULTS: other-block : Hello 0 ,#+BEGIN_SRC swift :noweb yes <> print("Hello 1") ,#+END_SRC ,#+RESULTS: : Hello 0 : Hello 1 #+end_src Since =<>= is replaced with the content of said block, at execution time, the block is effectively equivalent to executing: #+BEGIN_SRC swift print("Hello 0") print("Hello 1") #+END_SRC #+RESULTS: : Hello 0 : Hello 1 Why is this so versatile? Org babel can include/execute all sorts of languages, so you can mix and match the result from one language and massage it to appear as the body of another block using the same (or different) language. I was recently asked [[https://github.com/xenodium/chatgpt-shell/issues/102][how to include the result from one babel block in another]] using [[https://github.com/xenodium/chatgpt-shell/#chatgpt-org-babel][ob-chatgpt-shell]]. While the initial question was looking for a solution involving variables, we can use noweb to achieve a similar goal. Note that in this case, I'll be using =<>=, with =()=, to refer to =#+RESULTS:= rather than the source block itself. #+begin_src org ,#+NAME: hello ,#+BEGIN_SRC chatgpt-shell Say hello in spanish ,#+END_SRC ,#+RESULTS: hello Hola ,#+BEGIN_SRC chatgpt-shell :noweb yes <> What does the previous line say verbatim? ,#+END_SRC #+end_src Executing the block #+BEGIN_SRC chatgpt-shell :noweb yes <> What does the previous line say verbatim? #+END_SRC Gives us #+RESULTS: : The previous line says "Hola". On a similar note, I was asked if the results from a previous source block could be [[https://indieweb.social/@kickingvegas@sfba.social/110562099134297469][fed to a Swift Chart block]] using [[https://github.com/xenodium/ob-swiftui][ob-swiftui]]. While I'm new to [[https://developer.apple.com/documentation/Charts][Swift Charts]], I do love glueing things via Emacs lisp. I figured I could write a little elisp to generate random data and feed it to a SwiftUI block via =<>=. The result is pretty neat, based on Apple's [[https://developer.apple.com/documentation/charts/linemark][LineMark example]]. #+ATTR_HTML: :width 95% [[file:images/noweb-more-glue-for-your-org-toolbox/data-chart.gif]] #+begin_src org ,#+NAME: data ,#+begin_src emacs-lisp :lexical no (concat (mapconcat (lambda (n) (format "MonthlyHoursOfSunshine(city: \"Seattle\", month: %d, hoursOfSunshine: %d)," n (random 100))) (number-sequence 1 20) "\n") "\n" (mapconcat (lambda (n) (format "MonthlyHoursOfSunshine(city: \"Cupertino\", month: %d, hoursOfSunshine: %d)," n (random 100))) (number-sequence 1 20) "\n")) ,#+end_src ,#+begin_src swiftui :results file :noweb yes import Charts struct MonthlyHoursOfSunshine: Identifiable { var city: String var date: Date var hoursOfSunshine: Double var id = UUID() init(city: String, month: Int, hoursOfSunshine: Double) { let calendar = Calendar.autoupdatingCurrent self.city = city self.date = calendar.date(from: DateComponents(year: 2020, month: month))! self.hoursOfSunshine = hoursOfSunshine } } struct ContentView: View { var data: [MonthlyHoursOfSunshine] = [ <> ] var body: some View { Chart(data) { LineMark( x: .value("Month", $0.date), y: .value("Hours of Sunshine", $0.hoursOfSunshine) ) .foregroundStyle(by: .value("City", $0.city)) } .frame(minWidth: 800, minHeight: 300) .padding() .colorScheme(.dark) } } ,#+end_src #+end_src While I've shown fairly basic usages of noweb, we can accomplish some nifty integrations. Check out the [[https://orgmode.org/manual/Noweb-Reference-Syntax.html][noweb reference syntax]] for more examples and additional header arguments like =tangle=, =strip-tangle=, and others. * [2023-05-25 Thu] Deleting from Emacs sequence vars :PROPERTIES: :CUSTOM_ID: deleting-from-emacs-sequence-vars :END: Adding hooks and setting variables is core to customizing Emacs. Take a major mode like =emacs-lisp-mode= as an example. To customize its behaviour, one may add a hook function to =emacs-lisp-mode-hook=, or if you're a little lazy while experimenting, you may even use a lambda. #+begin_src emacs-lisp :lexical no (add-hook 'emacs-lisp-mode-hook #'my/emacs-lisp-mode-config) (add-hook 'emacs-lisp-mode-hook (lambda () (message "I woz ere"))) #+end_src =emacs-lisp-mode-hook='s content would subsequently look as follows: #+begin_src emacs-lisp :lexical no '(my/emacs-lisp-mode-config (lambda nil (message "I woz ere")) ert--activate-font-lock-keywords easy-escape-minor-mode lisp-extra-font-lock-global-mode) #+end_src Maybe =my/emacs-lisp-mode-config= didn't work out for us and we'd like to remove it. We can use =remove-hook= for that and evaluate something like: #+begin_src emacs-lisp :lexical no (remove-hook 'emacs-lisp-mode-hook #'my/emacs-lisp-mode-config) #+end_src The lambda can be removed too, but you ought to be careful in using the same lambda body. #+begin_src emacs-lisp :lexical no (remove-hook 'emacs-lisp-mode-hook (lambda () (message "I woz tere"))) #+end_src There are other ways to remove the lambdas, but we're digressing here... We typically have to write these throwaway snippets to undo our experiments. What if we just had a handy helper always available to remove items from sequences /(edit: we do, =remove-hook= is already interactive, see Update 2 below)/? After all, hooks are just lists (sequences). #+ATTR_HTML: :width 70% [[file:images/deleting-from-emacs-sequence-vars/removed-lambda.gif]] While the interactive command can likely be simplified further, I tried to optimize for ergonomic usage. For example, =completing-read= gives us a way narrow down whichever variable we'd like to modify as well as the item we'd like to remove. =seqp= is also handy, as we filter out noise by automatically removing any variable that's not a sequence. #+begin_src emacs-lisp :lexical no (defun ar/remove-from-list-variable () (interactive) (let* ((var (intern (completing-read "From variable: " (let (symbols) (mapatoms (lambda (sym) (when (and (boundp sym) (seqp (symbol-value sym))) (push sym symbols)))) symbols) nil t))) (values (mapcar (lambda (item) (setq item (prin1-to-string item)) (concat (truncate-string-to-width (nth 0 (split-string item "\n")) (window-body-width)) (propertize item 'invisible t))) (symbol-value var))) (index (progn (when (seq-empty-p values) (error "Already empty")) (seq-position values (completing-read "Delete: " values nil t))))) (unless index (error "Eeek. Something's up.")) (set var (append (seq-take (symbol-value var) index) (seq-drop (symbol-value var) (1+ index)))) (message "Deleted: %s" (truncate-string-to-width (seq-elt values index) (- (window-body-width) 9))))) #+end_src Hooks are just an example of lists we can delete from. I recently used the same command on =display-buffer-alist=. #+ATTR_HTML: :width 80% [[file:images/deleting-from-emacs-sequence-vars/alist.gif]] While this has been a fun exercise, I can't help but think that I'm likely re-inventing the wheel here. Is there something already built-in that I'm missing? ** Update 1 [[https://www.reddit.com/user/github-alphapapa/][alphapapa]] suggested some generalizations that would provide [[https://www.reddit.com/r/emacs/comments/13rvehx/comment/jlni3fc/?utm_source=share&utm_medium=web2x&context=3][an editing buffer of sorts]]. This is a neat idea, using familiar key bindigs =C-c C-c= to save and =C-c C-k= to bail. #+ATTR_HTML: :width 70% [[file:images/deleting-from-emacs-sequence-vars/edit.gif]] Beware, I haven't tested the code with a diverse set of list items, so there's a chance of corrupting the variable content. Improvements to the code are totally welcome. #+begin_src emacs-lisp :lexical no ;;; -*- lexical-binding: t; -*- (defun ar/edit-list-variable () (interactive) (let* ((var (intern (completing-read "From variable: " (let (symbols) (mapatoms (lambda (sym) (when (and (boundp sym) (seqp (symbol-value sym))) (push sym symbols)))) symbols) nil t))) (values (string-join (mapcar #'prin1-to-string (symbol-value var)) "\n"))) (with-current-buffer (get-buffer-create "*eval elisp*") (emacs-lisp-mode) (local-set-key (kbd "C-c C-c") (lambda () (interactive) (eval-buffer) (kill-this-buffer) (message "Saved: %s" var))) (local-set-key (kbd "C-c C-k") 'kill-this-buffer) (erase-buffer) (insert (format "(setq %s\n `(%s))" var values)) (mark-whole-buffer) (indent-region (point-min) (point-max)) (deactivate-mark) (switch-to-buffer (current-buffer))))) #+end_src ** Update 2 So hunch was right... #+BEGIN_QUOTE "While this has been a fun exercise, I can't help but think that I'm likely re-inventing the wheel here. Is there something already built-in that I'm missing?" #+END_QUOTE [[https://www.reddit.com/user/juicecelery/][juicecelery]]'s Reddit commit [[https://www.reddit.com/r/emacs/comments/13rvehx/comment/jlo8mhf/?utm_source=share&utm_medium=web2x&context=3][confirmed it]]. Thank you! [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html][remove-hook]] is already interactive 🤦‍♂️. [[https://knowyourmeme.com/memes/today-i-learned-til][TIL]] 😁 juicecelery was kind enough to point out an improvement in the custom function: #+BEGIN_QUOTE "but I see your improvements, for instance that non list items are removed from the selection." #+END_QUOTE * [2023-05-18 Thu] Sprinkle me logs :PROPERTIES: :CUSTOM_ID: sprinkle-me-logs :END: At times, basic prints/logs are just about the right debugging strategy. Sure, we have debuggers and [[https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop][REPLs]] which are super useful, but sometimes you just know that sprinkling your code with a handful of temporary prints/logs will get you enough info to fix an issue. I must confess, my temporary print statements are fairly uninspiring. Sometimes I log the name of the method/function, but I also resort to less creative options like =print("Yay")= or =print("Got here")=. My laziness and lack of creativity knows no boundaries, so if I need multiple unique entries, I often copy, paste, and append numbers to my entries: =print("Yay 2")=, =print("Yay 3")=, =print("Yay 4")=... I know, are you judging yet? So rather than develop the creative muscle, I've decided to lean on laziness and old habits, so let's make old habit more efficient :) I no longer want to copy, paste, and increment my uncreative log statements. Instead, I'll let Emacs do it for me! #+ATTR_HTML: :width 70% [[file:images/sprinkle-me-logs/log-elisp.gif]] There isn't a whole lot to the implementation. It searches the current buffer for other instances of the same logging string and captures the largest counter found. It subsequently prints the same string with the counter incremented. This can be done in a few lines of elisp, but I figure I wanted some additional features like auto indenting and changing the logging string when using a prefix. #+begin_src emacs-lisp :lexical no (defvar ar/unique-log-word "Yay") (defun ar/insert-unique-log-word (prefix) "Inserts `ar/unique-log-word' incrementing counter. With PREFIX, change `ar/unique-log-word'." (interactive "P") (let* ((word (cond (prefix (setq ar/unique-log-word (read-string "Log word: "))) ((region-active-p) (setq ar/unique-log-word (buffer-substring (region-beginning) (region-end)))) (ar/unique-log-word ar/unique-log-word) (t "Reached"))) (config (cond ((equal major-mode 'emacs-lisp-mode) (cons (format "(message \"%s: \\([0-9]+\\)\")" word) (format "(message \"%s: %%s\")" word))) ((equal major-mode 'swift-mode) (cons (format "print(\"%s: \\([0-9]+\\)\")" word) (format "print(\"%s: %%s\")" word))) ((equal major-mode 'ada-mode) (cons (format "Ada.Text_Io.Put_Line (\"%s: \\([0-9]+\\)\");" word) (format "Ada.Text_Io.Put_Line (\"%s: %%s\");" word))) ((equal major-mode 'c++-mode) (cons (format "std::cout << \"%s: \\([0-9]+\\)\" << std::endl;" word) (format "std::cout << \"%s: %%s\" << std::endl;" word))) (t (error "%s not supported" major-mode)))) (match-regexp (car config)) (format-string (cdr config)) (max-num 0) (case-fold-search nil)) (when ar/unique-log-word (save-excursion (goto-char (point-min)) (while (re-search-forward match-regexp nil t) (when (> (string-to-number (match-string 1)) max-num) (setq max-num (string-to-number (match-string 1)))))) (setq max-num (1+ max-num))) (unless (looking-at-p "^ *$") (end-of-line)) (insert (concat (if (looking-at-p "^ *$") "" "\n") (format format-string (if ar/unique-log-word (number-to-string (1+ max-num)) (string-trim (shell-command-to-string "grep -E '^[a-z]{6}$' /usr/share/dict/words | shuf -n 1")))))) (call-interactively 'indent-for-tab-command))) #+end_src Note: This snippet may evolve independently of this post. For the latest, chech my [[https://github.com/xenodium/dotsies][Emacs config]]'s [[https://github.com/xenodium/dotsies/blob/main/emacs/features/fe-prog.el][fe-prog.el]]. I want to be lazy in other languages, so the function can now be extended to support other languages. Here's the Swift counterpart. #+ATTR_HTML: :width 70% [[file:images/sprinkle-me-logs/log-swift.gif]] Since I sometimes log function names, I figured making it region-aware would help with that. #+ATTR_HTML: :width 80% [[file:images/sprinkle-me-logs/log-selection.gif]] I'm sure there's a package out there that does something similar, but I figure this would be a fun little elisp hack. Happy logging! ** Update 1 Set =ar/unique-log-word= to nil and let it generate a random word. Maybe I get to learn new words as I debug ;) #+ATTR_HTML: :width 80% [[file:images/sprinkle-me-logs/word.gif]] ** Update 2 Added Ada and C++ support, thanks to [[https://www.emacs.dyerdwelling.family/emacs/20230523204523-emacs--insert-unique-log-message/][James Dyer's post]]. * [2023-05-11 Thu] dwim-shell-command on Windows + upload to 0x0.st :PROPERTIES: :CUSTOM_ID: dwim-shell-command-now-on-windows :END: You can now use [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] on Windows. Shoutout to Kartik Saranathan, who sent a [[https://github.com/xenodium/dwim-shell-command/pull/9][pull request]] to get rid of =ls= usage. Also thanks to Bram for sharing his [[https://indieweb.social/@bram85@emacs.ch/110335134760990713][upload to 0x0.st implementation]]. I'd been wanting to do something similar for [[https://imgur.com/][imgur]], but [[https://0x0.st/][0x0.st]] is a much better alternative! #+ATTR_HTML: :width 70% [[file:images/dwim-shell-command-now-on-windows/0x0.gif]] =dwim-shell-commands-upload-to-0x0= is now part of [[https://github.com/xenodium/dwim-shell-command/commit/1a896221cc34319582b0921b919638ea2528b0e6][dwim-shell-commands.el]] (the optional part of the package). It has a couple of additional touches: - Open the uploaded image in [[https://www.gnu.org/software/emacs/manual/html_node/emacs/EWW.html][eww]] browser. - Automatically copy the upload URL to kill-ring. You're likely gonna share this link, right? If you're unfamiliar with =dwim-shell-command=, it enables Emacs shell commands with DWIM behaviour: - Asynchronously. - Using noweb templates. - Automatically injecting files (from [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][dired]] or other buffers) or kill ring. - Managing buffer focus with heuristics. - Showing progress bar. - Quick buffer exit. - More reusable history. In addition to replacing =shell-command= with =dwim-shell-command=, I also use it to bring all sorts of command line utilities to familiar Emacs workflows (in dired or current buffers), without having to remember complex command invocations. I've covered many of the use-cases before: - [[https://xenodium.com/emacs-dwim-shell-command/][Emacs DWIM shell-command]] - [[https://xenodium.com/emacs-password-protect-current-pdf-revisited/][Emacs: Password-protect current pdf (revisited)]] - [[https://xenodium.com/png-to-icns-emacs-dwim-style/][png to icns (Emacs DWIM style)]] - [[https://xenodium.com/emacs-dwim-shell-command-multi-language/][Emacs: DWIM shell command (multi-language)]] - [[https://xenodium.com/dwim-shell-command-on-melpa/][dwim-shell-command on Melpa]] - [[https://xenodium.com/dwim-shell-command-improvements/][dwim-shell-command improvements]] - [[https://xenodium.com/dwim-shell-command-video-streams/][dwim-shell-command video streams]] - [[https://xenodium.com/dwim-shell-command-with-template-prompts/][dwim-shell-command with template prompts]] - [[https://xenodium.com/dwim-shell-command-usages-pdftotext-and-scp/][dwim-shell-command usages: pdftotext and scp]] - [[https://xenodium.com/emacs-reveal-in-finder-dwim-style/][Emacs: Reveal in macOS Finder (DWIM style)]] - [[https://xenodium.com/emacs-macos-share-from-dired-dwim-style/][Emacs: macOS sharing (DWIM style)]] * [2023-05-01 Mon] chatgpt-shell siblings now on MELPA also :PROPERTIES: :CUSTOM_ID: chatgpt-shell-siblings-now-on-melpa-also :END: In [[https://xenodium.com/chatgpt-shell-available-on-melpa/][chatgpt-shell updates]], I highlighted =dall-e-shell= (a DALL-E Emacs shell), =ob-chatgpt-shell= (ChatGPT org babel support), and =ob-dall-e-shell= (DALL-E org babel support) were initially excluded from the [[https://github.com/xenodium/chatgpt-shell][chatgpt-shell]] MELPA submission while I worked out their split. That's now sorted and the packages are available on MELPA. #+ATTR_HTML: :width 70% [[file:images/chatgpt-shell-siblings-now-on-melpa-also/melpa-siblings.jpg]] Here's =ob-chatgpt-shell= and =ob-dall-e-shell= in action. #+ATTR_HTML: :width 70% [[file:images/chatgpt-shell-available-on-melpa/babel.png]] Here's =dall-e-shell=. #+ATTR_HTML: :width 70% [[file:images/chatgpt-shell-available-on-melpa/dalle.png]] * [2023-04-28 Fri] Generating elisp org docs :PROPERTIES: :CUSTOM_ID: generating-elisp-org-docs :END: [[https://github.com/xenodium/chatgpt-shell][chatgpt-shell]]'s README includes few org tables documenting the package's [[https://github.com/xenodium/chatgpt-shell#chatgpt-shell-customizations][customizable variables]] as well as [[https://github.com/xenodium/chatgpt-shell#chatgpt-shell-commands][available commands]]. Don't worry, this isn't really another ChatGPT post. Here's an extract of the docs table: #+begin_src org :lexical no | Custom variable | Description | |---------------------------------------+-------------------------------------------------------------| | chatgpt-shell-display-function | Function to display the shell. | | chatgpt-shell-curl-additional-options | Additional options for `curl' command. | | chatgpt-shell-system-prompt | The system message helps set the behavior of the assistant. | #+end_src While the table docs didn't take long to build manually, they quickly became out of sync with their elisp counterparts. Not ideal, as it'll require a little more careful maintenance in the future. Emacs being the self-documenting editor that it is, I figured I should be able to extract customizable variables, commands, along with their respective docs, and generate these very same org tables. I had no idea how to go about this, but [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Apropos.html][apropos-variable]] and [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Apropos.html][apropos-command]] surely knew where to fetch the details from. A peak into =apropos.el= quickly got me on my way. Turns out [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Symbols.html#Definition-of-mapatoms][mapatoms]] is just what I needed. It iterates over [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Symbols.html][obarray]], Emacs's symbol table. We can use it to extract the symbols we're after. Since we're filtering symbols from =chatgpt-shell=, we can start by including only those whose =symbol-name= match "^chatgpt-shell". Out of all matching, we should only keep custom variables. We can use =custom-variable-p= to check for that. This gives us all relevant variables. We can subsequently get each variable's corresponding docs using =(get symbol 'variable-documentation)= and put it into a list. Now, if we pull our org babel rabbit out of our Emacs magic hat, we can use =:results table= to print the list as an org table. The source block powering this magic trick looks as follows: #+begin_src org ,#+begin_src emacs-lisp :results table :colnames '("Custom variable" "Description") (let ((rows)) (mapatoms (lambda (symbol) (when (and (string-match "^chatgpt-shell" (symbol-name symbol)) (custom-variable-p symbol)) (push `(,symbol ,(car (split-string (or (get (indirect-variable symbol) 'variable-documentation) (get symbol 'variable-documentation) "") "\n"))) rows)))) rows) ,#+end_src #+end_src And just like that... we effortlessly get our elisp docs in an org table, straight from Emacs's symbol table. #+ATTR_HTML: :width 100% [[file:images/generating-elisp-org-docs/docs.gif]] It's worth noting that our snippet used =indirect-variable= to resolve aliases but also limited descriptions to the first line in each docstring. To build a similar table for interactive commands, we can use the following block (also including bindings). #+begin_src org ,#+BEGIN_SRC emacs-lisp :results table :colnames '("Binding" "Command" "Description") (let ((rows)) (mapatoms (lambda (symbol) (when (and (string-match "^chatgpt-shell" (symbol-name symbol)) (commandp symbol)) (push `(,(mapconcat #'help--key-description-fontified (where-is-internal symbol shell-maker-mode-map nil nil (command-remapping symbol)) ", ") ,symbol ,(car (split-string (or (documentation symbol t) "") "\n"))) rows)))) rows) ,#+END_SRC #+end_src #+ATTR_HTML: :width 100% [[file:images/generating-elisp-org-docs/commands.gif]] You see? This post wasn't really about ChatGPT. Aren't you glad you stuck around? 😀 * [2023-04-25 Tue] LLM bookmarks :PROPERTIES: :CUSTOM_ID: llm-bookmarks :END: :MODIFIED: [2023-09-17 Sun] :END: - [[https://vineeth.io/posts/2023/new-age-of-magic/][A New Age of Magic]]. - [[https://news.ycombinator.com/item?id=35643219][Bark – Text-prompted generative audio model | Hacker News]]. - [[https://news.ycombinator.com/item?id=35942583][Brex’s Prompt Engineering Guide | Hacker News]]. - [[https://github.com/suno-ai/bark][GitHub - suno-ai/bark: 🔊 Text-Prompted Generative Audio Model]]. - [[https://blog.rfox.eu/en/Programming/How_to_run_your_own_LLM_GPT.html][How to run your own LLM (GPT)]]. - [[https://promptperfect.jina.ai/][PromptPerfect - Elevate Your Prompts to Perfection with AI Prompt Engineering]]. - [[https://ykgoon.com/running-llm-locally.html][Running LLMs Locally | Y.K. Goon]]. - [[https://sharegpt.com/][ShareGPT: Share your wildest ChatGPT conversations with one click.]]. - [[https://news.ycombinator.com/item?id=35660751][Show HN: Automatic prompt optimizer for LLMs | Hacker News]]. - [[https://fka.gumroad.com/l/art-of-chatgpt-prompting][The Art of ChatGPT Prompting: A Guide to Crafting Clear and Effective Prompts]]. - [[https://fka.gumroad.com/l/the-art-of-midjourney-ai-guide-to-creating-images-from-text][The Art of Midjourney AI: A Guide to Creating Images from Text]]. * [2023-04-25 Tue] chatgpt-shell updates :PROPERTIES: :CUSTOM_ID: chatgpt-shell-available-on-melpa :END: About a month ago, I posted about an experiment to build [[https://xenodium.com/a-chatgpt-emacs-shell/][a ChatGPT Emacs shell]] using [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Shell-Prompts.html][comint mode]]. Since then, it's turned into a package of sorts, evolving with [[https://github.com/xenodium/chatgpt-shell/issues?q=is%3Aissue+is%3Aclosed+][user feedback]] and [[https://github.com/xenodium/chatgpt-shell/pulls?q=is%3Apr+is%3Aclosed][pull requests]]. ** Now on MELPA While [[https://github.com/xenodium/chatgpt-shell][chatgpt-shell]] is a young package still, it seems useful enough to share more widely. As of today, =chatgpt-shell= is [[https://melpa.org/#/chatgpt-shell][available on MELPA]]. Many thanks to [[https://github.com/riscy][Chris Rayner]] for his MELPA guidance to get the package added. #+ATTR_HTML: :width 70% [[file:images/chatgpt-shell-available-on-melpa/cyberpunk.gif]] I'll cover some of the goodies included in the latest =chatgpt-shell=. ** Delegating to Org Babel =chatgpt-shell= now evaluates Markdown source blocks by delegating to [[https://orgmode.org/worg/org-contrib/babel/][org babel]]. I've had success with a handful of languages. In some instances, some babel headers may need overriding in =chatgpt-shell-babel-headers=. Here's a Swift execution via babel, showing standard output. #+ATTR_HTML: :width 70% [[file:images/chatgpt-shell-available-on-melpa/swift.gif]] In addition to standard output, =chatgpt-shell= can now render blocks generating images. Here's a rendered SwiftUI layout via [[https://github.com/xenodium/ob-swiftui][ob-swiftui]]. #+ATTR_HTML: :width 70% [[file:images/chatgpt-shell-available-on-melpa/swiftui.gif]] Can also do diagrams. Here's [[https://ditaa.sourceforge.net/][ditaa]] in action. #+ATTR_HTML: :width 70% [[file:images/chatgpt-shell-available-on-melpa/ditaa.gif]] ** Renaming blocks At times, ChatGPT may forget to label source blocks or maybe you just want to name it differently... You can now rename blocks at point. #+ATTR_HTML: :width 70% [[file:images/chatgpt-shell-available-on-melpa/rename.gif]] ** Send prompt/region There are a handful of commands to send prompts from other buffers, including the region. For example =chatgpt-shell-explain-code=. #+ATTR_HTML: :width 70% [[file:images/chatgpt-shell-available-on-melpa/explain-region.gif]] - chatgpt-shell-send-region - chatgpt-shell-generate-unit-test - chatgpt-shell-refactor-code - chatgpt-shell-proofread-doc - chatgpt-shell-eshell-summarize-last-command-output - chatgpt-shell-eshell-whats-wrong-with-last-command ** Saving/restoring transcript You can save your current session to a transcript and restore later. #+ATTR_HTML: :width 70% [[file:images/chatgpt-shell-available-on-melpa/restore.gif]] ** History improvements [[https://www.n16f.net/][Nicolas Martyanoff]] has a great post on [[https://www.n16f.net/blog/making-ielm-more-comfortable/][making IELM More Comfortable]]. A couple of improvements that stood out for me were: - Making the command history persistent. - Searching history with =shell-maker-search-history= / =M-r= via =completing-read=. =shell-maker-search-history=, coupled with your completion framework of choice, can be pretty handy. I happen to use Oleh Krehel's [[https://github.com/abo-abo/swiper][ivy]]. ** shell-maker (make your own AI shells) While ChatGPT is a popular service, there are many others sprouting. Some are cloud-based, others local, proprietary, open source... In any case, it'd be great be able to hook on to them without much overhead. [[https://xenodium.com/a-shell-maker/][shell-maker]] should help with that. The first =shell-maker= clients are =chatgpt-shell= and =dall-e-shell=. #+ATTR_HTML: :width 70% [[file:images/chatgpt-shell-available-on-melpa/dalle.png]] While I've built =dall-e-shell=, it'd be great to see what others can do with =shell-maker=. If you wire it up to anything, please get in touch ([[https://indieweb.social/@xenodium][Mastodon]] / [[https://twitter.com/xenodium][Twitter]] / [[https://www.reddit.com/user/xenodium][Reddit]] / [[mailto:me__AT__xenodium.com][Email]]). ** dall-e-shell, ob-chatgpt-shell, and ob-dall-e-shell (on MELPA too) UPDATE: [[https://indieweb.social/@xenodium/110087011082546281][dall-e-shell]], [[https://indieweb.social/@xenodium/110130580337078002][ob-chatgpt-shell]], and [[https://indieweb.social/@xenodium/110142796865197004][ob-dall-e-shell]] are now available on MELPA also. You've seen =dall-e-shell= in the previous section. Here's what =ob-chatgpt-shell= and =ob-dall-e-shell= look like in an [[https://orgmode.org/][org mode]] document: #+ATTR_HTML: :width 70% [[file:images/chatgpt-shell-available-on-melpa/babel.png]] ** How are you using =chatgpt-shell=? Whether you are an existing =chatgpt-shell= user, or would like to give things a try, [[https://melpa.org/#/chatgpt-shell][installing from MELPA]] should generally make things easier for ya. As I mentioned, =chatgpt-shell= is a young package still. There are unexplored Emacs integrations out there. I'd love to hear about whatever you come up with ([[https://indieweb.social/@xenodium][Mastodon]] / [[https://twitter.com/xenodium][Twitter]] / [[https://www.reddit.com/user/xenodium][Reddit]] / [[mailto:me__AT__xenodium.com][Email]]). * [2023-04-22 Sat] Recording and screenshotting windows: the lazy way :PROPERTIES: :CUSTOM_ID: recordscreenshot-windows-the-lazy-way :END: While there's no substitution for great written documentation, a quick demo can go a long way in conveying what a tool if capable of doing or what a tip/trick can achieve. If you've read a handful of my posts, you would have come across either a screenshot or a short clip with some demo. Historically, I've used the macOS's built-in utility invoked via =⌘ + Shift + 5=. It does a fine job for screenshots. For video captures, it's got a couple of small quirks. ** Record window Unlike screenshots, macOS video capture cannot record a specific window. While you can select a region, it's easy to inadvertently include a portion of your wallpaper in the recording. Not a big deal, but I felt posted screencasts could look as clean as their screenshot counterparts if we could record the window alone. Let's compare grabbing a region vs window alone. I know the clean look may be subjective, but see what I mean? #+CAPTION: Capture region (includes wallpaper/background) #+ATTR_HTML: :width 50% [[file:images/recordscreenshot-windows-the-lazy-way/record-bg.gif]] #+CAPTION: Capture window only (ahhh, so clean) #+ATTR_HTML: :width 50% [[file:images/recordscreenshot-windows-the-lazy-way/record.gif]] ** Cancel recording macOS has a handy shortcut (=⌘ + Ctrl + Esc=) to stop recording. If you got your demo right, you're done. If not, you have one more step remaining (right click to delete the blooper). #+ATTR_HTML: :width 40% [[file:images/recordscreenshot-windows-the-lazy-way/delete.png]] Also not a huge deal, but I was hoping for a single shortcut to stop recording _and_ also automatically discard. I haven't found one, but would love to hear if otherwise. ** macosrec enters the chat I wanted more flexibility to build my own recording/screenshotting flows. A command line utility could be quite versatile at that, so I built [[https://github.com/xenodium/macosrec][macosrec]]. =macosrec= enables taking a screenshot or recording a window video entirely from the command line. #+ATTR_HTML: :width 60% [[file:images/recordscreenshot-windows-the-lazy-way/macosrec.gif]] ** elisp glues the world Command line utilities can be invoked in all sorts of ways, but I'm an Emacs nutter so you can see where this is going... I want Emacs key bindings to control the lot. | C-c _ | Take screenshot of a window | | C-c ( | Start recording window | | C-c ) | Stop recording window | | C-c 8 | Abort recording | Integrating command line utilities into Emacs and making them quickly accessible seems to have become a full-time hobby of mine. I kid, but it's become a pretty painless process for me. I built [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] for that. If you've never heard of [[https://en.wikipedia.org/wiki/DWIM][DWIM]], it stands for "Do what I mean". To give you an idea of the kinds of things I'm using DWIM commands for, check the following out: - dwim-shell-commands-audio-to-mp3 - dwim-shell-commands-bin-plist-to-xml - dwim-shell-commands-clipboard-to-qr - dwim-shell-commands-drop-video-audio - dwim-shell-commands-files-combined-size - dwim-shell-commands-git-clone-clipboard-url - dwim-shell-commands-git-clone-clipboard-url-to-downloads - dwim-shell-commands-image-to-grayscale - dwim-shell-commands-image-to-icns - dwim-shell-commands-image-to-jpg - dwim-shell-commands-image-to-png - dwim-shell-commands-pdf-password-protect - dwim-shell-commands-reorient-image - dwim-shell-commands-resize-gif - dwim-shell-commands-resize-image - dwim-shell-commands-resize-video - dwim-shell-commands-speed-up-gif - dwim-shell-commands-speed-up-video - dwim-shell-commands-unzip - dwim-shell-commands-video-to-gif - dwim-shell-commands-video-to-optimized-gif - dwim-shell-commands-video-to-webp If it ever took you a little while to find the right command incantation to get things right, only to forget all about it next time you need it ([[https://xenodium.com/emacs-ffmpeg-and-macos-alias-commands][I'm looking at you ffmpeg]]), =dwim-shell-command= can help you easily save things for posterity and make them easily accessible in the future. Since we're talking ffmpeg, here's all it takes to have gif conversion handy: #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-video-to-gif () "Convert all marked videos to gif(s)." (interactive) (dwim-shell-command-on-marked-files "Convert to gif" "ffmpeg -loglevel quiet -stats -y -i '<>' -pix_fmt rgb24 -r 15 '<>.gif'" :utils "ffmpeg")) #+end_src There's no way I'll remember the ffmpeg command, but I can always fuzzy search my trusty commands with something like ="to gif"= and apply to either the current buffer file or any selected [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][dired]] files. #+ATTR_HTML: :width 60% [[file:images/recordscreenshot-windows-the-lazy-way/to-gif.png]] So where am I going with this? I wrote DWIM shell commands for the bindings I previously described: | C-c _ | =dwim-shell-commands-macos-screenshot-window= | | C-c ( | =dwim-shell-commands-macos-start-recording-window= | | C-c ) | =dwim-shell-commands-macos-end-recording-window= | | C-c 8 | =dwim-shell-commands-macos-abort-recording-window= | Out of all of commands, =dwim-shell-commands-macos-start-recording-window= is likely the most interesting one. #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-macos-start-recording-window () "Select and start recording a macOS window." (interactive) (let* ((window (dwim-shell-commands--macos-select-window)) (path (dwim-shell-commands--generate-path "~/Desktop" (car window) ".mov")) (buffer-file-name path) ;; override so <> picks it up (inhibit-message t)) (dwim-shell-command-on-marked-files "Start recording a macOS window." (format "# record .mov macosrec --record '%s' --mov --output '<>' # speed .mov up x1.5 ffmpeg -i '<>' -an -filter:v 'setpts=1.5*PTS' '<>_x1.5.<>' # convert to gif x1.5 ffmpeg -loglevel quiet -stats -y -i '<>_x1.5.<>' -pix_fmt rgb24 -r 15 '<>_x1.5.gif' # speed .mov up x2 ffmpeg -i '<>' -an -filter:v 'setpts=2*PTS' '<>_x2.<>' # convert to gif x2 ffmpeg -loglevel quiet -stats -y -i '<>_x2.<>' -pix_fmt rgb24 -r 15 '<>_x2.gif'" (cdr window)) :silent-success t :monitor-directory "~/Desktop" :no-progress t :utils '("ffmpeg" "macosrec")))) #+end_src As you likely expect, this command invokes =macosrec= to start recording a window. The nifty part is that when it's done recording (and saving the .mov file), it automatically creates multiple variants. For starters, it creates x1.5 and x2 .mov videos, but it also generates their .gif counterparts. #+ATTR_HTML: :width 60% [[file:images/recordscreenshot-windows-the-lazy-way/bunch.png]] Let's recap here for a sec. You start recording a window video with =C-c (=, end with =C-c )=, and automagically have all these generated files waiting for you. You can subsequently inspect any of the video candidates and pick the most appropriate variant. Discard whatever else you don't need. The output bundle is tailored to my needs. Maybe you want to invoke [[https://www.lcdf.org/gifsicle/][gifsycle]] for more optimized versions? Or maybe you want automatic webp generation via =ffmpeg=? DWIM does that I mean, so you likely have other plans... =dwim-shell-commands-macos-start-recording-window= and all other DWIM commands are now included in [[https://github.com/xenodium/dwim-shell-command/blob/main/dwim-shell-commands.el][dwim-shell-commands.el]], which ships optionally as part of [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]]. [[https://github.com/xenodium/macosrec][macosrec]] is also on GitHub, but if you want to be on your way, you can install via: #+begin_src sh brew tap xenodium/macosrec brew install macosrec #+end_src This is my way to record and screenshot windows the lazy way. How would you tweak to make it yours? * [2023-04-20 Thu] ob-swiftui updates :PROPERTIES: :CUSTOM_ID: ob-swiftui-updates :END: While [[https://indieweb.social/@xenodium/110227186721704189][experimenting with delegating Markdown]] blocks to [[https://orgmode.org/worg/org-contrib/babel/][Org babel]] in Emacs [[https://github.com/xenodium/chatgpt-shell][chatgpt-shell]], I resurrected [[https://github.com/xenodium/ob-swiftui][ob-swiftui]]. A package I had written to execute and render SwiftUI blocks in org babel. [[https://github.com/xenodium/ob-swiftui][ob-swiftui]] has two modes of rendering SwiftUI blocks: =:results window=, which runs outside of Emacs in a native window and =:results file=, which renders and saves to a file. The latter can be viewed directly from Emacs. =:results file= was a little clunky. That is, it hardcoded dimensions I had to manually modify if the canvas wasn't big enough. It was also a little slow. The clunkyness really came through with my chatgpt-shell experiments, so I took a closer look and made a few changes to remove hardcoding and speeds things up. The results ain't too shabby. #+ATTR_HTML: :width 80% [[file:images/ob-swiftui-updates/file-render.gif]] Another tiny improvement is that if you'd like to compose a more complex layout made of multiple custom views, =ob-swiftui= now looks for a =ContentView= as that root view by default. Specifying another root view was already possible but it had to be explicitly requested via =:view= param. You can now omit the =:view= param if you name the root view =ContentView=: #+begin_src org ,#+begin_src swiftui struct ContentView: View { var body: some View { TopView() BottomView() } } struct TopView: View { var body: some View { Text("Top text") } } struct BottomView: View { var body: some View { Text("Bottom text") } } ,#+end_src #+end_src The improvements have been pushed to [[https://github.com/xenodium/ob-swiftui][ob-swiftui]] and will soon be picked up on [[https://melpa.org/#/ob-swiftui][melpa]]. Edit: Added ContentView details. * [2023-04-15 Sat] My Emacs eye candy :PROPERTIES: :CUSTOM_ID: my-emacs-eye-candy :END: I get the occasional question about my Emacs theme, font, and other eye candy. I'm always tickled and happy to share. #+ATTR_HTML: :width 80% [[file:images/my-emacs-eye-candy/Emacs.png]] It's been a while since I've made visually significant changes to my Emacs config. May as well briefly document for posterity... ** Nyan Mode First things first. The adorable and colorful little fella in my mode line is a [[https://en.wikipedia.org/wiki/Nyan_Cat][Nyan Cat]] (if you dare, check the [[https://www.youtube.com/watch?v=QH2-TGUlwu4][meme video]]). Yes, I know it's sooo 2011, but it's 2023 and I still love the little guy hanging out in my Emacs mode line. I still get asked about it. #+ATTR_HTML: :height 30px [[file:images/my-emacs-eye-candy/Nyan.png]] This fabulous feature comes to us via the great [[https://github.com/TeMPOraL/nyan-mode/][Nyan Mode]] package. If looks haven't convinced you, Nyan also packs scrolling functionality. Click anywhere in it. Oh, and if you can't get enough of Nyan, there's also [[https://depp.brause.cc/zone-nyan/][zone-nyan]] for Emacs. ** Emacs Plus (macOS) I should mention I'm running Emacs 28 on macOS via the excellent [[https://github.com/d12frosted/homebrew-emacs-plus][Emacs Plus]] [[https://brew.sh/][homebrew]] recipe. These are all the options I enable. #+begin_src sh brew install emacs-plus@28 --with-imagemagick --with-no-frame-refocus --with-native-comp --with-savchenkovaleriy-big-sur-icon #+end_src *** Icon Since we're talking eye candy, let's chat about =--with-savchenkovaleriy-big-sur-icon=. This Emacs Plus option enables Valeriy Savchenko's [[https://github.com/SavchenkoValeriy/emacs-icons][wonderful icon]]. #+ATTR_HTML: :width 50% [[file:images/my-emacs-eye-candy/swap.png]] *** Titlebar I've enabled both transparent title bar as well as dark appearance, giving a minimal window decoration. #+ATTR_HTML: :width 60% [[file:images/my-emacs-eye-candy/decoration.jpg]] #+begin_src emacs-lisp :lexical no (add-to-list 'default-frame-alist '(ns-transparent-titlebar . t)) (add-to-list 'default-frame-alist '(ns-appearance . dark)) #+end_src Note: both of these variables are prefixed =ns-= (macOS-only settings). ** Font (JetBrains Mono) I've been on [[https://www.jetbrains.com/lp/mono/][JetBrains Mono]] font for quite some time now. In the past, I've also been a fan of [[https://madmalik.github.io/mononoki/][Mononoki]] and [[https://en.wikipedia.org/wiki/Menlo_(typeface)][Menlo]] (on macOS) or [[https://github.com/andreberg/Meslo-Font][Meslo]] (similar elsewhere). ** Theme (Material) I'm using the great [[https://github.com/cpaulik/emacs-material-theme][Material Theme for Emacs]], with a [[https://github.com/xenodium/dotsies/blob/790465b1824481b81bf5c6e08949128c13d76f95/emacs/features/fe-ui.el#L42][bunch of tweaks of my own]]. ** Modeline tabs/ribbons (Moody) The [[https://github.com/tarsius/moody][moody]] package adds a nice touch displaying mode line elements as tabs and ribbons. ** Modeline menus (Minions) The [[https://github.com/tarsius/minions][minions]] package removes lots of minor mode clutter from the mode line and stashes it away in menus. ** Hiding modeline (hide mode line mode) Hiding the mode line isn't something I use in most major modes. However, I found it complements my shell ([[https://www.masteringemacs.org/article/complete-guide-mastering-eshell][eshell]]) quite well. While I was sceptical at first, once I hid the mode line in my shell I never looked back. I just didn't miss it. I also love the uncluttered clean vibe. [[https://github.com/hlissner/emacs-hide-mode-line][hide-mode-line-mode]] can help with that. #+ATTR_HTML: :width 50% [[file:images/my-emacs-eye-candy/eshell.gif]] ** Welcome screen Back in October 2022, I experimented with [[https://xenodium.com/emacs-a-welcoming-experiment/][adding a minimal welcome screen]]. I was initially hesitant, as I was already a fan of the welcome scratch buffer. In any case, I figured I'd eventually get tired of it and remove it. Well, it's enabled in my config still ;) My initial attachment to a landing scratch quickly faded. I'm only a =C-x b= binding away from invoking ivy-switch-buffer to get me anywhere. #+ATTR_HTML: :width 80% [[file:images/my-emacs-eye-candy/welcome.png]] The great Emacs logo originally [[https://www.reddit.com/r/unixporn/comments/yamj5f/exwm_emacs_is_kinda_comfy_as_a_wm/][shared by u/pearcidar43]]. ** Zones I've been meaning to re-enable [[https://github.com/emacs-mirror/emacs/blob/master/lisp/play/zone.el][zones]] in my config. They always gave me a good tickle. I've already mentioned [[https://depp.brause.cc/zone-nyan/][zone-nyan]], but if you're new to zones, they kick off after a period of inactivity (similar to a screensaver). Here's =zone-pgm-rotate= in all its glory. Oh and it's built-in! #+ATTR_HTML: :width 80% [[file:images/my-emacs-eye-candy/rotate.webp]] Coincidentally, I had a go at writing [[https://xenodium.com/emacs-zones-to-lift-you-up/][a basic zone a little while ago]]. #+ATTR_HTML: :width 80% [[file:images/my-emacs-eye-candy/zone.gif]] ** Config Most of the items mentioned I pulled from my [[https://github.com/xenodium/dotsies][Emacs config]]'s [[https://github.com/xenodium/dotsies/blob/main/emacs/features/fe-ui.el][fe-ui.el]]. There's more there if you're interested. What is some of your favorite Emacs eye candy? [[https://www.reddit.com/r/emacs/comments/12nbb9x/my_emacs_eye_candy/][reddit]] / [[https://indieweb.social/@xenodium/110204024063552954][mastodon]] / [[https://twitter.com/xenodium/status/1647293089394900993][twitter]]. * [2023-04-08 Sat] shell-maker, a maker of Emacs shells :PROPERTIES: :CUSTOM_ID: a-shell-maker :END: A few weeks ago, I wrote about an experiment to bring [[https://xenodium.com/a-chatgpt-emacs-shell/][ChatGPT to Emacs as a shell]]. I was fairly new to both [[https://openai.com/blog/chatgpt][ChatGPT]] and building anything on top of [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Shell-Prompts.html][comint]]. It was a fun exercise, which also generated some interest. As mentioned in the previous post, I took inspiration in other Emacs packages (primarily [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Interaction.html][ielm]]) to figure out what I needed from comint. Soon, I got ChatGPT working. #+ATTR_HTML: :width 80% [[file:images/a-shell-maker/streamer.gif]] As I was looking at [[https://openai.com][OpenAI]] API docs, I learned about DALL-E: "an AI system that can create realistic images and art from a description in natural language." Like ChatGPT, they also offered an API to DALL-E, so I figured I may as well try to write a shell for that too... and I did. #+ATTR_HTML: :width 60% [[file:images/a-shell-maker/dalle.gif]] There was quite a bit of code duplication between the two Emacs shells I had just written. At the same time, I started hearing from folks about integrating other tools, some cloud-based, some local, proprietary, open source.. There's [[https://about.sourcegraph.com/cody][Cody]], [[https://github.com/invoke-ai/InvokeAI][invoke-ai]], [[https://github.com/ggerganov/llama.cpp][llama.cpp]], [[https://github.com/antimatter15/alpaca.cpp][alpaca.cpp]], and the list continues to grow. With that in mind, I set out to reduce the code duplication and consolidate into a reusable package. And so =shell-maker= was born, a maker of Emacs shells. =shell-maker='s internals aren't too different from the code I had before. It's still powered by comint, but instead offers a reusable convenience wrapper. It takes little code to implement a shell, like the sophisticated new =greeter-shell= ;) #+ATTR_HTML: :width 60% [[file:images/a-shell-maker/maria.gif]] #+begin_src emacs-lisp (require 'shell-maker) (defvar greeter-shell--config (make-shell-maker-config :name "Greeter" :execute-command (lambda (command _history callback error-callback) (funcall callback (format "Hello \"%s\"" command) nil)))) (defun greeter-shell () "Start a Greeter shell." (interactive) (shell-maker-start greeter-shell--config)) #+end_src [[https://github.com/xenodium/chatgpt-shell#shell-maker][shell-maker]] is available on GitHub and currently bundled with [[https://github.com/xenodium/chatgpt-shell][chatgpt-shell]]. If there's enough interest and usage, I may just break it out into its own package. For now, it's convenient to keep with =chatgpt-shell= and =dall-e-shell=. If you plug =shell-maker= into other tools, I'd love to hear about it. Happy shell making! * [2023-04-06 Thu] Flat Habits 1.1.4 released :PROPERTIES: :CUSTOM_ID: flat-habits-114-released :END: [[https://flathabits.com/][Flat Habits]] 1.1.4 is now available on the [[https://apps.apple.com/app/id1558358855][App Store]]. Flat Habits is a habit tracker that’s mindful of your time, data, and privacy. It's a simple but effective iOS app. #+BEGIN_EXPORT html
today_no_filter.png

download-on-app-store.png
#+END_EXPORT If you care about how your data is stored, Flat Habits is powered by [[https://orgmode.org][org]] plain text markup without any cloud component. You can use your [[https://xenodium.com/frictionless-org-habits-on-ios/][favorite editor]] (Emacs, Vim, VSCode, etc.) to poke at habit data, if that's your cup of tea. ** What's new? - Quicker toggling, now exposing Done/Skip. - Double tap marks Done. - Also display in 12 hour time format. - Overdue habits are now labelled "past" and coloured orange. - Don't dismiss creation dialog if tapping outside. - Set #+STARTUP: nologdrawer in new files. ** Are you a fan? Is Flat Habits helping you keep up with your habits? Please [[https://apps.apple.com/app/id1558358855?action=write-review][rate/review]] 😊 * [2023-03-21 Tue] A ChatGPT Emacs shell :PROPERTIES: :CUSTOM_ID: a-chatgpt-emacs-shell :END: UPDATE: =chatgpt-shell= [[https://xenodium.com/chatgpt-shell-available-on-melpa/][has evolved a bit]] and is now [[https://melpa.org/#/chatgpt-shell][on MELPA]]. I had been meaning to give [[https://openai.com/blog/chatgpt][ChatGPT]] a good try, preferably from Emacs. As an [[https://www.gnu.org/software/emacs/manual/html_mono/eshell.html][eshell]] fan, ChatGPT seemed like the perfect fit for a shell interface of sorts. With that in mind, I set out to wire ChatGPT with Emacs's general command interpreter ([[https://www.gnu.org/software/emacs/manual/html_node/emacs/Shell-Prompts.html][comint]]). I had no previous experience building anything comint-related, so I figured I could just take a peek at an existing comint-derived mode to achieve a similar purpose. =inferior-emacs-lisp-mode= ([[https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Interaction.html][ielm]]) seemed to fit the bill just fine, so I borrowed quite a bit to assemble a basic shell experience. From then on, it was mostly about sending each request over to the ChatGPT API to get a response. For now, I'm relying on [[https://curl.se/docs/manpage.html][curl]] to make each request. The invocation is fairly straightforward: #+begin_src sh curl "https://api.openai.com/v1/chat/completions" \ -H "Authorization: Bearer YOUR_OPENAI_KEY" \ -H "Content-Type: application/json" \ -d "{ \"model\": \"gpt-3.5-turbo\", \"messages\": [{\"role\": \"user\", \"content\": \"YOUR PROMPT\"}] }" #+end_src There are two bits of information needed in each request. The API key, which you must get from [[https://openai.com/][OpenAI]], and the prompt text itself (i.e. whatever you want ChatGPT to help you with). The results are not too shabby. #+ATTR_HTML: :width 80% [[file:images/a-chatgpt-emacs-shell/chatgpt.gif]] I've uploaded the code to GitHub as a tiny [[https://github.com/xenodium/chatgpt-shell][chatgpt-shell]] package. It's a little experimental and rough still, but hey, it does the job for now. Head over to [[https://github.com/xenodium/chatgpt-shell][github]] to take a look. The latest iteration handles multiline prompts (use C-j for newlines) and basic code highlighting. Let's see where it all goes. Pull requests for improvements totally welcome ;-) * [2023-03-04 Sat] =*scratch*= a new minimal org mode scratch area for iOS :PROPERTIES: :CUSTOM_ID: scratch-a-minimal-scratch-area :END: While we already have lots of note-taking apps on iOS, I wanted a minimal =*scratch*= area (à la Emacs), so I built one. #+BEGIN_EXPORT html
*scratch* icon
#+END_EXPORT What's the use-case? You're on the go. Someone's telling you directions, or a phone number, name of a restaurant, anything really... you just need to write it down /right now, quickly/! No time to create a new contact, a note, a file, or spend time on additional taps, bring up keyboard... You just want to write it somewhere with the least amount of friction. #+ATTR_HTML: :width 50% [[file:images/scratch-a-minimal-scratch-area/scratch-download_no_audio_x2.6.webp]] Being an Emacs and org user, I had to sprinkle the app with basic markup support for headings, lists and checkboxes. Also, having a =*scratch*= "buffer" on my iPhone gives me that warm emacsy fuzzy feeling :) You can download =*scratch*= from the [[https://apps.apple.com/gb/app/scratch/id1671420139][App Store]]. Find it useful? Please help me spread the word. Tell your friends. #+BEGIN_EXPORT html

download-on-app-store.png
#+END_EXPORT * [2023-01-29 Sun] Chicken Karaage recipe :PROPERTIES: :CUSTOM_ID: chicken-karaage-recipe :END: Huge fan of Chicken Karaage, but never really made it at home until recently. #+ATTR_HTML: :width 60% [[file:images/chicken-karaage-recipe/frying.jpg]] #+ATTR_HTML: :width 60% [[file:images/chicken-karaage-recipe/fried.jpg]] #+ATTR_HTML: :width 60% [[file:images/chicken-karaage-recipe/dipping.jpg]] #+ATTR_HTML: :width 60% [[file:images/chicken-karaage-recipe/sauces.jpg]] ** Dice the chicken - 350 grams boneless chicken thighs Dice the chicken up. ** Marinade for 30 mins - 1 tablespoon soy sauce (Kikkoman or similar) - 1 tablespoon cooking Sake - 2 tablespoons of grated ginger (include liquids) - 1/2 teaspoon Mirin Mix all ingredients into a ziploc bag. Add the diced chicken and let it marinade for 30 minutes in the fridge. ** Pat dry - Paper towels After marinating, pat the chicken dry with paper towels and set aside. ** Breading - Potato starch Ok, not quite breading since we're using potato starch but same goal. Sprinkle the chicken pieces and make sure they are fully coated with the starch. ** Frying (1st round) - Vegetable oil - Paper towels Heat up (roughly at 160°C) enough oil in a pan to cover the chicken pieces. Cook for about 3 minutes. The pieces don't have to be super golden at this point. There will be another round of frying for that. ** Rest for 4 minutes - Paper towels Let the chicken rest on paper towels for about 4 minutes before frying again. ** Frying (2nd round) - Vegetable oil - Paper towels This time heat up the oil at roughly 200°C. This is a quick in-and-out action to make the chicken crispy. Cook for 30 seconds. Take out and set aside on some paper towels. Let it cool and it's ready to eat. ** Dipping - Kewpie mayo - Sriracha sauce This is totally optional, but I'm a fan of both Kewpie mayo and Sriracha sauce. You can dip your chicken in either or both! * [2023-01-10 Tue] Emacs: org-present in style :PROPERTIES: :CUSTOM_ID: emacs-org-present-in-style :END: I had been meaning to check out David Wilson's [[https://systemcrafters.cc][System Crafters]] post detailing [[https://systemcrafters.net/emacs-tips/presentations-with-org-present/][his presentations style]] achieved with the help of [[https://github.com/rlister/org-present][org-present]] and his own customizations. If you're looking for ways to present from Emacs itself, David's post is well worth a look. org-present's spartan but effective approach resonated with me. David's touches bring the wonderfully stylish icing to the cake. I personally liked his practice of collapsing slide subheadings by default. This lead me to think about slide navigation in general... There were two things I wanted to achieve: 1. Easily jump between areas of interest. Subheadings, links, and code blocks would be a good start. 2. Collapse all but the current top-level heading within the slide, as navigation focus changes. A quick search for existing functions led me to =org-next-visible-heading=, =org-next-link=, and =org-next-block=. While these make it easy to jump through jump between headings, links, org block on their own, I wanted to jump to whichever one of these is next (similar a web browser's tab behaviour). In a way, [[https://en.wikipedia.org/wiki/DWIM][DWIM]] style. I wrapped the existing functions to enable returning positions. This gave me =ar/rg-next-visible-heading-pos=, =ar/rg-next-link-pos=, and =ar/rg-next-block-pos= respectively. Now that I can find out the next location of either of these items, I can subsequently glue the navigation logic in a function like =ar/org-present-next-item=. To restore balance to the galaxy, I also added =ar/org-present-previous-item=. #+begin_src emacs-lisp :lexical no (defun ar/org-present-next-item (&optional backward) "Present and reveal next item." (interactive "P") ;; Beginning of slide, go to previous slide. (if (and backward (eq (point) (point-min))) (org-present-prev) (let* ((heading-pos (ar/org-next-visible-heading-pos backward)) (link-pos (ar/org-next-link-pos backward)) (block-pos (ar/org-next-block-pos backward)) (closest-pos (when (or heading-pos link-pos block-pos) (apply (if backward #'max #'min) (seq-filter #'identity (list heading-pos link-pos block-pos)))))) (if closest-pos (progn (cond ((eq heading-pos closest-pos) (goto-char heading-pos)) ((eq link-pos closest-pos) (goto-char link-pos)) ((eq block-pos closest-pos) (goto-char block-pos))) ;; Reveal relevant content. (cond ((> (org-current-level) 1) (ar/org-present-reveal-level2)) ((eq (org-current-level) 1) ;; At level 1. Collapse children. (org-overview) (org-show-entry) (org-show-children) (run-hook-with-args 'org-cycle-hook 'children)))) ;; End of slide, go to next slide. (org-present-next))))) (defun ar/org-present-previous-item () (interactive) (ar/org-present-next-item t)) (defun ar/org-next-visible-heading-pos (&optional backward) "Similar to `org-next-visible-heading' but for returning position. Set BACKWARD to search backwards." (save-excursion (let ((pos-before (point)) (pos-after (progn (org-next-visible-heading (if backward -1 1)) (point)))) (when (and pos-after (not (equal pos-before pos-after))) pos-after)))) (defun ar/org-next-link-pos (&optional backward) "Similar to `org-next-visible-heading' but for returning position. Set BACKWARD to search backwards." (save-excursion (let* ((inhibit-message t) (pos-before (point)) (pos-after (progn (org-next-link backward) (point)))) (when (and pos-after (or (and backward (> pos-before pos-after)) (and (not backward) (> pos-after pos-before)))) pos-after)))) (defun ar/org-next-block-pos (&optional backward) "Similar to `org-next-block' but for returning position. Set BACKWARD to search backwards." (save-excursion (when (and backward (org-babel-where-is-src-block-head)) (org-babel-goto-src-block-head)) (let ((pos-before (point)) (pos-after (ignore-errors (org-next-block 1 backward) (point)))) (when (and pos-after (not (equal pos-before pos-after))) ;; Place point inside block body. (goto-char (line-beginning-position 2)) (point))))) (defun ar/org-present-reveal-level2 () (interactive) (let ((loc (point)) (level (org-current-level)) (heading)) (ignore-errors (org-back-to-heading t)) (while (or (not level) (> level 2)) (setq level (org-up-heading-safe))) (setq heading (point)) (goto-char (point-min)) (org-overview) (org-show-entry) (org-show-children) (run-hook-with-args 'org-cycle-hook 'children) (goto-char heading) (org-show-subtree) (goto-char loc))) #+end_src Beware, this was a minimal effort (with redundant code, duplication, etc) and should likely be considered a proof of concept of sorts, but the results look promising. You can see a demo in action. #+ATTR_HTML: :width 80% :height 80% [[file:images/emacs-org-present-in-style/org-navigate_x1.6.webp]] While this was a fun exercise, I can't help but think there must be a cleaner way of doing it or there are existing packages that already do this for you. If you do know, I'd love to know. Future versions of this code will likely be updated in [[https://github.com/xenodium/dotsies/blob/main/emacs/features/fe-org.el][my Emacs org config]]. ** Update Removed a bunch of duplication and now rely primarily on existing =org-next-visible-heading=, =org-next-link=, and =org-next-block=. * [2023-01-08 Sun] Emacs: insert and render SF symbols :PROPERTIES: :CUSTOM_ID: emacs-insert-and-render-sf-symbols :END: About a week ago, I added an Emacs [[https://xenodium.com/emacs-macro-me-some-sf-symbols/][function to insert SF symbol names]]. This is specially useful for SwiftUI. I didn't bother too much with inserting symbols themselves since I hadn't figured out a way to render them for all buffers. That's now changed. Christian Tietze and Alan Third both have useful posts in this space: - [[http://idiocy.org/emacs-fonts-and-fontsets.html][Emacs, fonts and fontsets]] - [[https://christiantietze.de/posts/2023/01/use-sf-pro-for-sf-symbols-everywhere-in-emacs/][Use San Francisco Font for SF Symbols Everywhere in Emacs]] I'm currently using the following to render SF symbols in all buffers (macOS only): #+begin_src emacs-lisp :lexical no ;; Enable rendering SF symbols on macOS. (when (memq system-type '(darwin)) (set-fontset-font t nil "SF Pro Display" nil 'append)) #+end_src Now that I can render SF symbols everywhere, I /may/ be more included to use them to spif things up. I've added =sf-symbol-insert= to [[https://github.com/xenodium/dotsies/blob/main/emacs/ar/sf.el][sf.el]], let's see if usage sticks. #+ATTR_HTML: :width 80% :height 80% [[file:images/emacs-insert-and-render-sf-symbols/sf-insert-trimmed_x1.8.webp]] * [2022-12-31 Sat] Emacs: Macro me some SF Symbols :PROPERTIES: :CUSTOM_ID: emacs-macro-me-some-sf-symbols :END: For inserting SF Symbols in SwiftUI, I typically rely on Apple's [[https://developer.apple.com/sf-symbols/][SF Symbols app]] to browse the symbols's catalog. Once I find a symbol I'm happy with, I copy its name and paste it into my Swift source. This works fairly well. With Christian Tietze recently posting [[https://christiantietze.de/posts/2022/12/sf-symbols-emacs-tab-numbers/][how he rendered SF Symbols in Emacs]], I figured there may be a way to shift the above workflow to rely on Emacs completion instead. While I initially went down a rabbit hole to programmatically extract SF symbols (via something like [[https://github.com/SFSafeSymbols/SFSafeSymbols][SFSafeSymbols]]), I took a step back to rethink the strategy. From the [[https://developer.apple.com/sf-symbols/][SF Symbols app]], one can select multiple symbols and copy/paste either the symbols themselves or their respective names. The catch is you can only copy disjointed data. That is, you can copy the symbols or their names, but not both in one go. Let's take a look at what the disjointed data looks like. I've pasted both under separate sections in an Emacs buffer. #+ATTR_HTML: :width 60% :height 60% [[file:images/emacs-macro-me-some-sf-symbols/disjointed.png]] If I could rejoin these two sets, I would have a lookup table I could easily invoke from Emacs. There are roughly 4500 symbols, so copying, pasting, along with text manipulation isn't manually feasible. Lucky for us, an Emacs [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Keyboard-Macros.html][keyboard macro]] is the perfect hammer for this nail. You can see the macro in action below. #+ATTR_HTML: :width 60% :height 60% [[file:images/emacs-macro-me-some-sf-symbols/mini-macro_x1.6.webp]] This looks fairly magical (and it is), but when you break it down into its building blocks, it's nothing more than recording your keystrokes and replaying them. Starting with the cursor at the beginning of =square.and.arrow.up=, these are the keystrokes we'd need to record: - C-s :: [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Basic-Isearch.html][iseach-forward]] to search for a character and jump to it - = :: insert === so we jump to == Symbols == - :: runs [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Basic-Isearch.html][isearch-exit]] since we're done jumping. - C-n :: =next-line=. - C-a :: =beginning-of-line=. - C-SPC :: =set-mark-command= to activate the region. - C-f :: =forward-char= to select symbol. - C-w :: =kill-ring-save= to cut/kill the symbol. - C-u C- :: =set-mark-command= (with prefix) to jump back to where we started before searching. - C-y :: =yank= to yank/paste the symbol. - C- :: =set-mark-command= to activate the region. - C-e :: =end-of-line= to select the entire line. - " :: As a [[https://github.com/Fuco1/smartparens][smartparens]] user, inserting quote with region places quotes around selection. - C-n :: =next-line=. - C-a :: =beginning-of-line=. We are now at a strategic location where we can replay the above commands. To start/end recording and executing keyboard macros, use: - C-x ( :: [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Basic-Keyboard-Macro.html][kmacro-start-macro]] - C-x ) :: [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Basic-Keyboard-Macro.html][kmacro-end-macro]] - C-x e :: [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Basic-Keyboard-Macro.html][kmacro-end-and-call-macro]] runs your macro. Press =e= immediately after to execute again. - C-u 0 C-x e :: [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Basic-Keyboard-Macro.html][kmacro-end-and-call-macro]] (with zero prefix) repeat until there is an error. Our previous example ran on a handful of SF symbols. Let's bring out the big guns and run on the entire dataset. This time, we'll run the entire flow, including macro creation and executing until there is an error (i.e. process the whole lot). #+ATTR_HTML: :width 90% :height 90% [[file:images/emacs-macro-me-some-sf-symbols/sf-symbol-no-mouse-short_x1.4.webp]] Now that we have our data joined, we can feed it to the humble [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Completion.html][completing-read]]. #+ATTR_HTML: :width 60% :height 60% [[file:images/emacs-macro-me-some-sf-symbols/sf-symbols-insert-name.png]] It's worth highlighting that to render SF Symbols in Emacs, we must [[https://christiantietze.de/posts/2022/12/sf-symbols-emacs-tab-numbers/][propertize our text with one of the macOS SF fonts]], for example "SF Pro". With all the pieces in place, let's use our new function to insert SF symbol names in a SwiftUI snippet. Since we're using =completing-read= we can fuzzy search our lookups with our favorite completion frameworks (in my case via [[https://github.com/abo-abo/swiper][ivy]]). #+ATTR_HTML: :width 90% :height 90% [[file:images/emacs-macro-me-some-sf-symbols/sf-search_x1.2.webp]] While this post is macOS-specific, it gives a taste of how powerful Emacs [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Keyboard-Macros.html][keyboard macros]] can be. Be sure to check out [[https://emacsrocks.com/e05.html][Emacs Rocks! Episode 05: Macros in style]] and [[https://www.masteringemacs.org/article/keyboard-macros-are-misunderstood][Keyboard Macros are Misunderstood - Mastering Emacs]]. For those that dabble in elisp, you can appreciate how handy [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Completion.html][completing-read]] is with very little code. The full source to [[https://github.com/xenodium/dotsies/blob/main/emacs/ar/sf.el][sf-symbol-insert-name]] is available in my [[https://github.com/xenodium/dotsies/][Emacs config repo]]. The function is fairly bare bones and has had fairly little testing. Patches totally welcome. ** Update There is some redundancy in the snippet I had forgotten to remove. Either way, latest version at [[https://github.com/xenodium/dotsies/blob/main/emacs/ar/sf.el][sf.el]]. * [2022-12-18 Sun] Emacs: ffmpeg and macOS aliasing commands :PROPERTIES: :CUSTOM_ID: emacs-ffmpeg-and-macos-alias-commands :END: On a recent mastodon [[https://twit.social/@chris_spackman/109531700714365786][post]], Chris Spackman mentioned he uses Emacs to save [[https://ffmpeg.org/][ffmpeg]] commands he's figured out for later usage. Emacs is great for this kind of thing. I've tried different approaches over time and eventually landed on [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]], a small package I wrote. Like Chris, I also wanted a way to invoke magical incantations of known shell commands without having to remember all the details. Chris's post reminded me of a few use-cases I'd been meaning to add DWIM shell commands for. *** ffmpeg 1. Trimming seconds from videos - =dwim-shell-commands-video-trim-beginning= using: #+begin_src sh ffmpeg -i '<>' -y -ss <> -c:v copy -c:a copy '<>_trimmed.<>' #+end_src - =dwim-shell-commands-video-trim-end= using: #+begin_src sh ffmpeg -sseof -<> -i '<>' -y -c:v copy -c:a copy '<>_trimmed.<>' #+end_src Side-node: The =<>= placeholder is recognized as a query, so Emacs will prompt you for a numeric value. 2. Extracting audio from videos - =dwim-shell-commands-video-to-mp3= using: #+begin_src sh ffmpeg -i '<>' -vn -ab 128k -ar 44100 -y '<>.mp3' #+end_src With these new dwim shell commands added, I can easily apply them one after the other. No need to remember command details. #+ATTR_HTML: :width 60% :height 60% [[file:images/emacs-ffmpeg-and-macos-alias-commands/trim_convert_mp3_x1.4.webp]] *** macOS aliases After rebuilding Emacs via the wonderful [[https://github.com/d12frosted/homebrew-emacs-plus][emacs-plus]], I recently broke my existing =/Applications/Emacs.app= alias. No biggie, one can easily add a [[https://support.apple.com/en-gb/guide/mac-help/mchlp1046/mac][new one alias from macOS Finder]], but I've been wanting to do it from Emacs. Turns out there's a bit of AppleScript we can turn into a more memorale command like =dwim-shell-commands-macos-make-finder-alias=: #+begin_src sh osascript -e 'tell application \"Finder\" to make alias file to POSIX file \"<>\" at POSIX file \"%s\"' #+end_src It's highly unlikely I'll remember the AppleScript snippet (are there better ways?), but I'll easily find and invoke my new command with fuzzy searching: #+ATTR_HTML: :width 80% :height 80% [[file:images/emacs-ffmpeg-and-macos-alias-commands/make-emacs-alias_x1.4.webp]] *** Included in dwim-shell-command All of these are now included in [[https://github.com/xenodium/dwim-shell-command/blob/main/dwim-shell-commands.el][dwim-shell-commands.el]], which you can optionally load after installing [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] from [[https://melpa.org/#/dwim-shell-command][MELPA]]. * [2022-12-12 Mon] Emacs: Context-aware yasnippets :PROPERTIES: :CUSTOM_ID: emacs-generate-a-swift-initializer :END: Back in 2020, I wrote a semi-automatic [[https://github.com/joaotavora/yasnippet][yasnippet]] to [[https://xenodium.com/smarter-snippets/][generate Swift initializers]]. I say semi-automatic because it could have been a little smarter. While it helped generate some of the code, what I really wanted was full context-aware generation. The Swift struct already had a few properties defined, so a smarter yasnippet should have been able to use this info for code generation. #+ATTR_HTML: :width 60% :height 60% [[file:images/smarter-snippets/snippet.gif]] With an extra push, we could have written a smarter yasnippet, but it may require a fair bit of parsing logic. Fast forward to today, and bringing context-awareness seems like the right match for [[https://tree-sitter.github.io/tree-sitter/][Tree-sitter]]. While Tree-sitter can enable faster and more reliable syntax-highlighting in our beloved text editor, it can also power smarter tools. It does so by exposing a semantic snapshot of our source code using a syntax tree. Let's see how we can use Tree-sitter to realise our original yasnippet vision. We'll start with the same struct snippet we used back in 2020. The goal is to generate an initializer using the existing definitions. #+begin_src swift struct Coordinate { public let x: Int public let y: Int public let z: Int } #+end_src While Emacs will [[https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg01443.html][will soon ship its own Tree-sitter integration]], I've opted to try out the [[https://github.com/emacs-tree-sitter/elisp-tree-sitter][emacs-tree-sitter]] package as Swift support is currently included in [[https://github.com/emacs-tree-sitter/tree-sitter-langs][tree-sitter-langs]]. I have much to learn much about Tree-sitter syntax trees, but the package ships with a handy tool to dump the tree via =tree-sitter-debug-mode=. #+ATTR_HTML: :width 90% :height 90% [[file:images/emacs-generate-a-swift-initializer/syntax-tree.png]] With a syntax tree in mind, one can craft a query to semantically extract parts of the code. In our case, we want property names and types. I've yet to get acquainted with Tree-sitter's [[https://tree-sitter.github.io/tree-sitter/using-parsers#query-syntax][query syntax]], but the package also ships with another handy tool that helps view query results via =tree-sitter-query-builder=. #+ATTR_HTML: :width 90% :height 90% [[file:images/emacs-generate-a-swift-initializer/query-builder.png]] The following query extracts all the =let properties= in file. You can see the builder in action above, highlighting our query results. #+begin_src (struct_declaration (constant_declaration (identifier) @name (type) @value)) #+end_src If we want to be more thorough, we should likely cater for classes, vars, int/string literals, etc. so the query needs to be extended as follows. I'm sure it can be written differently, but for now, it does the job. #+begin_src (struct_declaration (variable_declaration (identifier) @name (type) @type)) (struct_declaration (variable_declaration (identifier) @name (string) @value)) (struct_declaration (variable_declaration (identifier) @name (number) @value)) (struct_declaration (constant_declaration (identifier) @name (type) @value)) (struct_declaration (constant_declaration (identifier) @name (string) @value)) (struct_declaration (constant_declaration (identifier) @name (number) @value)) (class_declaration (variable_declaration (identifier) @name (type) @type)) (class_declaration (variable_declaration (identifier) @name (string) @value)) (class_declaration (variable_declaration (identifier) @name (number) @value)) (class_declaration (constant_declaration (identifier) @name (type) @type)) (class_declaration (constant_declaration (identifier) @name (string) @value)) (class_declaration (constant_declaration (identifier) @name (number) @value)) #+end_src Now that we got our Tree-sitter query sorted, let's write a little elisp to extract the info we need from the generated tree. We'll write a =swift-class-or-struct-vars-at-point= function to extract the struct (or class) at point and subsequently filter its property names/types using our query. To simplify the result, we'll return a list of alists. #+begin_src emacs-lisp :lexical no (defun swift-class-or-struct-vars-at-point () "Return a list of class or struct vars in the form '(((name . \"foo\") (type . \"Foo\")))." (cl-assert (seq-contains local-minor-modes 'tree-sitter-mode) "tree-sitter-mode not enabled") (let* ((node (or (tree-sitter-node-at-point 'struct_declaration) (tree-sitter-node-at-point 'class_declaration))) (vars) (var)) (unless node (error "Neither in class nor struct")) (mapc (lambda (item) (cond ((eq 'identifier (tsc-node-type (cdr item))) (when var (setq vars (append vars (list var)))) (setq var (list (cons 'name (tsc-node-text (cdr item)))))) ((eq 'type (tsc-node-type (cdr item))) (setq var (map-insert var 'type (tsc-node-text (cdr item))))) ((eq 'string (tsc-node-type (cdr item))) (setq var (map-insert var 'type "String"))) ((eq 'number (tsc-node-type (cdr item))) (setq var (map-insert var 'type "Int"))) (t (message "%s" (tsc-node-type (cdr item)))))) (tsc-query-captures (tsc-make-query tree-sitter-language "(struct_declaration (variable_declaration (identifier) @name (type) @type)) (struct_declaration (variable_declaration (identifier) @name (string) @value)) (struct_declaration (variable_declaration (identifier) @name (number) @value)) (struct_declaration (constant_declaration (identifier) @name (type) @value)) (struct_declaration (constant_declaration (identifier) @name (string) @value)) (struct_declaration (constant_declaration (identifier) @name (number) @value)) (class_declaration (variable_declaration (identifier) @name (type) @type)) (class_declaration (variable_declaration (identifier) @name (string) @value)) (class_declaration (variable_declaration (identifier) @name (number) @value)) (class_declaration (constant_declaration (identifier) @name (type) @type)) (class_declaration (constant_declaration (identifier) @name (string) @value)) (class_declaration (constant_declaration (identifier) @name (number) @value))") node nil)) (when var (setq vars (append vars (list var)))) vars)) #+end_src #+RESULTS: : (((type . "Int") (name . "x")) : ((type . "Int") (name . "y")) : ((type . "Int") (name . "z"))) Finally, we write a function to generate a Swift initializer from our property list. #+begin_src emacs-lisp :lexical no (defun swift-class-or-struct-initializer-text (vars) "Generate a Swift initializer from property VARS." (cl-assert (seq-contains local-minor-modes 'tree-sitter-mode) "tree-sitter-mode not enabled") (format (string-trim " init(%s) { %s }") (seq-reduce (lambda (reduced var) (format "%s%s%s: %s" reduced (if (string-empty-p reduced) "" ", ") (map-elt var 'name) (map-elt var 'type))) vars "") (string-join (mapcar (lambda (var) (format "self.%s = %s" (map-elt var 'name) (map-elt var 'name))) vars) "\n "))) #+end_src #+RESULTS: : init(x: Int, y: Int, z: Int) { : self.x = x : self.y = y : self.z = z : } We're so close now. All we need is a simple way invoke our code generator. We can use yasnippet for that, making =init= our expandable keyword. #+begin_src # -*- mode: snippet -*- # name: init all # key: init # -- `(swift-class-or-struct-initializer-text (swift-class-or-struct-vars-at-point))` #+end_src And with all that, we've got our yasnippet vision accomplished! #+ATTR_HTML: :width 60% :height 60% [[file:images/emacs-generate-a-swift-initializer/init-sitter_x2.webp]] Be sure to check out this year's relevant [[https://emacsconf.org/][EmacsConf]] talk: [[https://emacsconf.org/2022/talks/treesitter/][Tree-sitter beyond syntax highlighting]]. All code is now pushed to my [[https://github.com/xenodium/dotsies/commit/9a44606935e8d57d7b3bde2d8d051defbf254a9e][config repo]]. By the way, I'm not super knowledgable of neither yasnippet nor Tree-sitter. Improvements are totally welcome. Please reach out on the [[https://indieweb.social/@xenodium][Fediverse]] if you have suggestions! ** Update [[https://gitlab.com/woolsweater][Josh Caswell]] kindly pointed out a couple of interesting items: 1. tree-sitter-langs's [[https://www.reddit.com/r/emacs/comments/zkb7aq/comment/izzjx3l/][Swift grammar is fairly outdated/incomplete]]. 2. There are more up-to-date Swift grammar implementations currently available: - [[https://gitlab.com/woolsweater/tree-sitter-swifter][tree-sitter-swifter]] (by Josh Caswell himself) - [[https://github.com/alex-pinkus/tree-sitter-swift][tree-sitter-swift]] (by [[https://twitter.com/alexpinkus][Alex Pinkus]]) * [2022-11-13 Sun] Emacs: quickly killing processes :PROPERTIES: :CUSTOM_ID: emacs-quick-kill-process :END: Every so often, I need to kill the odd unresponsive process. While I really like =proced= (check out Mickey Petersen's [[https://www.masteringemacs.org/article/displaying-interacting-processes-proced][article]]), I somehow find myself using macOS's [[https://support.apple.com/en-bw/guide/activity-monitor/actmaea30277/mac][Activity Monitor]] to this purpose. Kinda odd, considering I prefer to do these kinds of things from Emacs. What I'd really like is a way to quickly fuzzy search a list of active processes and choose the unresponsive culprid, using my preferred completion frontend (in my case [[https://github.com/abo-abo/swiper][ivy]]). #+ATTR_HTML: :width 95% :height 95% [[file:images/emacs-quick-kill-process/kill_x1.8.webp]] The function below gives us a fuzzy-searchable process utility. While we could use =ivy-read= directly in our implementation, we're better of using [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Completion.html][completing-read]] to remain compatible with other completion frameworks. I'm a big fan of the humble =completing-read=. You feed it a list of candidates and it prompts users to pick one. To build our process list, we can lean on =proced='s own source: =proced-process-attributes=. We transform its output to an [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Association-Lists.html][alist]], formatting the visible keys to contain the process id, owner, command name, and the command line which invoked the process. Once a process is chosen, we can send a kill signal using +signal-process+ [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] and our /job is done/. #+begin_src emacs-lisp :lexical no (require 'dwim-shell-command) (require 'map) (require 'proced) (require 'seq) (defun dwim-shell-commands-kill-process () "Select and kill process." (interactive) (let* ((pid-width 5) (comm-width 25) (user-width 10) (processes (proced-process-attributes)) (candidates (mapcar (lambda (attributes) (let* ((process (cdr attributes)) (pid (format (format "%%%ds" pid-width) (map-elt process 'pid))) (user (format (format "%%-%ds" user-width) (truncate-string-to-width (map-elt process 'user) user-width nil nil t))) (comm (format (format "%%-%ds" comm-width) (truncate-string-to-width (map-elt process 'comm) comm-width nil nil t))) (args-width (- (window-width) (+ pid-width user-width comm-width 3))) (args (map-elt process 'args))) (cons (if args (format "%s %s %s %s" pid user comm (truncate-string-to-width args args-width nil nil t)) (format "%s %s %s" pid user comm)) process))) processes)) (selection (map-elt candidates (completing-read "kill process: " (seq-sort (lambda (p1 p2) (string-lessp (nth 2 (split-string (string-trim (car p1)))) (nth 2 (split-string (string-trim (car p2)))))) candidates) nil t))) (prompt-title (format "%s %s %s" (map-elt selection 'pid) (map-elt selection 'user) (map-elt selection 'comm)))) (when (y-or-n-p (format "Kill? %s" prompt-title)) (dwim-shell-command-on-marked-files (format "Kill %s" prompt-title) (format "kill -9 %d" (map-elt selection 'pid)) :utils "kill" :error-autofocus t :silent-success t)))) #+end_src I've pushed =dwim-shell-commands-kill-process= to my +[[https://github.com/xenodium/dotsies/][config]]+ [[https://github.com/xenodium/dwim-shell-command/commit/b98f45c7901446cf1ab60be2ab648c623e774427][dwim-shell-commands.el]]. Got suggestions? Alternatives? Lemme know. ** Update I've moved =dwim-shell-commands-kill-process= from my Emacs [[https://github.com/xenodium/dotsies][config]] to [[https://github.com/xenodium/dwim-shell-command/blob/main/dwim-shell-commands.el][dwim-shell-commands.el]]. A few advantages: - Killing processes is now async. - Should anything go wrong, an error message is now accessible. - You can easily install via [[https://melpa.org/#/dwim-shell-command][MELPA]]. If you prefer the previous version (without a dependency on [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]]), have a look at the [[https://github.com/xenodium/dotsies/commit/eac4f892eab7a80740ee8ce0c727381886442fb6][initial commit]]. * [2022-11-06 Sun] Hey Emacs, change the default macOS app for... :PROPERTIES: :CUSTOM_ID: hey-emacs-change-the-default-macos-app-for :END: A few weeks ago, I [[https://xenodium.com/emacs-open-with-macos-app/][added an "open with"]] command to [[https://github.com/xenodium/dwim-shell-command/blob/main/dwim-shell-commands.el][dwim-shell-commands.el]]. It's pretty handy for opening files using an external app (ie. not Emacs) other than the default macOS one. =dwim-shell-commands-macos-open-with= and =dwim-shell-commands-open-externally= are typically enough for me to handle opening files outside of Emacs. But every now and then I'd like to change the default macOS app associated with specific file types. Now this isn't particularly challenging in macOS, but it does require a little navigating to get to the right place to change this default setting. Back in March 2020, I [[https://twitter.com/xenodium/status/1242879439932923909][tweeted]] about [[https://github.com/moretension/duti][duti]]: a command-line utility capable of setting default applications for various document types on macOS. While I liked the ability to change default apps from the command-line, the habit never quite stuck. Fast forward to 2022. I've been revisiting lots of my command-line usages (specially those that never stuck) and making them more accessible from Emacs via [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]]. I seldom change default apps on macOS, so my brain forgets about =duti= itself, let alone its arguments, order, etc. But with a dwim shell command like =dwim-shell-commands-macos-set-default-app=, I can easily invoke the command via [[https://github.com/abo-abo/swiper][swiper]]'s =counsel-M-x= fuzzy terms: /"dwim set"/. #+ATTR_HTML: :width 95% :height 95% [[file:images/hey-emacs-change-the-default-macos-app-for/set-default_x1.3.webp]] As an added bonus, I get to reuse =dwim-shell-commands--macos-apps= from "open with" to quickly pick the new default app, making the whole experience pretty snappy. #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-macos-set-default-app () "Set default app for file(s)." (interactive) (let* ((apps (dwim-shell-commands-macos-apps)) (selection (progn (cl-assert apps nil "No apps found") (completing-read "Set default app: " apps nil t)))) (dwim-shell-command-on-marked-files "Set default app" (format "duti -s \"%s\" '<>' all" (string-trim (shell-command-to-string (format "defaults read '%s/Contents/Info.plist' CFBundleIdentifier" (map-elt apps selection))))) :silent-success t :no-progress t :utils "duti"))) (defun dwim-shell-commands--macos-apps () "Return alist of macOS apps (\"Emacs\" . \"/Applications/Emacs.app\")." (mapcar (lambda (path) (cons (file-name-base path) path)) (seq-sort #'string-lessp (seq-mapcat (lambda (paths) (directory-files-recursively paths "\\.app$" t (lambda (path) (not (string-suffix-p ".app" path))))) '("/Applications" "~/Applications" "/System/Applications"))))) #+end_src As usual, I've added =dwim-shell-commands-macos-set-default-app= to [[https://github.com/xenodium/dwim-shell-command/blob/main/dwim-shell-commands.el][dwim-shell-commands.el]], which you can install via [[https://melpa.org/#/dwim-shell-command][MELPA]]. Did you find this tiny integration useful? Check out [[https://xenodium.com/hey-emacs-where-did-i-take-that-photo/][Hey Emacs, where did I take that photo?]] * [2022-11-02 Wed] Hey Emacs, where did I take that photo? :PROPERTIES: :CUSTOM_ID: hey-emacs-where-did-i-take-that-photo :END: I was recently browsing through an old archive of holiday photos (from [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][dired]] of course). I wanted to know where the photo was taken, which got me interested in extracting [[https://en.wikipedia.org/wiki/Exif][Exif]] metadata. Luckily the [[https://exiftool.org/][exiftool]] command line utility does the heavy lifting when it comes to extracting metadata. Since I want it quickly accessible from Emacs (in either dired or current buffer), a tiny elisp snippet would give me just that (via [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]]). #+ATTR_HTML: :width 95% :height 95% [[file:images/hey-emacs-where-did-i-take-that-photo/dwim-exif_x1.3.webp]] #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-image-exif-metadata () "View EXIF metadata in image(s)." (interactive) (dwim-shell-command-on-marked-files "View EXIF" "exiftool '<>'" :utils "exiftool")) #+end_src The above makes all Exif metadata easily accessible, including the photo's GPS coordinates. But I haven’t quite answered the original question. Where did I take the photo? I now know the coordinates, but I can’t realistically deduce neither the country nor city unless I /manually/ feed these values to a reverse geocoding service like [[https://www.openstreetmap.org/][OpenStreetMap]]. /Manually/ you say? This is Emacs, so we can throw more elisp glue at the problem, mixed in with a little shell script, and presto! We've now automated the process of extracting metadata, reverse geocoding, and displaying the photo's address in the minibuffer. Pretty nifty. #+ATTR_HTML: :width 95% :height 95% [[file:images/hey-emacs-where-did-i-take-that-photo/minibuffer-address_x1.3.webp]] #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-image-reverse-geocode-location () "Reverse geocode image(s) location." (interactive) (dwim-shell-command-on-marked-files "Reverse geocode" "lat=\"$(exiftool -csv -n -gpslatitude -gpslongitude '<>' | tail -n 1 | cut -s -d',' -f2-2)\" if [ -z \"$lat\" ]; then echo \"no latitude\" exit 1 fi lon=\"$(exiftool -csv -n -gpslatitude -gpslongitude '<>' | tail -n 1 | cut -s -d',' -f3-3)\" if [ -z \"$lon\" ]; then echo \"no longitude\" exit 1 fi json=$(curl \"https://nominatim.openstreetmap.org/reverse?format=json&accept-language=en&lat=${lat}&lon=${lon}&zoom=18&addressdetails=1\") echo \"json_start $json json_end\"" :utils '("exiftool" "curl") :silent-success t :error-autofocus t :on-completion (lambda (buffer) (with-current-buffer buffer (goto-char (point-min)) (let ((matches '())) (while (re-search-forward "^json_start\\(.*?\\)json_end" nil t) (push (match-string 1) matches)) (message "%s" (string-join (seq-map (lambda (json) (map-elt (json-parse-string json :object-type 'alist) 'display_name)) matches) "\n"))) (kill-buffer buffer))))) #+end_src Displaying the photo's address in the minibuffer is indeed pretty nifty, but what if I’d like to drop a pin in a map for further exploration? This is actually simpler, as there's no need for reverse geocoding. Following a similar recipe, we merely construct an [[https://www.openstreetmap.org/][OpenStreetMap]] URL and open it in our favourite browser. #+ATTR_HTML: :width 95% :height 95% [[file:images/hey-emacs-where-did-i-take-that-photo/photo-map_x1.4.webp]] #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-image-browse-location () "Open image(s) location in browser." (interactive) (dwim-shell-command-on-marked-files "Browse location" "lat=\"$(exiftool -csv -n -gpslatitude -gpslongitude '<>' | tail -n 1 | cut -s -d',' -f2-2)\" if [ -z \"$lat\" ]; then echo \"no latitude\" exit 1 fi lon=\"$(exiftool -csv -n -gpslatitude -gpslongitude '<>' | tail -n 1 | cut -s -d',' -f3-3)\" if [ -z \"$lon\" ]; then echo \"no longitude\" exit 1 fi if [[ $OSTYPE == darwin* ]]; then open \"http://www.openstreetmap.org/?mlat=${lat}&mlon=${lon}&layers=C\" else xdg-open \"http://www.openstreetmap.org/?mlat=${lat}&mlon=${lon}&layers=C\" fi" :utils "exiftool" :error-autofocus t :silent-success t)) #+end_src Got suggestions? Improvements? All three functions are now included in [[https://github.com/xenodium/dwim-shell-command/blob/main/dwim-shell-commands.el][dwim-shell-commands.el]] as part of [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]]. Pull requests totally welcome ;) * [2022-10-24 Mon] Emacs: A welcoming experiment :PROPERTIES: :CUSTOM_ID: emacs-a-welcoming-experiment :END: The =*scratch*= buffer is the first thing I see when I launch an Emacs session. Coupled with [[https://github.com/Fanael/persistent-scratch][persistent-scratch]], it's served me well over the years. I gotta say though, my scratch buffer accumulates random bits and often becomes a little messy. It's not the most visually appealing landing buffer when launching Emacs. But who cares, I'm only a =C-x b= binding away from invoking =ivy-switch-buffer= to get me wherever I need to be. It's powered by =ivy-use-virtual-buffers=, which remembers recent files across sessions. Having said all of this, I recently ran into u/pearcidar43's [[https://www.reddit.com/r/unixporn/comments/yamj5f/exwm_emacs_is_kinda_comfy_as_a_wm/][post]] showcasing a wonderful Emacs banner. Lucky for us, they [[https://www.reddit.com/r/unixporn/comments/yamj5f/comment/itfusm0/?utm_source=share&utm_medium=web2x&context=3][shared]] the [[https://github.com/TanbinIslam43/mydotfiles/blob/main/.doom.d/emacs.png][image]], so I got curious about building a minimal welcome buffer of sorts. Nothing fancy, the only requirements being to load quickly and enable me to get on with my =C-x b= ritual. Throw in a little bonus to exit quickly by pressing just =q= if I so desire. #+ATTR_HTML: :width 95% :height 95% [[file:images/emacs-a-welcoming-experiment/welcome-minimal_x0.5.webp]] I didn't know a whole lot on how to go about it, so I took a peak at [[https://github.com/emacs-dashboard/emacs-dashboard][emacs-dashboard]] for inspiration. Turns out, I needed little code to get the desired effect in my =early-init.el=: #+begin_src emacs-lisp :lexical no (defun ar/show-welcome-buffer () "Show *Welcome* buffer." (with-current-buffer (get-buffer-create "*Welcome*") (setq truncate-lines t) (let* ((buffer-read-only) (image-path "~/.emacs.d/emacs.png") (image (create-image image-path)) (size (image-size image)) (height (cdr size)) (width (car size)) (top-margin (floor (/ (- (window-height) height) 2))) (left-margin (floor (/ (- (window-width) width) 2))) (prompt-title "Welcome to Emacs!")) (erase-buffer) (setq mode-line-format nil) (goto-char (point-min)) (insert (make-string top-margin ?\n )) (insert (make-string left-margin ?\ )) (insert-image image) (insert "\n\n\n") (insert (make-string (floor (/ (- (window-width) (string-width prompt-title)) 2)) ?\ )) (insert prompt-title)) (setq cursor-type nil) (read-only-mode +1) (switch-to-buffer (current-buffer)) (local-set-key (kbd "q") 'kill-this-buffer))) (setq initial-scratch-message nil) (setq inhibit-startup-screen t) (when (< (length command-line-args) 2) (add-hook 'emacs-startup-hook (lambda () (when (display-graphic-p) (ar/show-welcome-buffer))))) #+end_src This being Emacs, I can bend it as far as needed. In my case, I didn't need much, so I can probably stop here. It was a fun experiment. I'll even [[https://github.com/xenodium/dotsies/commit/90c689def913a9bccdd408ef609c7f99a5cce1fb][try using it]] for a little while and see if it sticks. I'm sure there's plenty more that could be handled (edge cases, resizes, etc.), but if you want something more established, consider something like [[https://github.com/emacs-dashboard/emacs-dashboard][emacs-dashboard]] instead. I haven't used it myself, but is [[https://melpa.org/#/dashboard][pretty popular]]. * [2022-10-14 Fri] Emacs: Open with macOS app :PROPERTIES: :CUSTOM_ID: emacs-open-with-macos-app :END: On a recent Reddit [[https://www.reddit.com/r/emacs/comments/y2dfma/comment/is4ygl8/?utm_source=share&utm_medium=web2x&context=3][comment]], tdstoff7 asked if I had considered writing an "Open with" DWIM shell command for those times one would like to open a file externally using an app other than the default. I hadn't, but nice idea. Take images as an example. Though Emacs can display them quickly, I also open images externally using the default app ([[https://en.wikipedia.org/wiki/Preview_(macOS)][Preview]] in my case). But then there are those times when I'd like to open with a different app for editing (maybe something like GIMP). It'd be nice to quickly choose which app to open with. #+ATTR_HTML: :width 80% :height 80% [[file:images/emacs-open-with-macos-app/open-with_x2.webp]] There isn't much to the code. Get a list of apps, ask user to pick one (via [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Programmed-Completion.html][completing-read]]), and launch the external app via =dwim-shell-command-on-marked-files=. There's likely a better way of getting a list of available apps (happy to take suggestions), but searching in "/Applications" "~/Applications" and "/System/Applications" does the job for now. #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-macos-open-with () "Convert all marked images to jpg(s)." (interactive) (let* ((apps (seq-sort #'string-lessp (seq-mapcat (lambda (paths) (directory-files-recursively paths "\\.app$" t (lambda (path) (not (string-suffix-p ".app" path))))) '("/Applications" "~/Applications" "/System/Applications")))) (selection (progn (cl-assert apps nil "No apps found") (completing-read "Open with: " (mapcar (lambda (path) (propertize (file-name-base path) 'path path)) apps))))) (dwim-shell-command-on-marked-files "Open with" (format "open -a '%s' '<<*>>'" (get-text-property 0 'path selection)) :silent-success t :no-progress t :utils "open"))) #+end_src =dwim-shell-commands-macos-open-with= is now included in [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]], available on [[https://melpa.org/#/dwim-shell-command][melpa]]. What other uses can you find for it? * [2022-10-12 Wed] Improving on Emacs macOS sharing :PROPERTIES: :CUSTOM_ID: emacs-macos-sharing-dwim-style-improved :END: A quick follow-up to [[https://xenodium.com/emacs-macos-share-from-dired-dwim-style/][Emacs: macOS sharing (DWIM style)]]... Though functional, the implementation had a couple of drawbacks. Tohiko [[https://www.reddit.com/r/emacs/comments/y1tneh/comment/is0pgkf][noticed fullscreen wasn't working at all]] while Calvin [[https://lobste.rs/s/qga1px/emacs_macos_sharing_dwim_style#c_safiuw][proposed enumeration for tighter Emacs integration]]. Calvin's suggestion enables using [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Completion.html][completing-read]] to pick the sharing service. This makes the integration feel more at home. As a bonus, it also enables sharing from fullscreen Emacs. As an [[https://github.com/abo-abo/swiper][ivy]] user, you can see a vertical list of sharing services. #+ATTR_HTML: :width 80% :height 80% [[file:images/emacs-macos-sharing-dwim-style-improved/share-completing_x1.4.webp]] Here's the new snippet, now [[https://github.com/xenodium/dwim-shell-command/commit/20e782b4bf1ea01fecfce3cc8ac4c5a74518cd80][pushed to dwim-shell-commands.el]]: #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands--macos-sharing-services () "Return a list of sharing services." (let* ((source (format "import AppKit NSSharingService.sharingServices(forItems: [ %s ]).forEach { print(\"\\($0.prompt-title)\") }" (string-join (mapcar (lambda (file) (format "URL(fileURLWithPath: \"%s\")" file)) (dwim-shell-command--files)) ", "))) (services (split-string (string-trim (shell-command-to-string (format "echo '%s' | swift -" source))) "\n"))) (when (seq-empty-p services) (error "No sharing services available")) services)) (defun dwim-shell-commands-macos-share () "Share selected files from macOS." (interactive) (let* ((services (dwim-shell-commands--macos-sharing-services)) (service-name (completing-read "Share via: " services)) (selection (seq-position services service-name #'string-equal))) (dwim-shell-command-on-marked-files "Share" (format "import AppKit _ = NSApplication.shared NSApp.setActivationPolicy(.regular) class MyWindow: NSWindow, NSSharingServiceDelegate { func sharingService( _ sharingService: NSSharingService, didShareItems items: [Any] ) { NSApplication.shared.terminate(nil) } func sharingService( _ sharingService: NSSharingService, didFailToShareItems items: [Any], error: Error ) { let error = error as NSError if error.domain == NSCocoaErrorDomain && error.code == NSUserCancelledError { NSApplication.shared.terminate(nil) } exit(1) } } let window = MyWindow( contentRect: NSRect(x: 0, y: 0, width: 0, height: 0), styleMask: [], backing: .buffered, defer: false) let services = NSSharingService.sharingServices(forItems: [\"<<*>>\"].map{URL(fileURLWithPath:$0)}) let service = services[%s] service.delegate = window service.perform(withItems: [\"<<*>>\"].map{URL(fileURLWithPath:$0)}) NSApp.run()" selection) :silent-success t :shell-pipe "swift -" :join-separator ", " :no-progress t :utils "swift"))) #+end_src [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] is available on [[https://melpa.org/#/dwim-shell-command][melpa]]. What other uses can you find for it? * [2022-10-12 Wed] Emacs: macOS sharing (DWIM style) :PROPERTIES: :CUSTOM_ID: emacs-macos-share-from-dired-dwim-style :END: UPDATE: See an improved implementation [[https://xenodium.com/emacs-macos-sharing-dwim-style-improved][here]]. A few days ago, [[https://xenodium.com/emacs-reveal-in-finder-dwim-style/][I wrote dwim-shell-commands-macos-reveal-in-finder]]. While I've written a bunch of other [[https://github.com/xenodium/dwim-shell-command/blob/main/dwim-shell-commands.el][dwim-shell-commands]], what set this case apart was the use of [[https://www.swift.org/][Swift]] to glue an Emacs workflow. #+begin_src emacs-lisp (defun dwim-shell-commands-macos-reveal-in-finder () "Reveal selected files in macOS Finder." (interactive) (dwim-shell-command-on-marked-files "Reveal in Finder" "import AppKit NSWorkspace.shared.activateFileViewerSelecting([\"<<*>>\"].map{URL(fileURLWithPath:$0)})" :join-separator ", " :silent-success t :shell-pipe "swift -")) #+end_src There is hardly any Swift involved, yet it scratched a real itch I couldn't otherwise reach (reveal multiple dired files in macOS's [[https://en.wikipedia.org/wiki/Finder_(software)][Finder]]). divinedominion's [[https://www.reddit.com/r/emacs/comments/xzt3gx/comment/irrwoya/?utm_source=share&utm_medium=web2x&context=3][reddit comment]] got me thinking of other use-cases, so I figured why not push this Swift-elisp beeswax a little further... Let's add macOS's sharing ability via [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]], so I could invoke it from the comfort of my beloved [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][dired]] or any 'ol Emacs buffer visiting a file. #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-macos-share () "Share selected files from macOS." (interactive) (let* ((position (window-absolute-pixel-position)) (x (car position)) (y (- (x-display-pixel-height) (cdr position)))) (dwim-shell-command-on-marked-files "Share" (format "import AppKit _ = NSApplication.shared NSApp.setActivationPolicy(.regular) let window = InvisibleWindow( contentRect: NSRect(x: %d, y: %s, width: 0, height: 0), styleMask: [], backing: .buffered, defer: false) NSApp.activate(ignoringOtherApps: true) DispatchQueue.main.async { let picker = NSSharingServicePicker(items: [\"<<*>>\"].map{URL(fileURLWithPath:$0)}) picker.delegate = window picker.show( relativeTo: .zero, of: window.contentView!, preferredEdge: .minY) } NSApp.run() class InvisibleWindow: NSWindow, NSSharingServicePickerDelegate, NSSharingServiceDelegate { func sharingServicePicker( _ sharingServicePicker: NSSharingServicePicker, didChoose service: NSSharingService? ) { if service == nil { print(\"Cancelled\") // Delay so \"More...\" menu can launch System Preferences DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { NSApplication.shared.terminate(nil) } } } func sharingServicePicker( _ sharingServicePicker: NSSharingServicePicker, delegateFor sharingService: NSSharingService ) -> NSSharingServiceDelegate? { return self } func sharingService( _ sharingService: NSSharingService, didShareItems items: [Any] ) { NSApplication.shared.terminate(nil) } func sharingService( _ sharingService: NSSharingService, didFailToShareItems items: [Any], error: Error ) { let error = error as NSError if error.domain == NSCocoaErrorDomain && error.code == NSUserCancelledError { NSApplication.shared.terminate(nil) } exit(1) } }" x y) :silent-success t :shell-pipe "swift -" :join-separator ", " :no-progress t :utils "swift"))) #+end_src Sure there is some trickery involved here (like creating an invisible macOS window to anchor the menu), but hey the results are surprisingly usable. Take a look... #+ATTR_HTML: :width 80% :height 80% [[file:images/emacs-macos-share-from-dired-dwim-style/share-done_x1.4.webp]] I've pushed =dwim-shell-commands-macos-share= to [[https://github.com/xenodium/dwim-shell-command/blob/919817520fa507dd3c7e6859eb982976e28b2575/dwim-shell-commands.el#L370][dwim-shell-commands.el]] in case you'd like to give it a try. It's very much an experiment of sorts, so please treat it as such. For now, I'm looking forward to AirDropping more files and seeing if the flow sticks. Oh, and I just realised I can use this to send files to iOS Simulators. Win. [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] is available on [[https://melpa.org/#/dwim-shell-command][melpa]]. What other uses can you find for it? * [2022-10-09 Sun] Emacs: Reveal in macOS Finder (DWIM style) :PROPERTIES: :CUSTOM_ID: emacs-reveal-in-finder-dwim-style :END: Just the other day, [[https://github.com/gvoysey][Graham Voysey]] filed an [[https://github.com/xenodium/dwim-shell-command/issues/3][escaping bug]] against [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]]. Once he verified the the fix, he also posted [[https://github.com/xenodium/dwim-shell-command/issues/3#issuecomment-1272413459][two uses]] of =dwim-shell-command-on-marked-files=. I've made some small tweaks, but here's the gist of it: #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-feh-marked-files () "View all marked files with feh." (interactive) (dwim-shell-command-on-marked-files "View with feh" "feh --auto-zoom --scale-down '<<*>>'" :silent-success t :utils "feh")) (defun dwim-shell-commands-dragon-marked-files () "Share all marked files with dragon." (interactive) (dwim-shell-command-on-marked-files "View with dragon" "dragon --on-top '<<*>>'" :silent-success t :utils "dragon")) #+end_src I love seeing what others get up to by using =dwim-shell-command=. Are there new magical command-line utilities out there I don't know about? In this instance, I got to learn about [[https://feh.finalrewind.org/][feh]] and [[https://github.com/mwh/dragon][dragon]]. [[https://feh.finalrewind.org/][feh]] is a no-frills image viewer for console users while [[https://github.com/mwh/dragon][dragon]] is a simple drag-and-drop source/sink for X or Wayland. Both utilities are great uses of =dwim-shell-command=, enabling a seamless transition from Emacs to the /outside world/. These days I'm rarely on a linux box, so I was keen to ensure macOS had these cases covered. [[https://en.wikipedia.org/wiki/Preview_(macOS)][Preview]] is a solid macOS equivalent to [[https://feh.finalrewind.org/][feh]]. =Preview= is already macOS's default image viewer. A simple =open '<>'= would do the job, but if we'd like to make this command more portable, we can accomodate as follows: #+begin_src emacs-lisp (defun dwim-shell-commands-open-externally () "Open file(s) externally." (interactive) (dwim-shell-command-on-marked-files "Open externally" (if (eq system-type 'darwin) "open '<>'" "xdg-open '<>'") :silent-success t :utils "open")) #+end_src Special mention goes to Bozhidar Batsov's [[https://github.com/bbatsov/crux][crux]] which achieves similar functionality via =crux-open-with=. [[https://github.com/bbatsov/crux][crux]] provides a bunch of other useful functions. Some of my favourites being =crux-duplicate-current-line-or-region=, =crux-transpose-windows=, =crux-delete-file-and-buffer=, and =crux-rename-buffer-and-file=, but I digress. Moving on to a [[https://github.com/mwh/dragon][dragon]] equivalent on macOS, I thought I had it covered via [[https://github.com/kaz-yos/reveal-in-osx-finder][reveal-in-osx-finder]] or [[https://github.com/jcs-elpa/reveal-in-folder][reveal-in-folder]]. Turns out, neither of these reveal multiple [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][dired]]-selected files within [[https://en.wikipedia.org/wiki/Finder_(software)][Finder]]. At first, I thought this could be easily achieved by passing additional flags/params to macOS's =open= command, but it doesn't seem to be the case. Having said that, this [[https://stackoverflow.com/questions/7652928/launch-finder-window-with-specific-files-selected][Stack Overflow post]], has a solution in Objective-C, which is where things got a little more interesting. You see, back in July I [[https://xenodium.com/emacs-dwim-shell-command-multi-language/][added multi-language support]] to [[https://xenodium.com/emacs-dwim-shell-command-multi-language/][dwim-shell-command]] and while it highlighted language flexibility, I hadn't yet taken advantage of this feature myself. That is, until today. The Objective-C snippet from the Stack Overflow post can be written as a Swift one-liner. Ok I lie. It's actually two lines, counting the import, but you can see that this multi-language Emacs transition/integration is pretty easy to add. #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-macos-reveal-in-finder () "Reveal selected files in macOS Finder." (interactive) (dwim-shell-command-on-marked-files "Reveal in Finder" "import AppKit NSWorkspace.shared.activateFileViewerSelecting([\"<<*>>\"].map{URL(fileURLWithPath:$0)})" :join-separator ", " :silent-success t :shell-pipe "swift -")) #+end_src =<<*>>= is the centrepiece of the snippet above. It gets instantiated with a list of files joined using the =", "= separator. #+begin_src swift NSWorkspace.shared.activateFileViewerSelecting(["/path/to/file1", "/path/to/file2"].map { URL(fileURLWithPath: $0) }) #+end_src The proof of the pudding is of course in the eating, so ummm let's show it in action: #+ATTR_HTML: :width 80% :height 80% [[file:images/emacs-reveal-in-finder-dwim-style/dwim-reveal.webp]] I should mention the webp animation above was also created using my trusty =dwim-shell-commands-video-to-webp= also backed by [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]]. #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-video-to-webp () "Convert all marked videos to webp(s)." (interactive) (dwim-shell-command-on-marked-files "Convert to webp" "ffmpeg -i '<>' -vcodec libwebp -filter:v fps=fps=10 -compression_level 3 -lossless 1 -loop 0 -preset default -an -vsync 0 '<>'.webp" :utils "ffmpeg")) #+end_src [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] is available on [[https://melpa.org/#/dwim-shell-command][melpa]]. What other uses can you find for it? UPDATE: Most DWIM shell commands I use are available as part of [[https://github.com/xenodium/dwim-shell-command/blob/main/dwim-shell-commands.el][dwim-shell-commands.el]]. See =dwim-shell-command='s [[https://github.com/xenodium/dwim-shell-command#install-command-line-utilities][install command line utilities]]. * [2022-10-01 Sat] Plain Org v1.5 released :PROPERTIES: :CUSTOM_ID: plain-org-v15-released :END: If you haven't heard of [[https://plainorg.com][Plain Org]], it gives you access to [[https://orgmode.org][org]] files on iOS while away from your beloved [[https://www.gnu.org/software/emacs/][Emacs]]. Hadn't had time to post, but v1.5 has been available on the [[https://apps.apple.com/app/id1578965002][App Store]] for a couple of weeks now. The update is mostly a bugfix release, primarily addressing inline editing issues that appeared on iOS 16, along with a few other changes: - Render form feeds at end of headings at all times. - Fixes new files not recognized by org-roam. - Fixes share sheet saving from cold launch. - Fixes inline editing on iOS 16. #+ATTR_HTML: :width 60% :height 60% [[file:images/plain-org-v15-released/po.png]] I love org markup, but we (iPhone + org users) are a fairly niche bunch. If you're finding Plain Org useful, *please help support this effort* by getting the word out. Tell your friends, [[https://twitter.com/intent/tweet?text=Plain%20Org%20https%3A%2F%2Fapps.apple.com%2Fapp%2Fid1578965002%20][tweet]], or blog about it. Or just support via the [[https://apps.apple.com/app/id1578965002][App Store]] :) * [2022-10-01 Sat] dwim-shell-command usages: pdftotext and scp :PROPERTIES: :CUSTOM_ID: dwim-shell-command-usages-pdftotext-and-scp :END: [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] is a little Emacs package I wrote to enable crafting more reusable shell commands. I intended to use it as an [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Shell.html][async-shell-command]] alternative (and I do these days). The more surprising win was bringing lots of command-line utilities (sometimes with complicated invocations) and making them quickly accessible. I no longer need to remember their respective parameters, order, flags, etc. I've migrated most [[https://xenodium.com/emacs-password-protect-current-pdf-revisited/][one-liners]] and [[https://xenodium.com/png-to-icns-emacs-dwim-style/][scripts]] I had to [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] equivalents. They are available at [[https://github.com/xenodium/dwim-shell-command/blob/main/dwim-shell-commands.el][dwim-shell-commands.el]]. Having said that, it's great to discover new usages from =dwim-shell-command= users. Take [[https://www.reddit.com/user/TiMueller/][u/TiMueller]]'s Reddit comment, [[https://www.reddit.com/r/emacs/comments/w8s2ov/comment/iq7idav/?utm_source=share&utm_medium=web2x&context=3][showcasing pdftotext]]. Neat utility I was unaware of. It does as it says on the tin and converts a pdf to text. Can be easily saved to your accessible repertoire with: #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-pdf-to-txt () "Convert pdf to txt." (interactive) (dwim-shell-command-on-marked-files "pdf to txt" "pdftotext -layout '<>' '<>.txt'" :utils "pdftotext")) #+end_src #+ATTR_HTML: :width 90% :height 90% [[file:images/dwim-shell-command-usages-pdftotext-and-scp/pdf-to-txt_x2.webp]] [[https://github.com/tareefdev][tareefdev]] wanted a quick command to [[https://linux.die.net/man/1/scp][secure copy]] remote files to a local directory. Though this use-case is already covered by Tramp, I suspect a DWIM command would make it a little more convenient (async by default). However, Tramp paths aren't usable from the shell unless we massage them a little. We can use =dwim-shell-command-on-marked-files='s =:post-process-template= to drop the "/ssh:" prefix. #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-copy-remote-to-downloads () (interactive) (dwim-shell-command-on-marked-files "Copy remote to local Downloads" "scp '<>' ~/Downloads/" :utils "scp" :post-process-template (lambda (script file) ;; Tramp file path start with "/ssh:". Drop it. (string-replace file (string-remove-prefix "/ssh:" file) script)))) #+end_src [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] is available on [[https://melpa.org/#/dwim-shell-command][MELPA]] (531 downloads as of 2022-10-01). * [2022-09-17 Sat] $ rm Important.txt (uh oh!) :PROPERTIES: :CUSTOM_ID: rm-important-txt-oh-sht :END: Setting Emacs up to use your system trash can potentially save your bacon if you mistakenly delete a file, say from [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][dired]]. Unsurprisingly, the trash safety net also extends to other Emacs areas. For example, discarding files from [[https://magit.vc/][Magit]] (via =magit-discard=) becomes a recoverable operation. As an [[https://www.gnu.org/software/emacs/manual/html_mono/eshell.html][eshell]] user, the trash can also help you recover from =rm= blunders. #+ATTR_HTML: :width 90% :height 90% [[file:images/rm-important-txt-oh-sht/recovered_x1.6.webp]] You can enable macOS system trash in Emacs by setting =trash-directory= along with defining =system-move-file-to-trash=: #+begin_src emacs-lisp :lexical no (setq trash-directory "~/.Trash") ;; See `trash-directory' as it requires defining `system-move-file-to-trash'. (defun system-move-file-to-trash (file) "Use \"trash\" to move FILE to the system trash." (cl-assert (executable-find "trash") nil "'trash' must be installed. Needs \"brew install trash\"") (call-process "trash" nil 0 nil "-F" file)) #+end_src * [2022-09-11 Sun] Cycling through window layouts (revisited) :PROPERTIES: :CUSTOM_ID: cycling-through-window-layout-revisited :END: Last year, I wrote a little script to [[https://xenodium.com/cycling-window-layouts-via-hammerspoon][cycle through window layouts via Hammerspoon]]. The cycling set I chose didn't stick, so here's another go. #+ATTR_HTML: :width 90% :height 90% [[file:images/cycling-through-window-layout-revisited/cycle_layout.webp]] #+begin_src lua function reframeFocusedWindow() local win = hs.window.focusedWindow() local maximizedFrame = win:screen():frame() maximizedFrame.x = maximizedFrame.x + 15 maximizedFrame.y = maximizedFrame.y + 15 maximizedFrame.w = maximizedFrame.w - 30 maximizedFrame.h = maximizedFrame.h - 30 local leftFrame = win:screen():frame() leftFrame.x = leftFrame.x + 15 leftFrame.y = leftFrame.y + 15 leftFrame.w = leftFrame.w / 2 - 15 leftFrame.h = leftFrame.h - 30 local rightFrame = win:screen():frame() rightFrame.x = rightFrame.w / 2 rightFrame.y = rightFrame.y + 15 rightFrame.w = rightFrame.w / 2 - 15 rightFrame.h = rightFrame.h - 30 if win:frame() == maximizedFrame then win:setFrame(leftFrame) return end if win:frame() == leftFrame then win:setFrame(rightFrame) return end win:setFrame(maximizedFrame) end hs.hotkey.bind({"alt"}, "F", reframeFocusedWindow) #+end_src Looping through layouts is done with a global key-binding of =option f= or, if familiar with a macOS keyboard, =⌥ f=. For those unfamiliar with [[http://hammerspoon.org/][Hammerspoon]]... If you're a tinkerer and a macOS user, you'd love [[http://hammerspoon.org/][Hammerspoon]]. Like elisp gluing all things Emacs, Hammerspoon uses Lua to glue all things macOS. For example, here's a stint at [[https://xenodium.com/emacs-utilities-for-your-os/][writing a narrowing utility for macOS]] using [[http://www.hammerspoon.org/docs/hs.chooser.html][chooser]]. * [2022-08-18 Thu] dwim-shell-command with template prompts :PROPERTIES: :CUSTOM_ID: dwim-shell-command-with-template-prompts :END: Somewhat recently, I wanted to quickly create an empty/transparent png file. [[https://imagemagick.org/][ImageMagick]]'s convert has you covered here. Say you want a transparent 200x400 image, you can get it with: #+begin_src sh convert -verbose -size 200x400 xc:none empty200x400.png #+end_src Great, I now know the one-liner for it. But because I'm in the mood of saving these as [[https://xenodium.com/seamless-command-line-utils/][seamless command-line utils]], I figured I should save the [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] equivalent. I wanted configurable image dimensions, so I used [[https://www.gnu.org/software/emacs/manual/html_node/calc/Formatting-Lisp-Functions.html][read-number]] together with [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Formatting-Strings.html][format]] to create the templated command and fed it to =dwim-shell-command-on-marked-files=. Job done: #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-make-transparent-png () "Create a transparent png." (interactive) (let ((width (read-number "Width: " 200)) (height (read-number "Height: " 200))) (dwim-shell-command-on-marked-files "Create transparent png" (format "convert -verbose -size %dx%d xc:none '<>'" width height width height) :utils "convert"))) #+end_src The resulting =dwim-shell-commands-make-transparent-png= is fairly simple, but [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] aims to remove friction so you're more inclined to save reusable commands. In this case, we can shift querying and formatting into the template. =<>= can be interpreted as "ask the user for a value using the suggested prompt and default value." #+ATTR_HTML: :width 50% :height 50% [[file:images/dwim-shell-command-with-template-prompts/query.png]] With template queries in mind, =dwim-shell-commands-make-transparent-png= can be further reduced to essentially the interactive command boilerplate and the template itself: #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-make-transparent-png () "Create a transparent png." (interactive) (dwim-shell-command-on-marked-files "Create transparent png" "convert -verbose -size <>x<> xc:none '<>x<>.png(u)>>'" :utils "convert")) #+end_src #+ATTR_HTML: :width 90% :height 90% [[file:images/dwim-shell-command-with-template-prompts/empty.webp]] Note: Any repeated queries (same prompt and default) are treated as equal. That is, ask the user once and replace everywhere. If you'd like to request separate values, change either prompt or the default value. * [2022-08-14 Sun] Seamless command-line utils :PROPERTIES: :CUSTOM_ID: seamless-command-line-utils :END: Just the other day, I received a restaurant menu split into a handful of image files. I wanted to forward the menu to others but figured I should probably send it as a single file. ImageMagick's [[https://imagemagick.org/script/convert.php][convert]] command-line utility works great for this purpose. Feed it some images and it creates a pdf for you: #+begin_src sh convert image1.png image2.png image3.png combined.pdf #+end_src Using =convert= for this purpose was pretty straightforward. I'm sure I'll use it again in a similar context, but what if I can make future usage more seamless? In the past, I would just make a note of usage and revisit when needed. Though this works well enough, it often requires some amount of manual work (looking things up, tweaking command, etc) if you happen to forget the command syntax. I wanted common one-liners (or [[https://xenodium.com/png-to-icns-emacs-dwim-style/][longer shell scripts]]) to be easily reusable and accessible from Emacs. Turns out, the [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] experiment is working fairly well for this purpose. In addition to providing template expansion, it generally [[https://xenodium.com/emacs-dwim-shell-command/][tries to do what I mean]] (focus when needed, reveal new files, rename buffers, etc). Here's how I saved the =convert= command instance for future usage: #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-join-as-pdf () "Join all marked images as a single pdf." (interactive) (dwim-shell-command-on-marked-files "Join as pdf" "convert -verbose '<<*>>' '<>'" :utils "convert")) #+end_src From now on, any time I'd like to join multiple files into a pdf, I can now select them all and invoke =dwim-shell-commands-join-as-pdf=. #+ATTR_HTML: :width 90% :height 90% [[file:images/seamless-command-line-utils/joined_minimal_x1.2.webp]] In the saved command, ='<<*>>'= expands to either [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][dired]] selected files or whatever file happens to be open in the current buffer. The buffer file isn't of much help for joining multiple items, but can be handy for other instances (say I want to convert current image to jpeg). Moving on to ='<>'=, we could have just written as =joined.pdf=, but wrapping it ensures the resulting file name is unique. That is, if =joined.pdf= already exists, write =joined(1).pdf= instead. These kinds of command-line integrations are working well for me. Take the webp animation above, it was created by invoking =dwim-shell-commands-video-to-webp= on a =.mov= file. Easy peasy. While I can easily memorize the =convert= command for the pdf instance, I'm hopeless in the webp scenario: #+begin_src sh ffmpeg -i '<>' -vcodec libwebp -filter:v fps=fps=10 -compression_level 3 -lossless 1 -loop 0 -preset default -an -vsync 0 '<>'.webp #+end_src While searching through command line history helps to quickly re-spin previous commands, it requires remembering the actual utility used for any particular action. On the other hand, wrapping with Emacs functions enables me to remember the action itself, using more memorable names. Also, fuzzy searching works a treat. #+ATTR_HTML: :width 70% :height 70% [[file:images/seamless-command-line-utils/fuzzy.png]] It's been roughly a month since I started playing around with this idea of wrapping command-line utilities more seamlessly. Since then, I've brought in a bunch of use-cases that are now quickly accessible (all in [[https://github.com/xenodium/dwim-shell-command/blob/main/dwim-shell-commands.el][dwim-shell-commands.el]]): - dwim-shell-commands-audio-to-mp3 - dwim-shell-commands-clipboard-to-qr - dwim-shell-commands-copy-to-desktop - dwim-shell-commands-copy-to-downloads - dwim-shell-commands-docx-to-pdf - dwim-shell-commands-download-clipboard-stream-url - dwim-shell-commands-drop-video-audio - dwim-shell-commands-epub-to-org - dwim-shell-commands-external-ip - dwim-shell-commands-files-combined-size - dwim-shell-commands-git-clone-clipboard-url - dwim-shell-commands-git-clone-clipboard-url-to-downloads - dwim-shell-commands-http-serve-dir - dwim-shell-commands-image-browse-location - dwim-shell-commands-image-exif-metadata - dwim-shell-commands-image-reverse-geocode-location - dwim-shell-commands-image-to-grayscale - dwim-shell-commands-image-to-icns - dwim-shell-commands-image-to-jpg - dwim-shell-commands-image-to-png - dwim-shell-commands-install-iphone-device-ipa - dwim-shell-commands-join-as-pdf - dwim-shell-commands-kill-gpg-agent - dwim-shell-commands-kill-process - dwim-shell-commands-macos-bin-plist-to-xml - dwim-shell-commands-macos-caffeinate - dwim-shell-commands-macos-hardware-overview - dwim-shell-commands-macos-open-with - dwim-shell-commands-macos-reveal-in-finder - dwim-shell-commands-macos-set-default-app - dwim-shell-commands-macos-share - dwim-shell-commands-macos-toggle-dark-mode - dwim-shell-commands-macos-toggle-display-rotation - dwim-shell-commands-make-transparent-png - dwim-shell-commands-move-to-desktop - dwim-shell-commands-move-to-downloads - dwim-shell-commands-open-clipboard-url - dwim-shell-commands-open-externally - dwim-shell-commands-pdf-password-protect - dwim-shell-commands-pdf-to-txt - dwim-shell-commands-ping-google - dwim-shell-commands-rename-all - dwim-shell-commands-reorient-image - dwim-shell-commands-resize-gif - dwim-shell-commands-resize-image - dwim-shell-commands-resize-video - dwim-shell-commands-speed-up-gif - dwim-shell-commands-speed-up-video - dwim-shell-commands-stream-clipboard-url - dwim-shell-commands-svg-to-png - dwim-shell-commands-unzip - dwim-shell-commands-url-browse - dwim-shell-commands-video-to-gif - dwim-shell-commands-video-to-optimized-gif - dwim-shell-commands-video-to-webp What other use-cases would you consider? =dwim-shell-command= is [[https://melpa.org/#/dwim-shell-command][available on melpa]]. ** Update 2022-11-14 dwim-shell-commands.el list updated. * [2022-08-03 Wed] Emacs freebie: macOS emoji picker :PROPERTIES: :CUSTOM_ID: emacs-freebie-macos-emoji-picker :END: I recently ran a little experiment to bring macOS's [[https://xenodium.com/an-accentuated-emacs-experiment/][long-press-accents-like behavior]] to Emacs. What I forgot to mention is that macOS's character viewer /just works/ from our beloved editor. If you have a newer MacBook model, you can press the 🌐 key to summon the emoji picker (character viewer). You may need to set this key binding [[https://support.apple.com/en-gb/guide/mac-help/mchlp1560/mac][from macOS keyboard preferences]]. I'm happy to take this Emacs freebie, kthxbye. #+ATTR_HTML: :width 70% :height 70% [[file:images/emacs-freebie-macos-emoji-picker/hearts_x1.5.webp]] Edits: - Like other macOS apps, this dialog can be invoked via control-command-space (thanks [[https://www.reddit.com/r/emacs/comments/wfja3n/comment/iiv7ptb/?utm_source=share&utm_medium=web2x&context=3][mtndewforbreakfast]]). Note: you'd lose this ability if you =(setq mac-command-modifier 'meta)= in your config. - The 🌐 key is a feature on newer MacBook hardware and likely needs configuration (thanks [[https://www.reddit.com/r/emacs/comments/wfja3n/comment/iivnwxt/?utm_source=share&utm_medium=web2x&context=3][Fabbi-]]). * [2022-08-01 Mon] dwim-shell-command video streams :PROPERTIES: :CUSTOM_ID: dwim-shell-command-video-streams :END: I continue hunting for use-cases I can migrate to [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]]... After adding [[https://xenodium.com/dwim-shell-command-improvements/][clipboard support]] (via <>) I found one more. 1. Copy URL from browser. 2. Invoke =dwim-shell-commands-mpv-stream-clipboard-url=. 3. Enjoy picture in picture from Emacs ;) #+ATTR_HTML: :width 90% :height 90% [[file:images/dwim-shell-command-video-streams/mpv.webp]] What's the secret sauce? Very little. Invoke the awesome [[https://mpv.io/][mpv]] with a wrapping function using =dwim-shell-command-on-marked-files=. #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-mpv-stream-clipboard-url () "Stream clipboard URL using mpv." (interactive) (dwim-shell-command-on-marked-files "Streaming" "mpv --geometry=30%x30%+100%+0% \"<>\"" :utils "mpv" :no-progress t :error-autofocus t :silent-success t)) #+end_src The typical progress bar kinda got in the way, so I added a new option =:no-progress= to =dwim-shell-command-on-marked-files=, so it can be used for cases like this one. * [2022-07-30 Sat] An accentuated Emacs experiment (à la macOS) :PROPERTIES: :CUSTOM_ID: an-accentuated-emacs-experiment :END: macOS has a wonderful input mechanism where you press and hold a key on your keyboard to display the accent menu. It's easy to internalize: /long press "a" if you want to input "á"/. #+ATTR_HTML: :width 70% :height 70% [[file:images/an-accentuated-emacs-experiment/macosaccent.webp]] On Emacs, /C-x 8 ' a/ would be the equivalent, but it just didn't stick for me. Fortunately, there's an alternative, using dead keys. Mickey Petersen gives a [[https://www.masteringemacs.org/article/diacritics-in-emacs][wonderful introduction]]. Having said all this, I still longed for macOS's input mechanism. Thanks to Christian Tietze's [[https://twitter.com/ctietze/status/1552446492559958017][post]], I discovered the [[https://github.com/elias94/accent][accent]] package. While it doesn't handle /press-and-hold/, it does the heavy lifting of offering a menu with character options. If I could just bring that /press-and-hold/... My initial attempt was to use [[https://github.com/emacsorphanage/key-chord][key chords]] (via [[https://github.com/jwiegley/use-package][use-package]]): #+begin_src emacs-lisp :lexical no (use-package accent :ensure t :chords (("aa" . ar/spanish-accent-menu) ("ee" . ar/spanish-accent-menu) ("ii" . ar/spanish-accent-menu) ("oo" . ar/spanish-accent-menu) ("uu" . ar/spanish-accent-menu) ("AA" . ar/spanish-accent-menu) ("EE" . ar/spanish-accent-menu) ("II" . ar/spanish-accent-menu) ("OO" . ar/spanish-accent-menu) ("UU" . ar/spanish-accent-menu) ("nn" . ar/spanish-accent-menu) ("NN" . ar/spanish-accent-menu) ("??" . ar/spanish-accent-menu) ("!!" . ar/spanish-accent-menu)) :config (defun ar/spanish-accent-menu () (interactive) (let ((accent-diacritics '((a (á)) (e (é)) (i (í)) (o (ó)) (u (ú ü)) (A (Á)) (E (É)) (I (Í)) (O (Ó)) (U (Ú Ü)) (n (ñ)) (N (Ñ)) (\? (¿)) (! (¡))))) (ignore-error quit (accent-menu))))) #+end_src While it kinda works, "nn" quickly got in the way of my n/p [[https://magit.vc/][magit]] navigation. Perhaps key chords are still an option for someone who doesn't need the "nn" chord, but being a Spanish speaker, I need that "ñ" from long "n" presses! I'm now trying a little experiment using an =after-change-functions= hook to monitor text input and present the accent menu. I'm sure there's a better way (anyone with ideas?). For now, it gives me something akin to /press-and-hold./ #+ATTR_HTML: :width 80% :height 80% [[file:images/an-accentuated-emacs-experiment/accentuated.webp]] I'm wrapping the hook with a minor mode to easily enable/disable whenever needed. I'm also overriding =accent-diacritics= to only include the characters I typically need. #+begin_src emacs-lisp :lexical no (use-package accent :ensure t :hook ((text-mode . accent-menu-mode) (org-mode . accent-menu-mode) (message-mode . accent-menu-mode)) :config (setq accent-diacritics '((a (á)) (e (é)) (i (í)) (o (ó)) (u (ú ü)) (A (Á)) (E (É)) (I (Í)) (O (Ó)) (U (Ú Ü)) (n (ñ)) (N (Ñ)) (\? (¿)) (! (¡)))) (defvar accent-menu-monitor--last-edit-time nil) (define-minor-mode accent-menu-mode "Toggle `accent-menu' if repeated keys are detected." :lighter " accent-menu mode" (if accent-menu-mode (progn (remove-hook 'after-change-functions #'accent-menu-monitor--text-change t) (add-hook 'after-change-functions #'accent-menu-monitor--text-change 0 t)) (remove-hook 'after-change-functions #'accent-menu-monitor--text-change t))) (defun accent-menu-monitor--text-change (beginning end length) "Monitors text change BEGINNING, END, and LENGTH." (let ((last-edit-time accent-menu-monitor--last-edit-time) (edit-time (float-time))) (when (and (> end beginning) (eq length 0) last-edit-time (not undo-in-progress) ;; 0.27 seems to work for my macOS keyboard settings. ;; Key Repeat: Fast | Delay Until Repeat: Short. (< (- edit-time last-edit-time) 0.27) (float-time (time-subtract (current-time) edit-time)) (accent-menu-monitor--buffer-char-string (1- beginning)) (seq-contains-p (mapcar (lambda (item) (symbol-name (car item))) accent-diacritics) (accent-menu-monitor--buffer-char-string beginning)) (string-equal (accent-menu-monitor--buffer-char-string (1- beginning)) (accent-menu-monitor--buffer-char-string beginning))) (delete-backward-char 1) (ignore-error quit (accent-menu))) (setq accent-menu-monitor--last-edit-time edit-time))) (defun accent-menu-monitor--buffer-char-string (at) (when (and (>= at (point-min)) (< at (point-max))) (buffer-substring-no-properties at (+ at 1))))) #+end_src As a bonus, it ocurred to me that I could use the same /press-and-hold/ to handle question marks in Spanish (from my UK keyboard). #+ATTR_HTML: :width 40% :height 40% [[file:images/an-accentuated-emacs-experiment/porque.webp]] * [2022-07-28 Thu] dwim-shell-command improvements :PROPERTIES: :CUSTOM_ID: dwim-shell-command-improvements :END: Added a few improvements to [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]]. ** Dired region In DWIM style, if you happen to have a [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][dired]] region selected, use region files instead. There's no need to explicitly mark them. #+ATTR_HTML: :width 70% :height 70% [[file:images/dwim-shell-command-improvements/backup_x2.webp]] ** Clipboard (kill-ring) replacement Use =<>= to substitute with clipboard content. This is handy for cloning git repos, using a URL copied from your browser. #+begin_src sh git clone <> #+end_src #+ATTR_HTML: :width 70% :height 70% [[file:images/dwim-shell-command-improvements/clone.webp]] This illustrates =<>= usage, but you may want to use =dwim-shell-commands-git-clone-clipboard-url= from [[https://github.com/xenodium/dwim-shell-command/blob/main/dwim-shell-commands.el][dwim-shell-commands.el]] instead. It does the same thing internally, but makes the command more accessible. #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-git-clone-clipboard-url () "Clone git URL in clipboard to `default-directory'." (interactive) (dwim-shell-command-on-marked-files (format "Clone %s" (file-name-base (current-kill 0))) "git clone <>" :utils "git")) #+end_src ** Counter replacement Use =<>= to substitute with a counter. You can also use =<<3n>>= to start the counter at 3. Handy if you'd like to consistently rename or copy files. #+begin_src sh mv '<>' 'image(<>).png' #+end_src #+ATTR_HTML: :width 70% :height 70% [[file:images/dwim-shell-command-improvements/numberedsorted_x2.2.webp]] Can also use an alphabetic counter with =<>=. Like the numeric version, can use any letter to start the counter with. #+begin_src sh mv '<>' 'image(<>).png' #+end_src #+ATTR_HTML: :width 70% :height 70% [[file:images/dwim-shell-command-improvements/alphacount_x2.2.webp]] ** Prefix counter Use a [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Prefix-Command-Arguments.html][prefix command argument]] on =dwim-shell-commands= to repeat the command a number of times. Combined with a counter, you can make multiple copies of a single file. #+ATTR_HTML: :width 70% :height 70% [[file:images/dwim-shell-command-improvements/repeat.webp]] ** Optional error prompt Set =dwim-shell-command-prompt-on-error= to nil to skip error prompts. Focus process buffers automatically instead. #+ATTR_HTML: :width 70% :height 70% [[file:images/dwim-shell-command-improvements/couldnt.png]] ** Configurable prompt By default, =dwim-shell-command= shows all supported placeholders. You can change that prompt to something shorter using =dwim-shell-command-prompt=. #+ATTR_HTML: :width 90% :height 90% [[file:images/dwim-shell-command-improvements/prompt.jpg]] ** ⚠️ Use with care ⚠️ The changes are pretty fresh. Please use with caution (specially the counter support). * [2022-07-24 Sun] dwim-shell-command on Melpa :PROPERTIES: :CUSTOM_ID: dwim-shell-command-on-melpa :END: #+ATTR_HTML: :width 70% :height 70% #+CAPTION: =<>= gets replaced by a clipboard (kill ring) URL [[file:images/dwim-shell-command-on-melpa/clone.webp]] My pull request to add [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] to [[https://melpa.org/][melpa]] has been [[https://github.com/melpa/melpa/pull/8129][merged]]. Soon, you'll be able to install [[https://melpa.org/#/dwim-shell-command][directly]] from Milkypostman’s Emacs Lisp Package Archive. =dwim-shell-command= is another way to invoke shell commands from our beloved editor. Why a different way? It does lots of little things for you, removing friction you didn't realise you had. You can check out the [[https://github.com/xenodium/dwim-shell-command][README]], but you'll appreciate it much more once you try it out. In addition, it's enabled me to bring lots of command-line tools into my Emacs config and make them highly accessible. You can see my usages over at [[https://github.com/xenodium/dotsies/blob/main/emacs/ar/dwim-shell-command-commands.el][dwim-shell-command-commands.el]]. What kind of command-line tools? ffmpeg, convert, gifsycle, atool, qdpf, plutil, qrencode, du, sips, iconutil, and git (so far anyway). Below is a simple example, but would love to [[https://twitter.com/xenodium][hear]] how you get to use it. #+begin_src emacs-lisp :lexical no (defun dwim-shell-command-audio-to-mp3 () "Convert all marked audio to mp3(s)." (interactive) (dwim-shell-command-on-marked-files "Convert to mp3" "ffmpeg -stats -n -i '<>' -acodec libmp3lame '<>.mp3'" :utils "ffmpeg")) #+end_src I've written about =dwim-shell-command= before: - [[https://xenodium.com/emacs-dwim-shell-command-multi-language/][Emacs: DWIM shell command (multi-language)]] - [[https://xenodium.com/png-to-icns-emacs-dwim-style/][png to icns (Emacs DWIM style)]] - [[https://xenodium.com/emacs-password-protect-current-pdf-revisited/][Emacs: Password-protect current pdf (revisited)]] - [[https://xenodium.com/emacs-dwim-shell-command/][Emacs DWIM shell-command]] [[https://irreal.org/blog/][Irreal]]'s also covered it: - [[https://irreal.org/blog/?p=10674][DWIM Shell Now Supports Multiple Languages]] - [[https://irreal.org/blog/?p=10653][DWIM Shell Commands]] - [[https://irreal.org/blog/?p=10660 ][More Examples of DWIM Shell Commands]] * [2022-07-16 Sat] A lifehack for your shell :PROPERTIES: :CUSTOM_ID: a-lifehack-for-your-shell :END: #+ATTR_HTML: :width 70% :height 70% [[file:images/a-lifehack-for-your-shell/unzip_x2.gif]] I'm a fan of the [[http://infozip.sourceforge.net/mans/unzip.html][unzip]] command line utility that ships with macOS. I give it a .zip file and it unzips it for me. No flags or arguments to remember (for my typical usages anyway). Most importantly, I've fully internalized the =unzip= command into muscle memory, probably because of its /perfect mnemonic/. But then there's .tar, .tar.gz, .tar.xz, .rar, and a whole world of compression archives, often requiring different tools, flags, etc. and I need to remember those too. Can't remember where I got this "life hack" from, but it suggests something along the lines of... #+begin_center /Once you find a lost item at home, place it in the first spot you looked./ #+end_center Great, I'll find things quickly. Win. Now, I still remember a couple of unarchiving commands from memory (looking at you =tar xvzf=), but I've noticed the first word that pops into mind when extracting is always =unzip=. There's the great [[https://www.nongnu.org/atool/][atool]] wrapper out there to extract all kinds of archives (would love to hear of others), but unlucky for me, its name never comes to mind as quickly as =unzip= does. With "life hack" in mind, let's just create an =unzip= [[https://www.gnu.org/software/emacs/manual/html_mono/eshell.html][eshell]] alias to =atool=. Next time I need to unarchive anything, the first word that comes to mind (unzip!) will quickly get me on my way... #+begin_src sh alias unzip 'atool --extract --explain $1' #+end_src Or if you prefer to add to your Emacs config: #+begin_src emacs-lisp :lexical no (eshell/alias "unzip" "atool --extract --explain $1") #+end_src While [[https://xenodium.com/yasnippet-in-emacs-eshell/][I'm fan of Emacs eshell]], it's not everyone's cup of tea. Lucky for us all, aliases are a popular feature across shells. Happy unzipping! ** Bonus Since I'm a keen on using "unzip" mnemonic everywhere in Emacs (not just my shell), I now have a [[https://xenodium.com/emacs-dwim-shell-command/][DWIM shell-command]] for it: #+begin_src emacs-lisp :lexical no (defun dwim-shell-command-unzip () "Unzip all marked archives (of any kind) using `atool'." (interactive) (dwim-shell-command-on-marked-files "Unzip" "atool --extract --explain '<>'" :utils "atool")) #+end_src #+ATTR_HTML: :width 70% :height 70% [[file:images/a-lifehack-for-your-shell/unzip-dired_x1.5.gif]] ** UPDATE: [[https://lobste.rs/][Lobste.rs]] has great [[https://lobste.rs/s/qaimmg/lifehack_for_your_shell][comments]]. Thanks all: *** Aliases missing on remote machines Concerns about aliases [[https://lobste.rs/s/qaimmg/lifehack_for_your_shell#c_mqxo73][not available on remote machines]]. Valid. Certainly brings challenges if you can't modify the environment on the remote machine. The severity would depend on how frequently you have to do this. Fortunately for me, it's infrequent. Additionally, if accessing remote machine via [[https://www.gnu.org/software/emacs/manual/html_mono/eshell.html][eshell]], this is a non-issue. You get to transparently bring most of your environment with you anyway. *** Unzip keyword is overloaded The alias is [[https://lobste.rs/s/qaimmg/lifehack_for_your_shell#c_78nnwt][overloading the unzip command]]. I know. It's a little naughty. Going with it for now. I used to use "extract" (also in comments), which I still like but somehow "unzip" still wins my memory race. [[https://lobste.rs/s/qaimmg/lifehack_for_your_shell#c_73bzze][There's also "x"]] (nice option), which seems to originate from [[https://github.com/sorin-ionescu/prezto][prezto]]. I could consider unzipp, unzip1, or some other variation. Not sure how I missed this, but there's also an [[https://lobste.rs/s/qaimmg/lifehack_for_your_shell#c_ra6sbf][existing alias for atool]]: aunpack. Could be a great alternative. *** Pause before extracting archives Valid [[https://lobste.rs/s/qaimmg/lifehack_for_your_shell#c_73bzze][point]]. In my case, the pause typically happens /before/ I invoke the alias. *** Littering If the archive didn't have a root dir, it can [[https://lobste.rs/s/qaimmg/lifehack_for_your_shell#c_7fsart][litter your current directory]]. Indeed a pain to clean up. For this, we can atool's =--subdir= param to /always create subdirectory when extracting/. *** Alias to retrain [[https://lobste.rs/s/qaimmg/lifehack_for_your_shell#c_yr1jby][Neat trick]]: =alias unzip = “echo ‘use atool’”= to help retrain yourself. Reminds me of Emacs [[https://github.com/bbatsov/guru-mode][guru-mode]]. *** atool alternatives Nice to see other options suggested [[https://github.com/moonpyk/dtrx][dtrx]] ([[https://lobste.rs/s/qaimmg/lifehack_for_your_shell#c_mutdjl][comment]]), [[https://github.com/mholt/archiver][archiver]] ([[https://lobste.rs/s/qaimmg/lifehack_for_your_shell#c_nlsk7w][comment]]), [[https://github.com/ashang/unar][unar]] ([[https://lobste.rs/s/qaimmg/lifehack_for_your_shell#c_90dk1l][comment]]), bsdtar from [[https://github.com/libarchive/libarchive][libarchive]] ([[https://lobste.rs/s/qaimmg/lifehack_for_your_shell#c_ojy6ah][comment]]), [[https://packages.debian.org/stable/unp][unp]], [[https://wummel.github.io/patool/][patool]], and the tangentially related [[https://www.nongnu.org/zutils/zutils.html][zgrep]] ([[https://lobste.rs/s/qaimmg/lifehack_for_your_shell#c_vp8fdw][comment]]). * [2022-07-13 Wed] Emacs zones to lift you up :PROPERTIES: :CUSTOM_ID: emacs-zones-to-lift-you-up :END: #+ATTR_HTML: :width 90% :height 90% [[file:images/emacs-zoneb-tob-lift-you-up/zone.gif]] As I prune my [[https://github.com/xenodium/dotsies/][Emacs config]] off, I came across a forgotten bit of elisp I wrote about 6 years ago. While it's not going to power up your Emacs fu, it may lift your spirits, or maybe just aid discovery of new words. You see, I had forgotten about [[https://github.com/emacs-mirror/emacs/blob/master/lisp/play/zone.el][zone.el]] altogether: a fabulous package to tickle your heart. You can think of it as screensaver built into Emacs. If the built-in zones don't do it for ya, check out the few on melpa ([[https://depp.brause.cc/zone-nyan/][nyan]], [[https://github.com/kawabata/zone-sl][sl]], and [[https://xenodium.com/added-emacs-zone-rainbow/][rainbow]]). So, my nostalgic bit of elisp dates =Jun 17 2016=: a basic but functional zone ([[https://github.com/xenodium/dotsies/blob/main/emacs/ar/zone-words.el][zone-words]]), displaying words from [[http://wordnet.princeton.edu/][WordNet]]. Surely the package can use plenty of improvements ([[https://github.com/xenodium/dotsies/commit/00215e215be1413ea9d0085dd2de5123c635b8c0][here's one]]), but hey this is Emacs and pretty much all existing code will run, no matter how old. In Emacs time, 2016 is practically yesterday! * [2022-07-10 Sun] Emacs: DWIM shell command (multi-language) :PROPERTIES: :CUSTOM_ID: emacs-dwim-shell-command-multi-language :END: UPDATE: [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] is now available on [[https://melpa.org/#/dwim-shell-command][melpa]]. #+ATTR_HTML: :width 70% :height 70% [[file:images/emacs-dwim-shell-command-multi-language/csv.gif]] I keep on [[https://xenodium.com/png-to-icns-emacs-dwim-style/][goofying around]] with [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] and it's sibling =dwim-shell-command-on-marked-files= from [[https://github.com/xenodium/dwim-shell-command/blob/main/dwim-shell-command.el][dwim-shell-command.el]]. In addition to defaulting to [[https://en.wikipedia.org/wiki/Z_shell][zsh]], =dwim-shell-command-on-marked-files= now support other shells and languages. This comes in handy if you have snippets in different languages and would like to easily invoke them from Emacs. Multi-language support enables "using the best tool for the job" kinda thing. Or maybe you just happen to know how to solve a particular problem in a specific language. Let's assume you have an existing Python snippet to convert files from csv to json. With =dwim-shell-command-on-marked-files=, you can invoke the Python snippet to operate on either [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][dired]] or buffer files. #+begin_src emacs-lisp :lexical no (defun dwim-shell-command-csv-to-json-via-python () "Convert csv file to json (via Python)." (interactive) (dwim-shell-command-on-marked-files "Convert csv file to json (via Python)." " import csv import json text = json.dumps({ \"values\": list(csv.reader(open('<>')))}) fpath = '<>.json' with open(fpath , 'w') as f: f.write(text)" :shell-util "python" :shell-args "-c")) #+end_src Or, maybe you prefer Swift and already had a snippet for the same thing? #+begin_src emacs-lisp :lexical no (defun dwim-shell-command-csv-to-json-via-swift () "Convert csv file to json (via Swift)." (interactive) (dwim-shell-command-on-marked-files "Convert csv file to json (via Swift)." " import Foundation import TabularData let filePath = \"<>\" print(\"reading \\(filePath)\") let content = try String(contentsOfFile: filePath).trimmingCharacters(in: .whitespacesAndNewlines) let parsedCSV = content.components(separatedBy: CSVWritingOptions().newline).map{ $0.components(separatedBy: \",\") } let jsonEncoder = JSONEncoder() let jsonData = try jsonEncoder.encode([\"value\": parsedCSV]) let json = String(data: jsonData, encoding: String.Encoding.utf8) let outURL = URL(fileURLWithPath:\"<>.json\") try json!.write(to: outURL, atomically: true, encoding: String.Encoding.utf8) print(\"wrote \\(outURL)\")" :shell-pipe "swift -")) #+end_src You can surely solve the same problem in elisp, but hey it's nice to have options and flexibility. * [2022-07-09 Sat] png to icns (Emacs DWIM style) :PROPERTIES: :CUSTOM_ID: png-to-icns-emacs-dwim-style :END: UPDATE: [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] is now available on [[https://melpa.org/#/dwim-shell-command][melpa]]. #+ATTR_HTML: :width 70% :height 70% [[file:images/png-to-icns-emacs-dwim-style/icns.gif]] Since [[https://xenodium.com/emacs-dwim-shell-command/][writing a DWIM version of the shell-command]], I've been having a little fun [[https://xenodium.com/emacs-password-protect-current-pdf-revisited/][revisiting command line utilities]] I sometimes invoke from my beloved editor. In this instance, converting a png file to an icns icon. What's more interesting about this case is that it's not just a one-liner, but a short script in itself. Either way, it's just as easy to invoke from Emacs using =dwim-shell-command--on-marked-files=. #+begin_src emacs-lisp :lexical no (defun dwim-shell-command-convert-image-to-icns () "Convert png to icns icon." (interactive) (dwim-shell-command-on-marked-files "Convert png to icns icon" " # Based on http://stackoverflow.com/questions/12306223/how-to-manually-create-icns-files-using-iconutil # Note: png must be 1024x1024 mkdir <>.iconset sips -z 16 16 '<>' --out '<>.iconset/icon_16x16.png' sips -z 32 32 '<>' --out '<>.iconset/icon_16x16@2x.png' sips -z 32 32 '<>' --out '<>.iconset/icon_32x32.png' sips -z 64 64 '<>' --out '<>.iconset/icon_32x32@2x.png' sips -z 128 128 '<>' --out '<>.iconset/icon_128x128.png' sips -z 256 256 '<>' --out '<>.iconset/icon_128x128@2x.png' sips -z 256 256 '<>' --out '<>.iconset/icon_256x256@2x.png' sips -z 512 512 '<>' --out '<>.iconset/icon_512x512.png' sips -z 512 512 '<>' --out '<>.iconset/icon_256x256@2x.png' sips -z 1024 1024 '<>' --out '<>.iconset/icon_512x512@2x.png' iconutil -c icns '<>.iconset'" :utils '("sips" "iconutil") :extensions "png")) #+end_src * [2022-07-09 Sat] Emacs: Password-protect current pdf (revisited) :PROPERTIES: :CUSTOM_ID: emacs-password-protect-current-pdf-revisited :END: UPDATE: [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] is now available on [[https://melpa.org/#/dwim-shell-command][melpa]]. #+ATTR_HTML: :width 70% :height 70% [[file:images/emacs-password-protect-current-pdf-revisited/passprotect.gif]] With a recent look at writing [[https://xenodium.com/emacs-dwim-shell-command/][DWIM shell commands]], I've been revisiting my custom Emacs functions invoking command line utilities. Take this [[https://xenodium.com/emacs-password-protect-current-pdf/][post]], for example, where I invoke [[https://github.com/qpdf/qpdf][qpdf]] via a elisp. Using the new =dwim-shell-command--on-marked-files= in [[https://github.com/xenodium/dwim-shell-command/blob/main/dwim-shell-command.el][dwim-shell-command.el]], the code is stripped down to a bare minimum: #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-pdf-password-protect () "Password protect pdf." (interactive) (dwim-shell-command-on-marked-files "Password protect pdf" (format "qpdf --verbose --encrypt '%s' '%s' 256 -- '<>' '<>_enc.<>'" (read-passwd "user-password: ") (read-passwd "owner-password: ")) :utils "qpdf" :extensions "pdf")) #+end_src Compare the above =dwim-shell-command--on-marked-files= usage to my [[https://xenodium.com/emacs-password-protect-current-pdf/][previous implementation]]: #+begin_src emacs-lisp :lexical no (defun pdf-password-protect () "Password protect current pdf in buffer or `dired' file." (interactive) (unless (executable-find "qpdf") (user-error "qpdf not installed")) (unless (equal "pdf" (or (when (buffer-file-name) (downcase (file-name-extension (buffer-file-name)))) (when (dired-get-filename nil t) (downcase (file-name-extension (dired-get-filename nil t)))))) (user-error "no pdf to act on")) (let* ((user-password (read-passwd "user-password: ")) (owner-password (read-passwd "owner-password: ")) (input (or (buffer-file-name) (dired-get-filename nil t))) (output (concat (file-name-sans-extension input) "_enc.pdf"))) (message (string-trim (shell-command-to-string (format "qpdf --verbose --encrypt '%s' '%s' 256 -- '%s' '%s'" user-password owner-password input output)))))) #+end_src This really changes things for me. I'll be more inclined to add more of these tiny integrations to lots of great command line utilities. Take this recent [[https://news.ycombinator.com/item?id=32028752][Hacker News post]] on [[https://github.com/ocrmypdf/OCRmyPDF][ocrmypdf]] as an example. Their [[https://ocrmypdf.readthedocs.io/en/latest/cookbook.html][cookbook]] has lots of examples that can be easily used via =dwim-shell-command--on-marked-files=. What command line utils would you use? * [2022-07-07 Thu] Emacs DWIM shell-command :PROPERTIES: :CUSTOM_ID: emacs-dwim-shell-command :END: UPDATE: [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] is now available on [[https://melpa.org/#/dwim-shell-command][melpa]]. I've [[https://xenodium.com/emacs-dwim-do-what-i-mean/][talked about DWIM before]], where I bend Emacs to help me do what I mean. Emacs is also great for [[https://xenodium.com/emacs-password-protect-current-pdf/][wrapping command-line one-liners with elisp]], so I can quickly invoke commands without thinking too much about flags, arguments, etc. I keep thinking the [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Shell.html][shell-command]] is ripe for plenty of enhancements using our DWIM fairydust. ** Do what I mean how? *** Smart template instantiation I've drawn inspiration from [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Shell-Commands-in-Dired.html][dired-do-shell-command]], which substitutes special characters like * and ? with marked files. I'm also drawing inspiration from [[https://orgmode.org/worg/org-contrib/babel/][org babel]]'s [[https://orgmode.org/manual/Noweb-Reference-Syntax.html][noweb]] syntax to substitute =<>= (file path), =<>= (file path without extension), and =<>= (extension). My initial preference was to use something like =$f=, =$fne=, and =$e=, but felt they clashed with shell variables. #+ATTR_HTML: :width 70% :height 70% [[file:images/emacs-dwim-shell-command/template.png]] *** Operate on dired marked files This is DWIM, so if we're visiting a [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][dired]] buffer, the shell command should operate on all the marked files. #+ATTR_HTML: :width 70% :height 70% [[file:images/emacs-dwim-shell-command/diredmark.gif]] *** Operate on current buffer file Similarly, if visiting a buffer with an associated file, operate on that file instead. #+ATTR_HTML: :width 90% :height 90% [[file:images/emacs-dwim-shell-command/blur.png]] *** Automatically take me to created files Did the command create a new file in the current directory? Take me to it, right away. #+ATTR_HTML: :width 50% :height 50% [[file:images/emacs-dwim-shell-command/showme.png]] *** Show me output on error I'm not usually interested in the command output when generating new files, unless there was an error of course. Offer to show it. #+ATTR_HTML: :width 70% :height 70% [[file:images/emacs-dwim-shell-command/couldnt.png]] *** Show me output if no new files Not all commands generate new files, so automatically show me the output for these instances. #+ATTR_HTML: :width 50% :height 50% [[file:images/emacs-dwim-shell-command/apple.gif]] *** Make it easy to create utilities [[https://ffmpeg.org/][ffmpeg]] is awesome, but man I can never remember all the flags and arguments. I may as well wrap commands like these in a convenient elisp function and invoke via [[https://www.gnu.org/software/emacs/manual/html_node/efaq/Extended-commands.html][execute-extended-command]], or my favorite [[http://oremacs.com/swiper/#minibuffer-key-bindings][counsel-M-x]] (with completion), bound to the vital =M-x=. All those gifs you see in this post were created with =dwim-shell-command-convert-to-gif=, powered by the same elisp magic. #+begin_src emacs-lisp :lexical no (defun dwim-shell-command-convert-to-gif () "Convert all marked videos to optimized gif(s)." (interactive) (dwim-shell-command--on-marked-files "Convert to gif" "ffmpeg -loglevel quiet -stats -y -i <> -pix_fmt rgb24 -r 15 <>.gif" :utils "ffmpeg")) #+end_src #+ATTR_HTML: :width 70% :height 70% [[file:images/emacs-dwim-shell-command/togif_x1.5.gif]] This makes wrapping one-liners a breeze, so let's do some more... #+begin_src emacs-lisp :lexical no (defun dwim-shell-command-convert-audio-to-mp3 () "Convert all marked audio to mp3(s)." (interactive) (dwim-shell-command-on-marked-files "Convert to mp3" "ffmpeg -stats -n -i '<>' -acodec libmp3lame '<>.mp3'" :utils "ffmpeg")) (defun dwim-shell-command-convert-image-to-jpg () "Convert all marked images to jpg(s)." (interactive) (dwim-shell-command-on-marked-files "Convert to jpg" "convert -verbose '<>' '<>.jpg'" :utils "convert")) (defun dwim-shell-command-drop-video-audio () "Drop audio from all marked videos." (interactive) (dwim-shell-command-on-marked-files "Drop audio" "ffmpeg -i '<>' -c copy -an '<>_no_audio.<>'" :utils "ffmpeg")) #+end_src *** Make it spin ;) Ok, not quite, but use Emacs's [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Progress.html][progress-reporter]] just for kicks. #+ATTR_HTML: :width 50% :height 50% [[file:images/emacs-dwim-shell-command/progress.gif]] ** Use it everywhere =dwim-shell-command= covers my needs (so far anyway), so I'm binding it to existing bindings. #+begin_src emacs-lisp :lexical no (use-package dwim-shell-command :bind ("M-!" . dwim-shell-command)) (use-package dired :bind (:map dired-mode-map ([remap dired-do-async-shell-command] . dwim-shell-command) ([remap dired-do-shell-command] . dwim-shell-command) ([remap dired-smart-shell-command] . dwim-shell-command))) #+end_src ** Bring those command line utilities On the whole, this really changes things for me. I'll be more inclined to bring command line utilities to seamless Emacs usage. Take this recent [[https://news.ycombinator.com/item?id=32028752][Hacker News post]] on [[https://github.com/ocrmypdf/OCRmyPDF][ocrmypdf]] as an example. Their [[https://ocrmypdf.readthedocs.io/en/latest/cookbook.html][cookbook]] has lots of examples that can be easily used via =dwim-shell-command--on-marked-files=. What command line utilities would you bring? ** Where's the code? UPDATE: [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] is now available on [[https://melpa.org/#/dwim-shell-command][melpa]]. The code for [[https://github.com/xenodium/dotsies/blob/main/emacs/ar/dwim-shell-command.el][dwim-shell-command.el]] is likely a bit rough still, but you can take a peak if interested. Keep in mind this is DWIM, tailored for what ✨I✨ mean. Some of the current behavior may not be your cup of tea, but this is Emacs. You can bend it to do what ✨you✨ mean. Happy Emacsing. * [2022-06-02 Thu] Emacs: Password-protect current pdf :PROPERTIES: :CUSTOM_ID: emacs-password-protect-current-pdf :END: UPDATE: Check out [[https://xenodium.com/emacs-password-protect-current-pdf-revisited][Password-protect current pdf (revisted)]] for a simpler version. Every so often, I need to password-protect a pdf. On macOS, [[https://support.apple.com/en-gb/guide/preview/prvw587dd90f/mac][Preview has a simple solution]], but I figured there must be a command line utility to make this happen. There are options, but [[https://github.com/qpdf/qpdf][qdf]] did the job just fine. #+begin_src sh qpdf --verbose --encrypt USER-PASSWORD OWNER-PASSWORD KEY-LENGTH -- input.pdf output.pdf #+end_src So what does ~qpdf~ have to do with Emacs? Command-line utilities are easy to invoke from Emacs via ~shell-command~ (M-!), but I don't want to remember the command nor the parameters. I may as well add a function that [[https://xenodium.com/emacs-dwim-do-what-i-mean/][does what I mean]] and password-protect either buffers or [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][dired]] files. #+begin_src emacs-lisp :lexical no (defun pdf-password-protect () "Password protect current pdf in buffer or `dired' file." (interactive) (unless (executable-find "qpdf") (user-error "qpdf not installed")) (unless (equal "pdf" (or (when (buffer-file-name) (downcase (file-name-extension (buffer-file-name)))) (when (dired-get-filename nil t) (downcase (file-name-extension (dired-get-filename nil t)))))) (user-error "no pdf to act on")) (let* ((user-password (read-passwd "user-password: ")) (owner-password (read-passwd "owner-password: ")) (input (or (buffer-file-name) (dired-get-filename nil t))) (output (concat (file-name-sans-extension input) "_enc.pdf"))) (message (string-trim (shell-command-to-string (format "qpdf --verbose --encrypt '%s' '%s' 256 -- '%s' '%s'" user-password owner-password input output)))))) #+end_src * [2022-04-24 Sun] Plain Org v1.4 released :PROPERTIES: :CUSTOM_ID: plain-org-v14-released :END: [[https://plainorg.com][Plain Org]] v1.4 is now available on the [[https://apps.apple.com/app/id1578965002][App Store]]. I was on a long flight recently 🦘, so I gave list and checkbox editing a little love. There's a couple of other minor improvements included. If you haven't heard of [[https://plainorg.com][Plain Org]], it gives you access to [[https://orgmode.org][org]] files on iPhone while away from your beloved [[https://www.gnu.org/software/emacs/][Emacs]]. I love org markup, but we (iPhone + org users) are a fairly niche bunch. If you're finding Plain Org useful, *please help support this effort* by getting the word out. Tell your friends, [[https://twitter.com/intent/tweet?text=Plain%20Org%20https%3A%2F%2Fapps.apple.com%2Fapp%2Fid1578965002%20][tweet]], or blog about it. On to v1.4 release notes... ** Improved list/checkbox editing Adding list or checkbox items is traditionally cumbersome via the iPhone's keyboard. This release adds new toolbar actions and smart return to simplify things. #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v14-released/list_this.gif]] ** Render form feed characters Form feed characters are now rendered within expanded headings. #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v14-released/form_feed.jpg]] Note: There's a limitation. Form feed characters at the end of a heading aren't currently displayed. ** Other Increased all button tap areas in edit toolbar. This should hopefully improve interaction. * [2022-04-15 Fri] Plain Org v1.3 released :PROPERTIES: :CUSTOM_ID: plain-org-v130-released :END: [[https://plainorg.com][Plain Org]] v1.3 is now available on the [[https://apps.apple.com/app/id1578965002][App Store]]. The update receives a few features, bug fixes, and improvements. If you haven't heard of [[https://plainorg.com][Plain Org]], it gives you access to [[https://orgmode.org][org]] files on iPhone while away from your beloved [[https://www.gnu.org/software/emacs/][Emacs]]. I love org markup, but we (iPhone + org users) are a fairly niche bunch. If you're finding Plain Org useful, *please help support this effort* by getting the word out. Tell your friends, [[https://twitter.com/intent/tweet?text=Plain%20Org%20https%3A%2F%2Fapps.apple.com%2Fapp%2Fid1578965002%20][tweet]], or blog about it. On to v1.3 release notes... ** Toggle recurring tasks You can now toggle recurring tasks with either catchup =<2022-04-15 Fri ++1d>=, restart =<2022-04-15 Fri .+1d>=, or cumulate =<2022-04-15 Fri +1d>= repeaters. #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v130-released/recurring.gif]] ** Log state transitions #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v130-released/logging.gif]] ** Fullscreen view The navigation bar now hides on scroll. This can be enabled/disabled via =View > Full Screen= menu. #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v130-released/fullscreen.gif]] The previous screenshot text comes from [[http://doc.norang.ca/org-mode.html][Org Mode - Organize Your Life In Plain Text]], a magnificent org resource. ** Deadline and scheduled date rendered In the past, =SCHEDULED= and =DEADLINE= were rendered (but only one of them at a time). Now both are rendered alongside each other (deadline has an orange tint). #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v130-released/deadline_scheduled.png]] ** Roundtripping fidelity Many roundtripping fidelity improvements included in 1.3. Shoutout to [[https://www.reddit.com/user/Oerm/][u/Oerm]] who reported [[https://www.reddit.com/r/plainorg/comments/ty7onh/changing_todo_status_of_one_item_triggers/][unnecessary formatting changes]] in unmodified areas and helped test all fixes. ** Other bug fixes improvements - Disable raw text edit menu when file is not accessible. - Minor improvements to inline editing layouts (vertical height and drawers). - ABRT and HABIT now recognized as a popular keywords. - Improve state transition alignment to match org mode behaviour. - Fixes roundtripping state transition notes (leading to data loss). - Log creation from share sheet. - Increment DEADLINE *and* SCHEDULED, not just first found. - Roundtrip more whitespace in untouched areas. - Fixes org syntax inadvertently parsed within begin_src blocks (leading to data loss). * [2022-03-27 Sun] Plain Org v1.2.1 released :PROPERTIES: :CUSTOM_ID: plain-org-v121-released :END: [[https://plainorg.com][Plain Org]] v1.2.1 is now available on the [[https://apps.apple.com/app/id1578965002][App Store]]. The update receives minor features, bug fixes, and improvements. If you haven't heard of [[https://plainorg.com][Plain Org]], it gives you access to [[https://orgmode.org][org]] files on iPhone while away from your beloved [[https://www.gnu.org/software/emacs/][Emacs]]. I love org markup, but we (iPhone + org users) are a fairly niche userbase. If you're finding Plain Org useful, *please help support this effort* by getting the word out. Tell your friends, [[https://twitter.com/intent/tweet?text=Plain%20Org%20https%3A%2F%2Fapps.apple.com%2Fapp%2Fid1578965002%20][tweet]], or blog about it. On to v1.2.1 release notes... ** Render LOGBOOK State transitions and LOGBOOK drawers are now recognized and rendered as such. Either of the following snippets are rendered as togglable LOGBOOK drawers. #+begin_src org ,* TODO Feed the fish - State "DONE" from "TODO" [2022-03-11 Fri 12:23] #+end_src #+begin_src org ,* TODO Feed the cat :LOGBOOK: - State "DONE" from "TODO" [2022-03-11 Fri 12:23] :END: #+end_src #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v121-released/logbook.jpg]] ** Add task to top/bottom Up until now, tasks were always appended to the bottom of things. This didn't work so well if you like seeing recent items bubbling up to the top. This version adds a new setting: /Settings/ > /Add new tasks to/ > /Top/Bottom/, giving you the choice. Note: Top is the new default value, please change this setting if you'd like to keep the previous behaviour. #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v121-released/top_bottom.png]] ** Checking for changes Local file changes aren't always detected via [[https://developer.apple.com/documentation/uikit/uidocument/1619945-statechangednotification][state change notifications]], so additional checks are now in place to offer reloading files. #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v121-released/reload.jpg]] ** Open inactive files After adding new tasks via iOS's share sheet, if the item was added to a file other than the active one, offer to open that instead. #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v121-released/load_other.jpg]] ** Other improvements - Color keyword red/green depending on #+TODO: position. - Round-trip planning order (SCHEDULED, CLOSED, DEADLINE). - Improve tag alignment to match org mode behaviour (best effort, sorry). - Improve vertical spacing prior to lists. - Improve share sheet reliability. - Fix opening local links from list items. - Fix indent for list items without previous content. - Fix race condition in adding TITLE and ID to new files. - Fix incorrect keyword color selection in search toolbar. - Fix menu inadvertently closing. - Fix menu tapping for iPad. * [2022-03-26 Sat] Emacs DWIM: swiper vs isearch vs phi-search :PROPERTIES: :CUSTOM_ID: emacs-dwim-swiper-vs-isearch-vs-phi-search :END: #+ATTR_HTML: :width 75% :height 75% [[file:images/emacs-dwim-swiper-vs-isearch-vs-phi-search/search-dwim.gif]] I've [[https://xenodium.com/emacs-dwim-do-what-i-mean/][talked about DWIM]] in the past, that wonderful Emacs ability to [[https://en.wikipedia.org/wiki/DWIM][do what ✨I✨ mean]]. Emacs being hyper-configurable, we can always teach it more things, so it can do exactly what we mean. There are no shortages of buffer searching packages for Emacs. I'm a fan of Oleh Krehel's [[https://github.com/abo-abo/swiper][swiper]], but before that, I often relied on the built-in [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Basic-Isearch.html][isearch]]. Swiper is my default goto mechanism and have it bound to =C-s= (replacing the built-in [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Basic-Isearch.html][isearch-forward]]). Swiper services most needs until I start combining with other tools. Take [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Keyboard-Macros.html][keyboard macros]] and [[https://github.com/magnars/multiple-cursors.el][multiple cursors]]. Both wonderful, but neither can rely on swiper to do their thing. Ok, swiper does, but [[https://xenodium.com/emacs-swiper-and-multiple-cursors/][in a different way]]. Rather than binding =C-s= to swiper, let's write a DWIM function that's aware of macros and multiple cursors. It must switch between swiper, isearch, and [[https://github.com/avkoval/phi-search][phi-search]] depending on what I want (search buffer, define macro, or search multiple cursors). Let's also tweak swiper's behavior a little further and prepopulate its search term with the active region. Oh, and I also would like swiper to wrap around (see [[http://oremacs.com/swiper/][ivy-wrap]]). But only swiper, not other ivy utilities. I know, I'm picky, but that's the whole point of DWIM... so here's my function to search forward that does exactly what ✨I✨ mean: #+begin_src emacs-lisp :lexical no (defun ar/swiper-isearch-dwim () (interactive) ;; Are we using multiple cursors? (cond ((and (boundp 'multiple-cursors-mode) multiple-cursors-mode (fboundp 'phi-search)) (call-interactively 'phi-search)) ;; Are we defining a macro? (defining-kbd-macro (call-interactively 'isearch-forward)) ;; Fall back to swiper. (t ;; Wrap around swiper results. (let ((ivy-wrap t)) ;; If region is active, prepopulate swiper's search term. (if (and transient-mark-mode mark-active (not (eq (mark) (point)))) (let ((region (buffer-substring-no-properties (mark) (point)))) (deactivate-mark) (swiper-isearch region)) (swiper-isearch)))))) #+end_src The above snippet searches forward, but I'm feeling a little off-balance. Let's write an equivalent to search backwards. We can then bind it to =C-r=, also overriding the built-in [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Basic-Isearch.html][isearch-backward]]. #+begin_src emacs-lisp :lexical no (defun ar/swiper-isearch-backward-dwim () (interactive) ;; Are we using multiple cursors? (cond ((and (boundp 'multiple-cursors-mode) multiple-cursors-mode (fboundp 'phi-search-backward)) (call-interactively 'phi-search-backward)) ;; Are we defining a macro? (defining-kbd-macro (call-interactively 'isearch-backward)) ;; Fall back to swiper. (t ;; Wrap around swiper results. (let ((ivy-wrap t)) ;; If region is active, prepopulate swiper's search term. (if (and transient-mark-mode mark-active (not (eq (mark) (point)))) (let ((region (buffer-substring-no-properties (mark) (point)))) (deactivate-mark) (swiper-isearch-backward region)) (swiper-isearch-backward)))))) #+end_src These may be on the hacky side of things, but hey... they do the job. If there are better/supported ways of accomplishing a similar thing, I'd love to [[https://twitter.com/xenodium][hear about it]]. * [2022-03-12 Sat] Grandma's vanilla pound cake :PROPERTIES: :CUSTOM_ID: grandmas-vanilla-pound-cake :END: #+ATTR_HTML: :width 50% :height 50% [[file:images/grandmas-vanilla-pound-cake/pound_cake.jpg]] My grandmother Hilda used to bake this for us grandkids. I don't know the origin of the recipe, but my parents, aunts, and cousins, they all bake it too. I'm a big fan, but only get to eat it when visiting. Yesterday, I changed that. Finally baked it myself \o/ ** Ingredients - 200g salted butter - 2 cups (400 g) sugar - 4 eggs - 3 cups (375 g) plain flour - 3 teaspoons baking powder - 1 tablespoon (15 ml) vanilla extract - 1 cup (250 ml) milk - 2 tablespoons (30 ml) Málaga Virgen wine (port works too) ** Prep - Ensure all ingredients are at room temperature before you start. - Preheat oven at 175C. - Separate egg yolks and whites. Keep both. - Consolidate liquids into a bowl (milk + wine + vanilla). - Consolidate sifted powders into a bowl (flour + baking powder). ** Meringue - Beat egg whites into a snowy meringue. Set aside. ** Mixer - Beat butter in the mixer until creamy (important). - Add sugar and mix thoroughly ensuring creamy consistency remains (important). - Mix yolks in thoroughly one by one. - Mix in the meringue. - You're done with the mixer. ** Hand mixing - With a wooden spoon, alternate hand mixing the liquids and the powders. Start with liquids and end with powders. ** Pour into mould - Pour the mix into a non-stick baking mould. ** Bake - Bake in oven between 60 and 70 mins, but don’t be afraid to leave longer if needed. Mileage varies across ovens. - Use a cake tester after 60 minutes to decide how much longer to bake for (if needed). * [2022-03-05 Sat] Emacs: viewing webp images :PROPERTIES: :CUSTOM_ID: emacs-viewing-webp-images :END: There's a recent reddit post asking how to [[https://www.reddit.com/r/emacs/comments/t76isx/viewing_webp_images_in_emacs/][view webp images in Emacs]]. I didn't know the answer, but it's something I had wanted for some time. This post was a nice reminder to go and check things out. Was happy to [[https://www.reddit.com/r/emacs/comments/t76isx/comment/hzft7ww/?utm_source=share&utm_medium=web2x&context=3][contribute an answer]]. Turns out, it's very simple. Just set =image-use-external-converter= and install relevant external tools. #+begin_src emacs-lisp :lexical no (setq image-use-external-converter t) #+end_src I'm a =use-package= user, so I prefer to set with: #+begin_src emacs-lisp :lexical no (use-package image :custom ;; Enable converting external formats (ie. webp) to internal ones. (image-use-external-converter t)) #+end_src So what are the external tools needed? =C-h v= =image-use-external-converter= gives us the info we need: #+begin_quote If non-nil, create-image will use external converters for exotic formats. Emacs handles most of the common image formats (SVG, JPEG, PNG, GIF and some others) internally, but images that don't have native support in Emacs can still be displayed if an external conversion program (like ImageMagick "convert", GraphicsMagick "gm" or "ffmpeg") is installed. This variable was added, or its default value changed, in Emacs 27.1. #+end_quote I happen to be a macOS user, so I install ImageMagick with: #+begin_src sh brew install imagemagick #+end_src * [2022-02-21 Mon] Emacs: Fuzzy search Apple's online docs :PROPERTIES: :CUSTOM_ID: emacs-fuzzy-search-apples-online-docs :END: #+ATTR_HTML: :width 90% :height 90% [[file:images/emacs-fuzzy-search-apples-online-docs/color_search.gif]] When building software for the Apple ecosystem, Xcode is often the editor of choice. With [[https://www.gnu.org/software/emacs/][Emacs]] being my personal preference, I rarely find other iOS devs with a similar mindset. When I saw [[https://twitter.com/konrad1977][Mikael Konradsson]]'s post describing [[https://www.reddit.com/r/emacs/comments/sndriv/i_finally_got_full_autocompetion_in_swift_with/][his Emacs Swift development setup]], I reached out to say hello. While exchanging tips and tricks, the topic of searching Apple's docs came up. It had been a while since I looked into this, so it was a great reminder to revisit the space. Back in June 2020, I wrote a snippet to [[https://xenodium.com/emacs-search-hackingwithswiftcom/][fuzzy search hackingwithswift.com]], using Emacs's [[https://github.com/abo-abo/swiper][ivy]] completion framework. With a similar online API, we could also search Apple's docs. Turns out, there is and we can we can use it to search [[https://developer.apple.com/search][developer.apple.com]] from our beloved editor. #+begin_src emacs-lisp :lexical no ;;; counsel-apple-search.el -*- lexical-binding: t; -*- (defun ar/counsel-apple-search () "Ivy interface for dynamically querying apple.com docs." (interactive) (require 'request) (require 'json) (require 'url-http) (ivy-read "apple docs: " (lambda (input) (let* ((url (url-encode-url (format "https://developer.apple.com/search/search_data.php?q=%s" input))) (c1-width (round (* (- (window-width) 9) 0.3))) (c2-width (round (* (- (window-width) 9) 0.5))) (c3-width (- (window-width) 9 c1-width c2-width))) (or (ivy-more-chars) (let ((request-curl-options (list "-H" (string-trim (url-http-user-agent-string))))) (request url :type "GET" :parser 'json-read :success (cl-function (lambda (&key data &allow-other-keys) (ivy-update-candidates (mapcar (lambda (item) (let-alist item (propertize (format "%s %s %s" (truncate-string-to-width (propertize (or .title "") 'face '(:foreground "yellow")) c1-width nil ?\s "…") (truncate-string-to-width (or .description "") c2-width nil ?\s "…") (truncate-string-to-width (propertize (string-join (or .api_ref_data.languages "") "/") 'face '(:foreground "cyan1")) c3-width nil ?\s "…")) 'url .url))) (cdr (car data))))))) 0)))) :action (lambda (selection) (browse-url (concat "https://developer.apple.com" (get-text-property 0 'url selection)))) :dynamic-collection t :caller 'ar/counsel-apple-search)) #+end_src * [2022-02-13 Sun] Plain Org v1.2 released :PROPERTIES: :CUSTOM_ID: plain-org-v12-released :END: Although [[https://plainorg.com][Plain Org]] v1.2 has been in the [[https://apps.apple.com/app/id1578965002][App Store]] for a little while, the release write-up was overdue, sorry. The update receives some new features and bugfixes. If you haven't heard of [[https://plainorg.com][Plain Org]], it gives ya access to your [[https://orgmode.org][org files]] on iOS while away from your beloved [[https://www.gnu.org/software/emacs/][Emacs]]. If you're finding Plain Org useful, *please help support this effort* by getting the word out. Tell your friends, [[https://twitter.com/intent/tweet?text=Plain%20Org%20https%3A%2F%2Fapps.apple.com%2Fapp%2Fid1578965002%20][tweet]], or blog about it. Ok, now on to what's included in the v1.2 release... ** Edit heading sections inline v1.0 introduced outline editing (for headings only). In v1.2, we can also edit section content. Press the =return= key multiple times to exit out section editing. #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v12-released/inline.gif]] ** Filter by keyword/priority/tag From the search dialog, you can now filter by keyboard, priority, and tag. #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v12-released/select_filter.png]] #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v12-released/filter_results.png]] ** Render drawers and properties Drawers are now rendered and can be expanded to view their content. #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v12-released/drawer.gif]] ** Open files via the Files app's "Share" sheet From the Files app, you can now explicitly request launching files in Plain Org by using the "Share" menu. #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v12-released/share.png]] ** Render LaTeX src blocks (experimental) This one has its rough edges at the moment, so have to mark it _experimental_, but... you can can now render =#+begin_src latex= blocks. #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v12-released/latex_src.png]] #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v12-released/latex_render.png]] ** Insert title/id in new files New files created via Plain Org automatically get =#+TITLE:= and =:ID:= inserted by default as follows: #+begin_src org ,#+TITLE: My favorite title :PROPERTIES: :ID: 7C845D38-8D80-41B5-BEB1-94F673807355 :END: #+end_src /UPDATE/: Sorry, this feature currently has a bug. You may not get these values inserted into your new document. Working on a fix. ** Adding new tags quicker Add tags quicker via the new + button. #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v12-released/new_tag.png]] ** Enable/disable sticky tags Keywords, indent, and tags are maintained when adding new headings via outline editing. If you prefer disabling sticky tags, this can now be disabled. #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v12-released/sticky_tags_setting.png]] ** Improved navigation bar v1.2 makes the navigation bar feel more at home on your iPhone. It uses a large title which scrolls into the navigation bar. #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v12-released/navbar.gif]] ** Bugfixes - Fix table rendering for iPad width. - Fix image's horizontal padding. - Fix adding new tags on new headings. - Fix snapshotting bug resulting in Syncthing conflicts. - Fix tapping menu after presenting other dialogs. - Filter out parenthesis in file-local keywords like =TODO(t)=. - Commit pending inline changes if search is requested. - Fix opening local links inside tables. - Roundtrip whitespace in empty headings. - Roundtrip trailing whitespace when raw-editing heading content. - Tapping on body content should not toggle expansion. #+BEGIN_EXPORT html
download-on-app-store.png
#+END_EXPORT * [2022-01-03 Mon] Happy New Year and forming new habits :PROPERTIES: :CUSTOM_ID: happy-new-year-and-forming-new-habits :END: Hacker News has a [[https://news.ycombinator.com/item?id=29774859][summary of Atomic Habits]] (the [[https://jamesclear.com/atomic-habits][book]]). In my case, I really enjoyed reading the entire book. I liked its narrative, mixing _actionable_ and _concrete_ advice with personal stories and experiments. After reading Atomic Habits during the first lockdown, I was excited to try out its actionables, specially tracking to keep me honest. I tried a bunch of iOS apps, but wanted no friction, no tracking, no cloud, no social, no analytics, no account, etc. so eventually [[https://xenodium.com/frictionless-org-habits-on-ios/][built Flat Habits]] ([[https://flathabits.com][flathabits.com]]). Also wanted to own my habit data (as plain text), so I made sure Flat Habits stored its data locally as an org file. I'm an Emacs nutter and can say the strength in habit tracking lies in removing daily friction from the tracking process itself. A quickly accessible mobile app can really help with that. For me, Emacs plays a less important role here. The plain text part is cherry on top (bringing piece of mind around lock-in). In my case, it's been months since I looked at the plain text file itself from an Emacs org buffer. The iOS app, on the other hand, gets daily usage. As for forming lasting habits (the actual goal here)... it's been well over a year since I started running as a regular form of exercise. While reading Atomic Habits really changed how I think of habits, a tracker played a crucial part in the daily grind. I happen to have built a tracker that [[https://xenodium.com/flat-habits-meets-org-agenda/][plays nice with Emacs]]. It's a new year. If you're looking at forming new habits, you may want some inspiration and also practical and concrete guidance. The book Atomic Habits can help with that. You can decide on which apps and how to implement the tracking process later on. Pen and paper is also a viable option and there are plenty of templates you can download. There's a surplus of habit-tracking apps on the app stores. I built yet another one for iOS, modeled after my needs. #+BEGIN_EXPORT html
today_no_filter.png today_no_filter.png today_no_filter.png
#+END_EXPORT * [2021-12-12 Wed] Plain Org v1.1 released 🎄☃️ :PROPERTIES: :CUSTOM_ID: plain-org-v11-released :END: [[https://plainorg.com][Plain Org]] v1.1 is now available on the [[https://apps.apple.com/app/id1578965002][App Store]]. The update receives new features and bugfixes. If you're finding Plain Org useful, *please help support this effort* by getting the word out. Tell your friends, [[https://twitter.com/intent/tweet?text=Plain%20Org%20https%3A%2F%2Fapps.apple.com%2Fapp%2Fid1578965002%20][tweet]], or blog about it. ** What is Plain Org? Ok, now on to what's included in the v1.1 release... ** Compact mode By default, Plain Org layout uses generous padding. The new option =Menu -> View -> Compact mode= packs more content into your screen. #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v11-released/compact.gif]] ** Regroup active and inactive tasks Regrouping tasks now bubbles active ones up. Similarly, inactive tasks drop to the bottom of their node. Changes are persisted to the org file. #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v11-released/regroup.gif]] ** Native table rendering Tables are now rendered natively but also support displaying links and other formatting within cells. #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v11-released/table.gif]] ** Open local ID links If your file provider supports granting access to folders, local ID links (ie. ~id:eb155a82-92b2-4f25-a3c6-0304591af2f9~) can now be resolved and opened from Plain Org. Note that for ID links to resolve, other org files must live in either the same directory or a subdirectory. #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v11-released/idlink.gif]] ** Fill paragraphs If your org paragraphs contain newlines optimizing for bigger screens, you can toggle =Menu -> View -> Fill paragraph= to optimize rendering for your iPhone. This rendering option makes no file modifications. #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v11-released/fillparagraph.gif]] By the way, the previous screenshot text comes from [[http://doc.norang.ca/org-mode.html][Org Mode - Organize Your Life In Plain Text]], a magnificent org resource. ** Show/hide basic scheduling Use the new =Menu -> View -> Scheduling= to toggle showing ~SCHEDULED~ or ~DEADLINE~ dates. #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v11-released/scheduling.gif]] ** Show/hide tags Similarly, the new =Menu -> View -> Tags= option toggles displaying tags. #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-v11-released/hidetags.gif]] ** Native list rendering Lists are now rendered natively. With the exception of numbered cases, list items now share a common bullet icon. Description lists are also recognized and receive additional formatting when rendered. #+begin_src org - First list item * Second list item + Third list item 1. Numbered list item + Term :: Description for term #+end_src #+ATTR_HTML: :width 30% :height 30% [[file:images/plain-org-v11-released/listitems.png]] Numbered checkboxes are now recognized and receive the same formatting and interaction as their non-numbered counterparts. #+begin_src org 1. [ ] First checkbox 2. [X] Second checkbox 3. [X] Third checkbox #+end_src #+ATTR_HTML: :width 30% :height 30% [[file:images/plain-org-v11-released/numbered.png]] ** Reload current file Plain Org may not be able to automatically reload files for some syncing providers. In those instances, use =Menu -> Reload= to explicitly request a reload. ** Open .txt files Although .org files are plain text files, they aren't always recognized by other text-editing apps. This release enables opening .txt files, so you can choose to render them in Plain Org, while giving you the option to edit elsewhere. ** Bugfixes - Improve vertical whitespace handling. - Fixes rendering edge cases. - Fail gracefully when creating new files on unsupported cloud providers. - Prevent creating new files with redundant extensions. - File access improvements. - Replicates property spacing behaviour using Emacs's ~org-property-format~ default value. - Fixes keyword picker border rendering. - Improves rendering performance for large nodes. #+BEGIN_EXPORT html
download-on-app-store.png
#+END_EXPORT * [2021-11-28 Sun] Emacs bends again :PROPERTIES: :CUSTOM_ID: emacs-bends-again :END: While adding more rendering capabilities to [[https://plainorg.com][Plain Org]], it soon became apparent some sort of screenshot/snapshot testing was necessary to prevent regressing existing features. That is, we first generate a rendered snapshot from a given org snippet, followed by some visual inspection, right before we go and save the blessed snapshot (often referred to as golden) to our project. Future changes are validated against the golden snapshot to ensure rendering is still behaving as expected. Let's say we'd like to validate table rendering with links, we can write a test as follows: #+begin_src swift func testTableWithLinks() throws { assertSnapshot( matching: OrgMarkupText.make( """ | URL | Org link | |------------------------+-------------| | https://flathabits.com | [[https://flathabits.com][Flat Habits]] | | Regular text | Here too | |------------------------+-------------| """), as: .image(layout: .sizeThatFits)) } #+end_src The corresponding snapshot golden can be seen below. #+ATTR_HTML: :width 50% [[file:images/emacs-bends-again/testTableWithLinks.1.png]] This is all done rather effortlessly thanks to [[https://twitter.com/pointfreeco][Point Free]]'s wonderful [[https://github.com/pointfreeco/swift-snapshot-testing][swift-snapshot-testing]] utilities. So what does any of this have to do with Emacs? You see, as I added more snapshot tests and made modifications to the rendering logic, I needed a quick way to visually inspect and override all goldens. All the main pieces were already there, I just needed some elisp glue to /bend Emacs my way™./ First, I needed to run my Xcode builds from the command line. This is already [[https://developer.apple.com/library/archive/technotes/tn2339/_index.html][supported via xcodebuild]]. Next, I needed a way to parse test execution data to extract failing tests. [[https://twitter.com/davidahouse][David House]]'s [[https://github.com/davidahouse/xcodebuild-to-json][xcodebuild-to-json]] handles this perfectly. What's left? Glue it all up with some elisp. Beware, the following code snippet is packed with assumptions about my project, it's messy, surely has bugs, can be optimized, etc. But the important point here is that Emacs is such an amazing malleable power tool. Throw some elisp at it and you can to bend it to your liking. After all, it's _your_ editor. And so here we are, I can now run snapshot tests from Emacs using my hacked up ~plainorg-snapshot-test-all~ function and quickly override (or ignore) all newly generated snapshots by merely pressing y/n keys. Oh, and our beloved web browser was also invited to the party. Press "d" to open two browser tabs if you'd like to take a closer look (not demoed below). Success. /Emacs bends again/. #+ATTR_HTML: :width 95% [[file:images/emacs-bends-again/diff.gif]] #+begin_src emacs-lisp :lexical no ;;; -*- lexical-binding: t; -*- (defun plainorg-snapshot-test-all () "Invoke xcodebuild, compare failed tests screenshots side-to-side, and offer to override them." (interactive) (let* ((project (cdr (project-current))) (json-tmp-file (make-temp-file "PlainOrg_Tests_" nil ".json")) (default-directory project)) (unless (file-exists-p (concat project "PlainOrg.xcodeproj")) (user-error "Not in PlainOrg project")) (set-process-sentinel (start-process "xcodebuild" (with-current-buffer (get-buffer-create "*xcodebuild*") (let ((inhibit-read-only t)) (erase-buffer)) (current-buffer)) "/usr/bin/xcodebuild" "-scheme" "PlainOrg" "-target" "PlainOrgTests" "-destination" "name=iPhone 13" "-quiet" "test") (lambda (p e) (with-current-buffer (get-buffer "*xcodebuild*") (let ((inhibit-read-only t)) (insert (format "xcodebuild exit code: %d\n\n" (process-exit-status p))))) (when (not (eq 0 (process-exit-status p))) (set-process-sentinel (start-process "xcodebuild-to-json" "*xcodebuild*" "/opt/homebrew/bin/xcodebuild-to-json" "--derived-data-folder" (format "/Users/%s/Library/Developer/Xcode/DerivedData/" (user-login-name)) "--output" json-tmp-file) (lambda (p e) (with-current-buffer (get-buffer "*xcodebuild*") (let ((inhibit-read-only t)) (insert (format "xcodebuild-to-json exit code: %d\n\n" (process-exit-status p))))) (when (= 0 (process-exit-status p)) (with-current-buffer (get-buffer "*xcodebuild*") (let ((inhibit-read-only t)) (insert "Screenshot comparison started\n\n"))) (plainorg--snapshot-process-json (get-buffer "*xcodebuild*") json-tmp-file) (with-current-buffer (get-buffer "*xcodebuild*") (let ((inhibit-read-only t)) (insert "\nScreenshot comparison finished\n")) (read-only-mode +1)))))))) (switch-to-buffer-other-window "*xcodebuild*"))) (defun plainorg--snapshot-process-json (result-buffer json) "Find all failed snapshot tests in JSON and offer to override screenshots, comparing them side to side." (let ((hashtable (with-current-buffer (get-buffer-create "*build json*") (erase-buffer) (insert-file-contents json) (json-parse-buffer)))) (mapc (lambda (item) (when (equal (gethash "id" item) "SnapshotTests") (mapc (lambda (testCase) (when (and (gethash "failureMessage" testCase) (string-match-p "Snapshot does not match reference" (gethash "failureMessage" testCase))) (let* ((paths (plainorg--snapshot-screenshot-paths (gethash "failureMessage" testCase))) (override-result (plainorg--snapshot-override-image "Expected screenshot" (nth 0 paths) ;; old "Actual screenshot" (nth 1 paths) ;; new (nth 0 paths)))) (when override-result (with-current-buffer result-buffer (let ((inhibit-read-only t)) (insert override-result) (insert "\n"))))))) (gethash "testCases" item)))) (gethash "classes" (gethash "details" hashtable))))) (defun plainorg--snapshot-screenshot-paths (failure-message) "Extract a paths list from FAILURE-MESSAGE of the form: failed - Snapshot does not match reference. @− \"/path/to/expected/screenshot.1.png\" @+ \"/path/to/actual/screenshot.1.png\" Newly-taken snapshot does not match reference. " (mapcar (lambda (line) (string-remove-suffix "\"" (string-remove-prefix "\"" line))) (seq-filter (lambda (line) (string-prefix-p "\"" line)) (split-string failure-message "\n")))) (defun plainorg--snapshot-override-image (old-buffer old new-buffer new destination) (let ((window-configuration (current-window-configuration)) (action) (result)) (unwind-protect (progn (delete-other-windows) (split-window-horizontally) (switch-to-buffer (with-current-buffer (get-buffer-create old-buffer) (let ((inhibit-read-only t)) (erase-buffer)) (insert-file-contents old) (image-mode) (current-buffer))) (switch-to-buffer-other-window (with-current-buffer (get-buffer-create new-buffer) (let ((inhibit-read-only t)) (erase-buffer)) (insert-file-contents new) (image-mode) (current-buffer))) (while (null result) (setq action (read-char-choice (format "Override %s? (y)es (n)o (d)iff in browser? " (file-name-base old)) '(?y ?n ?d ?q))) (cond ((eq action ?n) (setq result (format "Keeping old %s" (file-name-base old)))) ((eq action ?y) (copy-file new old t) (setq result (format "Overriding old %s" (file-name-base old)))) ((eq action ?d) (shell-command (format "open -a Firefox %s --args --new-tab" old)) (shell-command (format "open -a Firefox %s --args --new-tab" new))) ((eq action ?q) (set-window-configuration window-configuration) (setq result (format "Quit %s" (file-name-base old))))))) (set-window-configuration window-configuration) (kill-buffer old-buffer) (kill-buffer new-buffer)) result)) #+end_src * [2021-11-10 Wed] Plain Org has joined the chat (iOS) :PROPERTIES: :CUSTOM_ID: plain-org-has-joined-the-chat :END: The App Store is a crowded space when it come to markdown apps. A quick search yields a wonderful wealth of choice. Kinda overwhelming, but a great problem to have nonetheless. For those of us with org as our markup of choice, the App Store is far less crowded. I wish we could fill more than a screen's worth of search results, so you know... I could show you another pretty gif scrolling through org results. For now, we'll settle on a single frame showcasing our 4 org options. #+ATTR_HTML: :width 80% [[file:images/plain-org-has-joined-the-chat/store-side-comparison-mid.gif]] [[https://beorg.app/][Beorg]], [[http://mobileorg.github.io/][MobileOrg]], [[https://flathabits.com/][Flat Habits]], and [[https://orgro.org/][Orgro]] are all great options. Each with strengths of their own. [[https://organice.200ok.ch/][Organice]], while not on the App Store, is another option for those looking for a web alternative. Of these, I had already authored one of them. More on that in a sec... You see, about a year ago I wanted to play with Swift, SPM, and lsp itself. Also, having Swift code completion in Emacs via [[https://github.com/emacs-lsp/lsp-sourcekit][lsp-sourcekit]] sounded like a fun thing to try out, so I started using it while writing a Swift org parser. #+ATTR_HTML: :width 75% [[file:images/plain-org-has-joined-the-chat/magit.png]] While working on the parser, I happened to be reading [[https://jamesclear.com/atomic-habits][Atomic Habits]] (awesome book btw)... It was also a great time to play around with SwiftUI, which by the way, is pretty awesome too. With Atomic Habits fresh in mind, org parser in one hand, and SwiftUI in the other, I built [[https://flathabits.com][Flat Habits]]: a lightweight habit tracker powered by org. #+ATTR_HTML: :width 80% :height 80% [[file:images/frictionless-org-habits-on-ios/flat_habits.gif]] I love being able to save habit data to plain text and easily track on my iPhone (via Flat Habits) or laptop (via Emacs). I wanted to [[https://xenodium.com/org-habits-on-ios-check-tasks-youre-next/][extend similar convenience to org tasks]], so I built [[https://plainorg.com][Plain Org]]. My previous [[https://xenodium.com/org-habits-on-ios-check-tasks-youre-next/][post]] mentioned /quickly adding new tasks and searching existing ones/ as Plain Org's driving goals. Of course, neither of those are as useful without automatic cloud syncing, so pluging into [[https://support.apple.com/en-gb/HT206481#thirdparty][iOS's third party cloud support]] was a must-have. With these baseline features in place, I [[https://www.reddit.com/r/orgmode/comments/p5bonn/ios_plain_org_alpha_builds_now_on_testflight_dm/][started an alpha/beta group]] via [[https://testflight.apple.com/][TestFlight]]. Early Plain Org adopters have been wonderfully supportive, given lots of great feedback, and helped shape the initial feature set you see below. /There's plenty more that can be supported, but hey let's get v1 out the door. Gotta start somewhere./ ** Plain Org v1 features - View and edit your org mode tasks while on the go. - Beautifully rendered org markup. - Sync your org files using your favorite cloud provider. - Create new files. - Outline-style editing with toolbar - Keywords - Indent - Priority - Tags - Formatting: bold, italic, underline, strikethrough, verbatim, and code. - Add links from Safari via share extension. - Add new tasks via Spotlight. - Reorder headings via drag/drop. - Checkboxes - Interactive toggling. - Quickly reset multiple checkboxes. - Follow local links. - Show inline images. - File-local keywords and visibility. - Filter open/closed tasks. - Show/hide stars. - Edit raw text. - Light/dark mode. ** Plain Org joins the chat Today Plain Org joins the likes of [[https://beorg.app/][Beorg]], [[http://mobileorg.github.io/][MobileOrg]], [[https://flathabits.com/][Flat Habits]], and [[https://orgro.org/][Orgro]] on the App Store. #+ATTR_HTML: :width 50% [[file:images/plain-org-has-joined-the-chat/intro.png]] #+BEGIN_EXPORT html
download-on-app-store.png
#+END_EXPORT #+BEGIN_EXPORT html
This post was written in org mode.
#+END_EXPORT * [2021-09-19 Sun] Plain Org for iOS (a month later) :PROPERTIES: :CUSTOM_ID: plain-org-for-ios-a-month-later :END: A month ago, I posted about my desire to [[https://xenodium.com/org-habits-on-ios-check-tasks-youre-next/][bring org tasks/TODOs to iOS]] and make them quickly available from my iPhone. Since then, I've received some great feedback, which I've been slowly chipping away at. My intent isn't so much to move my org workflow over to iOS, but to supplement Emacs while away from my laptop. As of now, this is what the inline edit experience looks like: #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-for-ios-a-month-later/inline_keyword_toolbar.gif]] If, like me, you prefer dark mode. The app's got ya covered: #+ATTR_HTML: :width 50% :height 50% [[file:images/plain-org-for-ios-a-month-later/dark.png]] /Plain Org/ is not yet available on the App Store, but you can get a TestFlight invite if you send me an email address. Ping me on [[https://www.reddit.com/user/xenodium][reddit]], [[https://twitter.com/xenodium][twitter]], or email me at "plainorg" + "@" + "xenodium.com". You can also check out progress over at the [[https://www.reddit.com/r/plainorg/][r/plainorg]] subreddit. * [2021-08-19 Thu] Org habits on iOS? Check! Tasks, you're next :PROPERTIES: :CUSTOM_ID: org-habits-on-ios-check-tasks-youre-next :END: I'm an [[https://orgmode.org][org mode]] fan. This blog is powered by org. It's more of an accidental blog that started as a [[https://github.com/xenodium/xenodium.github.io/blob/master/index.org][single org file]] keeping notes. I use [[https://orgmode.org/worg/org-contrib/babel/intro.html][org babel]] too. Oh and [[https://orgmode.org/manual/Tracking-your-habits.html][org habits]]. My never-ending list of TODOs is also powered by org. I manage all of this from Emacs and peek at TODOs using [[https://orgmode.org/manual/Agenda-Views.html][org agenda]]. This all works really well while I'm sitting in front of my laptop running Emacs. But then I'm away from my laptop... and I need to quickly record habits on the go. I need it to be low-friction. Ssh'ing to an Emacs instance from a smartphone isn't an option. I'm an iPhone user, so whatever the solution, it should play nice with Emacs and org mode. I built [[https://flathabits.com][Flat Habits]] for habit tracking and I'm fairly happy with the result. As of today, my longest-tracked habit is on a 452-day streak. #+ATTR_HTML: :width 80% :height 80% [[file:images/frictionless-org-habits-on-ios/flat_habits.gif]] Moving on to org tasks/TODOs... I want something fairly frictionless while on the go. With /Flat Habits/ as a stepping stone, I can now reuse some parts to build [[https://reddit.com/r/plainorg][Plain Org]]. This new app should give me quick access to my tasks. The two driving goals are: quickly add new tasks and search existing ones while away from my laptop. Ok, maybe basic editing helps too. Oh and it should sync over cloud, of course. #+ATTR_HTML: :width 50% :height 50% [[file:images/org-habits-on-ios-check-tasks-youre-next/plainorgdemo.gif]] I now have an early implementation of sorts, [[https://www.reddit.com/r/plainorg/comments/p5bnji/ios_more_improvements_alpha_builds_now_on/][available on TestFlight]]. If you'd like to give it a try, /send me an email address/ to receive the the invite. Ping me on [[https://reddit.com/u/xenodium][reddit]], [[https://twitter.com/xenodium][twitter]], or email me at "plainorg" + "@" + "xenodium.com". * [2021-07-11 Sun] Flat Habits 1.1 released :PROPERTIES: :CUSTOM_ID: flat-habits-11-released :END: [[https://flathabits.com/][Flat Habits]] 1.1 is now available on the [[https://apps.apple.com/app/id1558358855][App Store]]. Flat Habits is a habit tracker that’s mindful of your time, data, and privacy. It's powered by [[https://orgmode.org][org]] plain text markup, enabling you to use your [[https://xenodium.com/frictionless-org-habits-on-ios/][favorite editor]] (Emacs, Vim, VSCode, etc.) to poke at your habit data. ** What's new? This release implements a few of features requested by users. ** Multiday weekly habits This is the chunkiest addition and most requested feature. You can now select multiple days when scheduling weekly habits. #+ATTR_HTML: :width 50% :height 50% [[file:images/flat-habits-11-released/multi_day_creation.gif]] #+ATTR_HTML: :width 50% :height 50% [[file:images/flat-habits-11-released/multi_day_calendar.png]] ** Historical management Sometimes you forget to mark a habit done or make a mistake toggling one. Either way, you can now toggle any habit day from the calendar/streak view. *** Long tap Long tap shows you the editing option available for that day. #+ATTR_HTML: :width 50% :height 50% [[file:images/flat-habits-11-released/long_tap.gif]] *** Short tap Short tap typically toggles between "Done" and "Not done". #+ATTR_HTML: :width 50% :height 50% [[file:images/flat-habits-11-released/short_tap.gif]] ** Where's today? A few folks rightfully asked for today's date to be highlighted in the calendar view, and so we now have a red circle. #+ATTR_HTML: :width 50% :height 50% [[file:images/flat-habits-11-released/today.png]] ** Improved error messages Hopefully you don't run into issues, but if you do, I hope the app helps ya sort them out. ** Bugfixes - Tapping on blur now dismisses habit edit dialog. - Future habits now longer editable. - Skipped habits no longer have a default tap action. - Undoing from streak/calendar view now refreshes correctly. - Undoing habit addition on iPad removes streak/calendar view. * [2021-07-11 Sun] macOS: Show in Finder / Show in Emacs :PROPERTIES: :CUSTOM_ID: show-in-finder--show-in-emacs :END: From Christian Tietze's [[https://christiantietze.de/posts/2021/07/open-finder-window-in-dired/][Open macOS Finder Window in Emacs Dired]], I learned about [[https://github.com/kaz-yos/reveal-in-osx-finder][reveal-in-osx-finder]]. This is handy for the few times I want to transition from Emacs to Finder for file management. I say few times since Emacs's directory editor, [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][dired]], is just awesome. I've written about dired customizations [[https://xenodium.com/showhide-emacs-dired-details-in-style/][here]] and [[https://xenodium.com/showhide-emacs-dired-details-in-style/][here]], but since dired is /just another buffer,/ you can apply your Emacs magic like multiple cursors to [[https://xenodium.com/batch-renaming-with-counsel-find-dired-and-wdired/][batch rename files in an editable dired buffer]]. To transition from macOS Finder to Emacs, Christian offers an Emacs interactive command that fetches Finder's location and opens a dired buffer via AppleScript. On a similar note, I learned from redditor [[https://www.reddit.com/user/pndc/][u/pndc]] that [[https://www.reddit.com/r/emacs/comments/ohgz0s/open_macos_finder_windows_path_in_dired/h4p8a8f?utm_source=share&utm_medium=web2x&context=3][Finder's proxy icons can be dragged over to Emacs]], which handily drops ya into a dired buffer. With these two solutions in mind, I looked into a third one to offer a context menu option in Finder to show the file in Emacs. This turned out to be fairly easy using Automator, which I've rarely used. #+ATTR_HTML: :width 50% :height 50% [[file:images/show-in-finder--show-in-emacs/show_in_emacs.gif]] I created a flow that runs a shell script to "Show in Emacs", revealing the selected file or folder in an dired buffer. This is similar to Christian's solution, but invoked from Finder itself. The flow also uses /dired-goto-file/ which moves the point (cursor) to the file listed under dired. #+ATTR_HTML: :width 98% :height 98% [[file:images/show-in-finder--show-in-emacs/show_in_emacs.png]] #+begin_src sh current_dir=$(dirname "$1") osascript -e 'tell application "Emacs" to activate' path/to/emacsclient --eval "(progn (dired \"$current_dir\") (dired-goto-file \"$1\"))" #+end_src As a bonus, I added an "Open in Emacs" option, which does as it says on the tin. Rather than show the file listed in a dired buffer, it gets Emacs to open it in your favorite major mode. This option is not technically needed since Finder already provides an "Open With" context menu, but it does remove a few click here and there. #+ATTR_HTML: :width 98% :height 98% [[file:images/show-in-finder--show-in-emacs/open_in_emacs.png]] #+begin_src sh osascript -e 'tell application "Emacs" to activate' /Users/alvaro/homebrew/bin/emacsclient --eval "(find-file \"$1\")" #+end_src On a side note, Emacs defaults to creating new frames when opening files via "Open With" menu (or "open -a Emacs foo.txt"). I prefer to use my existing Emacs frame, which can be accomplished by setting ns-pop-up-frames to nil. #+begin_src emacs-lisp :lexical no (setq ns-pop-up-frames nil) #+end_src * [2021-06-27 Sun] Emacs: smarter search and replace :PROPERTIES: :CUSTOM_ID: emacs-smarter-search-and-replace :END: #+ATTR_HTML: :width 75% :height 75% [[file:images/emacs-smarter-search-and-replace/smarter_replace.gif]] Not long ago, I made a note to go back and read [[https://mac4translators.blogspot.com][Mac for Translators]]'s [[https://mac4translators.blogspot.com/2021/06/regex-with-elisp.html][Emacs regex with Emacs lisp]] post. The author highlights Emacs's ability to apply additional logic when replacing text during a search-and-replace session. It does so by leveraging elisp expressions. Coincidentally, a redditor recently asked [[https://www.reddit.com/r/emacs/comments/o878am/what_is_the_simplest_way_to_apply_a_math_formula/][What is the simplest way to apply a math formula to all numbers in a buffer/region?]] Some of the answers also point to /search and replace/ leveraging elisp expressions. While I rarely need to apply additional logic when replacing matches, it's nice to know we have options available in our Emacs toolbox. This prompted me to check out [[https://github.com/emacs-mirror/emacs/blob/b8f9e58ef72402e69a1f0960816184d52e5d2d29/lisp/replace.el#L709][replace-regexp]]'s documentation (via M-x [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Name-Help.html][describe-function]] or my favorite M-x [[https://github.com/Wilfred/helpful][helpful-callable]]). There's lots in there. Go check its docs out. You may be pleasantly surprised by all the features packed under this humble function. For instance, \& expands to the current match. Similarly, \#& expands to the current match, fed through [[https://www.gnu.org/software/emacs/manual/html_node/elisp/String-Conversion.html][string-to-number]]. But what if you'd like to feed the match to another function? You can use \, to signal evaluation of an elisp expression. In other words, you could multiply by 3 using \,(* 3 \#&) or inserting whether a number is odd or even with something like \,(if (oddp \#&) "(odd)" "(even)"). Take the following text: #+begin_example 1 2 3 4 5 6 #+end_example We can label each value "(odd)" or "(even)" as well as multiply by 3, by invoking /replace-regexp/ as follows: #+begin_quote M-x replace-regexp #+end_quote [PCRE] Replace regex: #+begin_quote [-0-9.]+ #+end_quote Replace regex [-0-9.]+: #+begin_quote \& \,(if (oddp \#&) "(odd)" "(even)") x 3 = \,(* 3 \#&) #+end_quote #+begin_example 1 (odd) x 3 = 3 2 (even) x 3 = 6 3 (odd) x 3 = 9 4 (even) x 3 = 12 5 (odd) x 3 = 15 6 (even) x 3 = 18 #+end_example It's worth noting that /replace-regexp/'s cousin [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Query-Replace.html][query-replace-regexp]] also handles all this wonderful magic. Happy searching and replacing! * [2021-06-20 Sun] Previewing SwiftUI layouts in Emacs (revisited) :PROPERTIES: :CUSTOM_ID: previewing-swiftui-layouts-in-emacs-revisited :END: Back in May 2020, I shared a snippet to extend [[https://github.com/zweifisch/ob-swift][ob-swift]] to [[https://xenodium.com/swiftui-layout-previews-using-emacs-org-blocks/][preview SwiftUI layouts using Emacs org blocks]]. #+ATTR_HTML: :width 75% :height 75% [[file:images/swiftui-layout-previews-using-emacs-org-blocks/ob-swiftui.gif]] When I say extend, I didn't quite modify ob-swift itself, but rather [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html][advised]] [[https://github.com/zweifisch/ob-swift/blob/ed478ddbbe41ce5373efde06b4dd0c3663c9055f/ob-swift.el#L37][org-babel-execute:swift]] to modify its behavior at runtime. Fast-forward to June 2021 and Scott Nicholes [[https://github.com/zweifisch/ob-swift/issues/4#issuecomment-858196354][reminded me there's still interest]] in org babel SwiftUI support. ob-swift [[https://github.com/zweifisch/ob-swift/commits/master][seems a little inactive]], but no worries there. The package offers great general-purpose Swift support. On the other hand, SwiftUI previews can likely live as a single-purpose package all on its own... and so I set off to bundle the rendering functionality into a new [[https://github.com/xenodium/ob-swiftui][ob-swiftui]] package. Luckily, org babel's documentation has a straightforward section to help you [[https://orgmode.org/worg/org-contrib/babel/languages/index.html][develop support for new babel languages]]. They simplified things by offering [[https://code.orgmode.org/bzg/worg/raw/master/org-contrib/babel/ob-template.el][template.el]], which serves as the foundation for your language implementation. For the most part, it's a matter of searching, replacing strings, and removing the bits you don't need. The elisp core of ob-swiftui is fairly simple. It expands the org block body, inserts the expanded body into a temporary buffer, and finally feeds the code to the Swift toolchain for execution. #+begin_src emacs-lisp (defun org-babel-execute:swiftui (body params) "Execute a block of SwiftUI code in BODY with org-babel header PARAMS. This function is called by `org-babel-execute-src-block'" (message "executing SwiftUI source code block") (with-temp-buffer (insert (ob-swiftui--expand-body body params)) (shell-command-on-region (point-min) (point-max) "swift -" nil 't) (buffer-string))) #+end_src The expansion in /ob-swiftui--expand-body/ is a little more interesting. It decorates the block's body, so it can become a fully functional and stand-alone SwiftUI macOS app. If you're familiar with Swift and SwiftUI, the code should be fairly self-explanatory. From an org babel's perspective, the expanded code is executed whenever we press /C-c C-c/ (or M-x [[https://orgmode.org/manual/The-Very-Busy-C_002dc-C_002dc-Key.html#The-Very-Busy-C_002dc-C_002dc-Key][org-ctrl-c-ctrl-c]]) within the block itself. It's worthing mentioning that our new implementation supports two babel [[https://www.orgmode.org/worg/org-contrib/babel/header-args.html][header arguments]] (results and view). Both extracted from params using [[https://github.com/emacs-mirror/emacs/blob/3af9e84ff59811734dcbb5d55e04e1fdb7051e77/lisp/emacs-lisp/map.el#L106][map-elt]] and replaced in the expanded Swift code to enable/disable snapshotting or explicitly setting a SwiftUI root view. #+begin_src emacs-lisp (defun ob-swiftui--expand-body (body params) "Expand BODY according to PARAMS and PROCESSED-PARAMS, return the expanded body." (let ((write-to-file (member "file" (map-elt params :result-params))) (root-view (when (and (map-elt params :view) (not (string-equal (map-elt params :view) "none"))) (map-elt params :view)))) (format " // Swift snippet heavily based on Chris Eidhof's code at: // https://gist.github.com/chriseidhof/26768f0b63fa3cdf8b46821e099df5ff import Cocoa import SwiftUI import Foundation let screenshotURL = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true).appendingPathComponent(ProcessInfo.processInfo.globallyUniqueString + \".png\") let preview = %s // Body to run. %s extension NSApplication { public func run(_ view: V) { let appDelegate = AppDelegate(view) NSApp.setActivationPolicy(.regular) mainMenu = customMenu delegate = appDelegate run() } public func run(@ViewBuilder view: () -> V) { let appDelegate = AppDelegate(view()) NSApp.setActivationPolicy(.regular) mainMenu = customMenu delegate = appDelegate run() } } extension NSApplication { var customMenu: NSMenu { let appMenu = NSMenuItem() appMenu.submenu = NSMenu() let quitItem = NSMenuItem( title: \"Quit \(ProcessInfo.processInfo.processName)\", action: #selector(NSApplication.terminate(_:)), keyEquivalent: \"q\") quitItem.keyEquivalentModifierMask = [] appMenu.submenu?.addItem(quitItem) let mainMenu = NSMenu(title: \"Main Menu\") mainMenu.addItem(appMenu) return mainMenu } } class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate { var window = NSWindow( contentRect: NSRect(x: 0, y: 0, width: 414 * 0.2, height: 896 * 0.2), styleMask: [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView], backing: .buffered, defer: false) var contentView: V init(_ contentView: V) { self.contentView = contentView } func applicationDidFinishLaunching(_ notification: Notification) { window.delegate = self window.center() window.contentView = NSHostingView(rootView: contentView) window.makeKeyAndOrderFront(nil) if preview { screenshot(view: window.contentView!, saveTo: screenshotURL) // Write path (without newline) so org babel can parse it. print(screenshotURL.path, terminator: \"\") NSApplication.shared.terminate(self) return } window.title = \"press q to exit\" window.setFrameAutosaveName(\"Main Window\") NSApp.activate(ignoringOtherApps: true) } } func screenshot(view: NSView, saveTo fileURL: URL) { let rep = view.bitmapImageRepForCachingDisplay(in: view.bounds)! view.cacheDisplay(in: view.bounds, to: rep) let pngData = rep.representation(using: .png, properties: [:]) try! pngData?.write(to: fileURL) } // Additional view definitions. %s " (if write-to-file "true" "false") (if root-view (format "NSApplication.shared.run(%s())" root-view) (format "NSApplication.shared.run {%s}" body)) (if root-view body "")))) #+end_src For rendering inline SwiftUI previews in Emacs, we rely on NSView's [[https://developer.apple.com/documentation/appkit/nsview/1483440-bitmapimagerepforcachingdisplay][bitmapImageRepForCachingDisplay]] to capture an image snapshot. We write its output to a temporary file and piggyback-ride off org babel's /:results file/ header argument to automatically render the image inline. Here's ob-swiftui inline rendering in action: [[file:images/previewing-swiftui-layouts-in-emacs-revisited/obswiftui50.gif]] When rendering SwiftUI externally, we're effectively running and interacting with the generated macOS app itself. #+ATTR_HTML: :width 75% :height 75% [[file:images/previewing-swiftui-layouts-in-emacs-revisited/ob-swiftui-window.gif]] The two snippets give a general sense of what's needed to enable org babel to handle SwiftUI source blocks. Having said that, the full source and setup instructions are both available on [[https://github.com/xenodium/ob-swiftui][github]]. [[https://github.com/xenodium/ob-swiftui][ob-swiftui]] is now available on [[https://melpa.org/#/ob-swiftui][melpa]]. * [2021-06-19 Sat] Blurring the lines between shell and editor :PROPERTIES: :CUSTOM_ID: yasnippet-in-emacs-eshell :END: #+ATTR_HTML: :width 75% :height 75% [[file:images/yasnippet-in-emacs-eshell/yas-eshell.gif]] I recently [[https://twitter.com/xenodium/status/1404746233860837378][tweeted]] that Vivek Haldar's [[https://blog.vivekhaldar.com/post/3996068979/the-levels-of-emacs-proficiency][10-year old post]] rings true today just the same. He writes about [[https://blog.vivekhaldar.com/post/3996068979/the-levels-of-emacs-proficiency][the levels of Emacs proficiency]]. All 6 levels are insightful in their own right, but for the sake of this post, let's quote an extract from level /4. Shell inside Emacs/: #+begin_quote "And then, you learned about it: M-x shell. It was all just text. Why did you need another application for it? Why should only the shell prompt be editable? Why can’t I move my cursor up a few lines to where the last command spewed out its results? All these problems simply disappear when your shell (or shells) simply becomes another Emacs buffer, upon which all of the text manipulation power of Emacs can be brought to bear." #+end_quote In other words, we aren't merely removing shell restrictions, but opening up possibilities... Take Emacs eshell looping, for example. I use it so infrequently, I could never remember eshell's syntax. I would refer back to EmacsWiki's [[https://www.emacswiki.org/emacs/EshellForLoop][Eshell For Loop]] or Mastering Emacs's [[https://masteringemacs.org/article/complete-guide-mastering-eshell][Mastering Eshell]] comments for a reminder. It finally dawned on me. I don't need to internalize this eshell syntax. I have [[https://github.com/joaotavora/YASnippet][YASnippet]] available like any other buffer. I could just type "for" and let YASnippet do the rest for me. #+ATTR_HTML: :width 75% :height 75% [[file:images/yasnippet-in-emacs-eshell/yas-for.gif]] All I need is a tiny YASnippet: #+begin_src YASnippet #name : Eshell for loop #key : for # -- for f in ${1:*} { ${2:echo} "$f"; $3} $0 #+end_src Want a gentle and succinct YASnippet intro? Check out Jake's [[https://www.reddit.com/r/emacs/comments/o282fq/YASnippet_snippetstemplating_introductiontutorial/][YASnippet introduction video]]. :PROPERTIES: :CUSTOM_ID: bash-zsh-and-others-welcome :END: If you're a [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Shell-Mode.html][shell-mode]] user, YASnippet would have you covered in your favorite shell. The expansion snippet can be modified to a Bash equivalent, giving us the same benefit. We type "for" and let YASnippet expand and hop over arguments. Here's a Bash equivalent emphasizing the hopping a little more: #+ATTR_HTML: :width 75% :height 75% [[file:images/yasnippet-in-emacs-eshell/yasbash.gif]] #+begin_src YASnippet #name : bash for loop #key : for # -- for f in ${1:*}; do ${2:echo} $f; done $0 #+end_src ps. Looks like [[https://github.com/akermu/emacs-libvterm][vterm]], [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Term-Mode.html][term]], or [[https://www.emacswiki.org/emacs/AnsiTerm][ansi-term]] work too. See Shane Mulligan's post: [[https://mullikine.github.io/posts/use-yasnippets-in-term/][Use YASnippets in term and vterm in emacs]]. * [2021-06-16 Wed] xcodebuild's SPM support (Xcode 11) :PROPERTIES: :CUSTOM_ID: xcodebuilds-spm-support-xcode-11 :END: Had been a while since I looked into generating Xcode projects from a Swift package. On my latest use of the /generate-xcodeproj/ subcommand, I was greeted by a nice +warning+ surprise... #+begin_src bash :results output swift package generate-xcodeproj #+end_src #+RESULTS: : warning: Xcode can open and build Swift Packages directly. 'generate-xcodeproj' is no longer needed and will be deprecated soon. : generated: ./FooBar.xcodeproj Xcode can handle Swift packages directly. Similarly, xcodebuild can handle them too. This isn't new. It's likely been available since Xcode 11. I just totally missed it. /Note: I've yet to dig into Xcode 13 beta, as Swift packages may already support the build/test features I was after in xcodebuild (like [[https://developer.apple.com/documentation/swift_packages/supportedplatform/3788290-maccatalyst][build/test on Catalyst]])./ In any case, on to xcodebuild... but let's first create a brand new Swift package. ** Creating a Swift package library #+begin_src bash :results output mkdir FooBar && cd FooBar swift package init --type library #+end_src #+RESULTS: : Creating library package: FooBar : Creating Package.swift : Creating README.md : Creating .gitignore : Creating Sources/ : Creating Sources/FooBar/FooBar.swift : Creating Tests/ : Creating Tests/FooBarTests/ : Creating Tests/FooBarTests/FooBarTests.swift ** List package schemes We can use xcodebuild to list the available schemes. #+begin_src bash :results output xcodebuild -list #+end_src #+RESULTS: #+begin_example Command line invocation: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -list User defaults from command line: IDEPackageSupportUseBuiltinSCM = YES Resolve Package Graph Resolved source packages: FooBar: /tmp/FooBar Information about workspace "FooBar": Schemes: FooBar #+end_example ** Show supported platform, architecture, etc Similarly, we can list destinations supported for the schemes. #+begin_src bash :results output xcodebuild -showdestinations -scheme FooBar #+end_src #+RESULTS: #+begin_example Command line invocation: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -showdestinations -scheme FooBar User defaults from command line: IDEPackageSupportUseBuiltinSCM = YES Resolve Package Graph Resolved source packages: FooBar: /tmp/FooBar Available destinations for the "FooBar" scheme: { platform:macOS, arch:x86_64, id:... } { platform:macOS, arch:x86_64, variant:Mac Catalyst, id:... } ... { platform:iOS Simulator, id:..., OS:14.5, name:iPhone 12 Pro } Ineligible destinations for the "FooBar" scheme: ... #+end_example ** macOS builds Let's build for macOS, though let's first import UIKit into FooBar.swift. This ensures we get an expected failure when building for macOS. #+begin_src swift import UIKit struct FooBar { var text = "Hello, World!" } #+end_src Now let's attempt to build it... #+begin_src bash :results verbatim xcodebuild build -quiet -scheme FooBar -destination 'platform=macOS' #+end_src #+RESULTS: #+begin_example --- xcodebuild: WARNING: Using the first of multiple matching destinations: { platform:macOS, arch:x86_64, id:3D097357-EB7D-565D-9058-CE7C3135927B } { platform:macOS, arch:x86_64, variant:Mac Catalyst, id:3D097357-EB7D-565D-9058-CE7C3135927B } /tmp/FooBar/Sources/FooBar/FooBar.swift:1:8: error: no such module 'UIKit' import UIKit ^ note: Using new build system note: Building targets in parallel note: Planning build note: Analyzing workspace note: Using build description from disk note: Build preparation complete ,** BUILD FAILED ** #+end_example The failure expected as UIKit isn't available on your typical macOS builds. ** macOS Catalyst builds We do, however, have Catalyst available, so we can use its variant to build for macOS with UIKit support, and.. voilà! #+begin_src bash :results verbatim xcodebuild build -quiet -scheme FooBar -destination 'platform=macOS,variant=Mac Catalyst' && echo \\o/ #+end_src #+RESULTS: : \o/ * [2021-06-06 Sun] Emacs org block completion on melpa :PROPERTIES: :CUSTOM_ID: emacs-org-block-completion-on-melpa :END: When enabled, the character "<" triggers company completion of org blocks. #+ATTR_HTML: :width 50% :height 50% [[file:images/emacs-org-block-completion-on-melpa/hello-company-org-block.gif]] I get the occasional ping to package the [[https://xenodium.com/emacs-org-block-company-completion][code from this post]] and publish it [[https://melpa.org/#/company-org-block][on melpa]]. Finally gave it a go. Moved the code [[https://github.com/xenodium/company-org-block][here]]. This was my first time publishing on melpa. The process was very [[https://github.com/melpa/melpa/pull/7593][smooth]]. Big thanks to melpa volunteers! * [2021-06-01 Tue] Emacs DWIM: do what ✨I✨ mean :PROPERTIES: :CUSTOM_ID: emacs-dwim-do-what-i-mean :END: Update: There's a DWIM [[https://xenodium.com/emacs-dwim-swiper-vs-isearch-vs-phi-search/][follow-up for searching]]. #+ATTR_HTML: :width 50% :height 50% [[file:images/emacs-dwim-do-what-i-mean/do-what-i-mean.gif]] I was a rather puzzled the first time I spotted DWIM in an Emacs interactive command name. Don't think I remember what the command itself was, but what's important here is that [[https://en.wikipedia.org/wiki/DWIM][DWIM]] stands for [[https://en.wikipedia.org/wiki/DWIM][do what I mean]]. I love DWIM interactive commands. They enable commands to be smarter and thus pack more functionality, without incurring the typical cognitive overhead associated with remembering multiple commands (or key bindings). The Emacs manual does a great job describing DWIM for the [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Comment-Commands.html][comment-dwim]] command: #+begin_src The word “dwim” is an acronym for “Do What I Mean”; it indicates that this command can be used for many different jobs relating to comments, depending on the situation where you use it. #+end_src It's really great to find built-in DWIM-powered Emacs commands. Third-party packages often include them too. I typically gravitate towards these commands and bind them in my Emacs config. Examples being upcase-dwim, downcase-dwim, or mc/mark-all-dwim. But what if the DWIM command doesn't exist or the author has written a command for what /they/ mean? This is your editor, so you can make it do what /you/ mean. Take for example, [[https://orgmode.org/manual/Handling-Links.html][org-insert-link]], bound to /C-c C-l/ by default. It's handy for inserting [[https://orgmode.org/guide/Hyperlinks.html][org mode links]]. I used it so frequently that I quickly internalized its key binding. Having said that, I often found myself doing some lightweight preprocessing prior to invoking /org-insert-link/. What if I can /make org-insert-link do what I mean/? ** What do I mean? *** Use URLs when in clipboard If the URL is already in the clipboard, don't ask me for it. Just use it. *** Use the region too If I have a region selected and there's a URL in the clipboard, just sort it out without user interaction. #+ATTR_HTML: :width 50% :height 50% [[file:images/emacs-dwim-do-what-i-mean/link-this-text.gif]] *** Automatically fetch titles Automatically fetch URL titles from their HTML tag, but ask me for tweaks before insertion. #+ATTR_HTML: :width 50% :height 50% [[file:images/emacs-dwim-do-what-i-mean/do-what-i-mean.gif]] *** Fallback to org-insert-link If my DWIM rules don't apply, fall back to using good ol' [[https://orgmode.org/manual/Handling-Links.html][org-insert-link]]. My most common use case here is when editing an existing link where I don't want neither its title nor URL automatically handled. #+ATTR_HTML: :width 50% :height 50% [[file:images/emacs-dwim-do-what-i-mean/edit-link.gif]] ** The code This is your own DWIM command that does what /you/ mean. Strive to write a clean implementation, but hey you can be forgiven for not handling all the cases that other folks /may/ want or inlining more code than usual. The goal is to bend your editor a little, not write an Emacs package. #+begin_src emacs-lisp (defun ar/org-insert-link-dwim () "Like `org-insert-link' but with personal dwim preferences." (interactive) (let* ((point-in-link (org-in-regexp org-link-any-re 1)) (clipboard-url (when (string-match-p "^http" (current-kill 0)) (current-kill 0))) (region-content (when (region-active-p) (buffer-substring-no-properties (region-beginning) (region-end))))) (cond ((and region-content clipboard-url (not point-in-link)) (delete-region (region-beginning) (region-end)) (insert (org-make-link-string clipboard-url region-content))) ((and clipboard-url (not point-in-link)) (insert (org-make-link-string clipboard-url (read-string "title: " (with-current-buffer (url-retrieve-synchronously clipboard-url) (dom-text (car (dom-by-tag (libxml-parse-html-region (point-min) (point-max)) 'title)))))))) (t (call-interactively 'org-insert-link))))) #+end_src ** Org web tools package I showed how to write your own DWIM command, so you can make Emacs do what ✨you✨ mean. /ar/org-insert-link-dwim/ was built for my particular needs. Having said all of this, alphapapa has built a great package with helpers for the org web/link space. It doesn't do what I mean (for now anyway), but it may work for you: [[https://github.com/alphapapa/org-web-tools][org-web-tools: View, capture, and archive Web pages in Org-mode]][fn:1]. [fn:1] This link was brought to you by /ar/org-insert-link-dwim/. * [2021-05-28 Fri] Emacs link scraping (2021 edition) :PROPERTIES: :CUSTOM_ID: emacs-link-scraping-2021-edition :END: #+ATTR_HTML: :width 95% :height 95% [[file:images/emacs-link-scraping-2021-edition/scrape.png]] A recent Hacker News post, [[https://news.ycombinator.com/item?id=27302195][Ask HN: Favorite Blogs by Individuals]], led me to dust off my oldie but trusty [[https://github.com/xenodium/dotsies/blob/92ef8259f016cdd4f67caf0e520096f6da4f7a18/emacs/ar/ar-url.el#L42][command to extract comment links]]. I use it to dissect these wonderful references more effectively. You see, I wrote this command [[https://xenodium.com/get-emacs-to-gather-links-in-posts/][back in 2015]]. We can likely revisit and improve. The [[https://github.com/zweifisch/enlive][enlive]] package continues to do a fine job [[https://github.com/zweifisch/enlive/blob/604a8ca272b6889f114e2b5a13adb5b1dc4bae86/enlive.el#L39][fetching]], parsing, and [[https://github.com/zweifisch/enlive/blob/604a8ca272b6889f114e2b5a13adb5b1dc4bae86/enlive.el#L142][querying]] HTML. Let's improve my code instead... we can shed a few redundant bits and maybe use [[https://xenodium.com/modern-elisp-libraries/][newer libraries and features]]. Most importantly, let's improve the user experience by sanitizing and filtering URLs a little better. We start by writing a function that looks for a URL in the clipboard and subsequently fetches, parses, and extracts all links found in the target page. #+begin_src emacs-lisp (require 'enlive) (require 'seq) (defun ar/scrape-links-from-clipboard-url () "Scrape links from clipboard URL and return as a list. Fails if no URL in clipboard." (unless (string-prefix-p "http" (current-kill 0)) (user-error "no URL in clipboard")) (thread-last (enlive-query-all (enlive-fetch (current-kill 0)) [a]) (mapcar (lambda (element) (string-remove-suffix "/" (enlive-attr element 'href)))) (seq-filter (lambda (link) (string-prefix-p "http" link))) (seq-uniq) (seq-sort (lambda (l1 l2) (string-lessp (replace-regexp-in-string "^http\\(s\\)*://" "" l1) (replace-regexp-in-string "^http\\(s\\)*://" "" l2)))))) #+end_src Let's chat /(current-kill 0)/ for a sec. No improvement from my previous usage, but let's just say building interactive commands that work with your current clipboard (or [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Kill-Ring.html][kill ring]] in Emacs terminology) is super handy (see [[https://xenodium.com/emacs-clone-git-repo-from-clipboard/][clone git repo from clipboard]]). Moving on to sanitizing and filtering URLs... Links often have trailing slashes. Let's flush them. [[https://github.com/emacs-mirror/emacs/blob/3af9e84ff59811734dcbb5d55e04e1fdb7051e77/lisp/emacs-lisp/subr-x.el#L261][string-remove-suffix]] to the rescue. This and other handy string-manipulating functions are built into Emacs since 24.4 as part of [[https://github.com/emacs-mirror/emacs/blob/master/lisp/emacs-lisp/subr-x.el][subr-x.el]]. Next, we can keep http(s) links and ditch everything else. The end-goal is to extract links posted by users, so these are typically fully qualified external URLs. [[https://github.com/emacs-mirror/emacs/blob/3af9e84ff59811734dcbb5d55e04e1fdb7051e77/lisp/emacs-lisp/seq.el][seq-filter]] steps up to the task, included in Emacs since 25.1 as part of the [[https://github.com/emacs-mirror/emacs/blob/master/lisp/emacs-lisp/seq.el][seq.el family]]. We remove duplicate links using [[https://github.com/emacs-mirror/emacs/blob/3af9e84ff59811734dcbb5d55e04e1fdb7051e77/lisp/emacs-lisp/seq.el#L431][seq-uniq]] and sort them via [[https://github.com/emacs-mirror/emacs/blob/3af9e84ff59811734dcbb5d55e04e1fdb7051e77/lisp/emacs-lisp/seq.el#L255][seq-sort]]. All part of the same package. When sorting, we could straight up use /seq-sort/ and /string-lessp/ and nothing else, but it would separate http and https links. Let's not do that, so we drop /http(s)/ prior to comparing strings in /seq-sort/'s predicate. [[https://github.com/emacs-mirror/emacs/blob/3af9e84ff59811734dcbb5d55e04e1fdb7051e77/lisp/subr.el#L4468][replace-regexp-in-string]] does the job here, but if you'd like to skip regular expressions, [[https://github.com/emacs-mirror/emacs/blob/3af9e84ff59811734dcbb5d55e04e1fdb7051e77/lisp/emacs-lisp/subr-x.el#L255][string-remove-prefix]] works just as well. Yay, sorting no longer cares about http vs https: #+begin_src https://andymatuschak.org http://antirez.com https://apenwarr.ca/log ... #+end_src With all that in mind, let's flatten list processing using [[https://github.com/emacs-mirror/emacs/blob/3af9e84ff59811734dcbb5d55e04e1fdb7051e77/lisp/emacs-lisp/subr-x.el#L69][thread-last]]. This isn't strictly necessary, but since this is the 2021 edition, we'll throw in this macro added to Emacs in 2016 as part of 25.1. Arthur Malabarba has a [[https://endlessparentheses.com/new-in-emacs-25-1-more-flow-control-macros.html][great post on thread-last]]. Now that we've built out /ar/scrape-links-from-clipboard-url/ function, let's make its content consumable! ** The completing frameworks way This is the 2021 edition, so power up your completion framework du jour and feed the output of /ar/scrape-links-from-clipboard-url/ to our completion robots... #+ATTR_HTML: :width 95% :height 95% [[file:images/emacs-link-scraping-2021-edition/scrape_complete.gif]] I'm heavily vested in [[https://github.com/abo-abo/swiper][ivy]], but since we're using the built-in [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Completion.html][completing-read]] function, any completion framework like [[https://github.com/minad/vertico][vertico]], [[https://github.com/raxod502/selectrum/][selectrum]], [[https://github.com/emacs-helm/helm][helm]], or [[https://www.gnu.org/software/emacs/manual/html_node/ido/index.html][ido]] should kick right in to give you extra powers. #+begin_src emacs-lisp (defun ar/view-completing-links-at-clipboard-url () "Scrape links from clipboard URL and open all in external browser." (interactive) (browse-url (completing-read "links: " (ar/scrape-links-from-clipboard-url)))) #+end_src ** The auto-open way (use with caution) Sometimes you just want to open every link posted in the comments and use your browser to discard, closing tabs as needed. The recent HN news instance wasn't one of these cases, with a whopping 398 links returned by our /ar/scrape-links-from-clipboard-url/. #+ATTR_HTML: :width 95% :height 95% [[file:images/emacs-link-scraping-2021-edition/scrape_browse.gif]] /Note: I capped the results to 5 in this gif/demo to prevent a Firefox tragedy (see [[https://github.com/emacs-mirror/emacs/blob/3af9e84ff59811734dcbb5d55e04e1fdb7051e77/lisp/emacs-lisp/seq.el#L231][seq-take]])./ In a case like Hacker News's, we don't want to surprise-attack the user and bomb their browser by opening a gazillion tabs, so let's give a little heads-up using [[https://github.com/emacs-mirror/emacs/blob/3af9e84ff59811734dcbb5d55e04e1fdb7051e77/lisp/subr.el#L2869][y-or-n-p]]. #+begin_src emacs-lisp (defun ar/browse-links-at-clipboard-url () (interactive) (let ((links (ar/scrape-links-from-clipboard-url))) (when (y-or-n-p (format "Open all %d links? " (length links))) (mapc (lambda (link) (browse-url link)) links)))) #+end_src ** The org way My [[https://xenodium.com/get-emacs-to-gather-links-in-posts/][2015 solution]] leveraged an [[https://orgmode.org/][org mode]] buffer to dump the fetched links. The org way is still my favorite. You can use whatever existing Emacs super powers you already have on top of the org buffer, including searching and filtering fueled by your favourite completion framework. I'm a fan of [[https://oremacs.com/][Oleh]]'s [[https://github.com/abo-abo/swiper][swiper]]. #+ATTR_HTML: :width 95% :height 95% [[file:images/emacs-link-scraping-2021-edition/scrape_org.gif]] The 2021 implementation is mostly a tidy-up, removing some cruft, but also uses our new /ar/scrape-links-from-clipboard-url/ function to filter and sort accordingly. #+begin_src emacs-lisp (require 'org) (defun ar/view-links-at-clipboard-url () "Scrape links from clipboard URL and dump to an org buffer." (interactive) (with-current-buffer (get-buffer-create "*links*") (org-mode) (erase-buffer) (mapc (lambda (link) (insert (org-make-link-string link) "\n")) (ar/scrape-links-from-clipboard-url)) (goto-char (point-min)) (switch-to-buffer (current-buffer)))) #+end_src ** Emacs + community + packages + your own glue = awesome To power our 2021 link scraper, we've used newer libraries included in more recent versions of Emacs, leveraged an older but solid HTML-parsing package, pulled in org mode (the epicenter of Emacs note-taking), dragged in our favorite completion framework, and tickled our handy browser all by smothering the lot with some elisp glue to make Emacs do exactly what we want. [[http://emacsrocks.com/][Emacs does rock]]. * [2021-05-23 Sun] OCR bookmarks :PROPERTIES: :CUSTOM_ID: ocr-bookmarks :END: - [[https://github.com/schappim/macOCR][schappim/macOCR: Get any text on your screen into your clipboard.]]. * [2021-05-19 Wed] gpg: decryption failed: No secret key (macOS) :PROPERTIES: :CUSTOM_ID: gpg-decryption-failed-no-secret-key-macos :END: #+begin_src gpg: decryption failed: No secret key #+end_src OMG! Where's my secret key gone!? But but but, /gpg --list-secret-keys/ says they're there. Puzzled... Ray Oei's Stack Overflow [[https://stackoverflow.com/a/66234166][answer]] solved the mystery for me: pinentry never got invoked, so likely something's up with the agent... Killing (and thus restaring) the gpg-agent did the trick: #+begin_src sh gpgconf --kill gpg-agent #+end_src Thank you internet stranger. Balance restored. * [2021-05-17 Mon] Emacs plus --with-native-comp :PROPERTIES: :CUSTOM_ID: emacs-plus-with-native-comp :END: #+ATTR_HTML: :width 75% :height 75% [[file:images/emacs-plus-with-native-comp/brew-native-comp.png]] I'm a big fan of [[https://d12frosted.io/][Boris Buliga]]'s [[https://github.com/d12frosted/homebrew-emacs-plus][Emacs Plus]] [[https://brew.sh/][homebrew]] recipe for customizing and installing Emacs builds on macOS. For a little while, I took a detour and built Emacs myself, so I could enable [[https://twitter.com/Koral_001][Andrea Corallo]]'s fantastic [[http://akrl.sdf.org/gccemacs.html][native compilation]]. I documented the steps [[https://xenodium.com/trying-out-gccemacs-on-macos/][here]]. Though it was fairly straightforward, I did miss Emacs Plus's convenience. I had been meaning to check back on Emacs Plus for native compilation support. Turns out, it was merged back in [[https://github.com/d12frosted/homebrew-emacs-plus/pull/188][Dec 2020]], and it works great! Enabling native compilation is simple (just use /--with-native-comp/). As a bonus, you get all the Emacs Plus goodies. I'm loving /--with-elrumo2-icon/, enabling a spiffy icon to go with macOS Big Sur. /--with-no-frame-refocus/ is also handy to [[https://xenodium.com/no-emacs-frame-refocus-on-macos/][avoid refocusing other frames]] when another one is closed. In any case, here's the minimum needed to install Emacs Plus with native compilation support enabled: #+begin_src sh brew tap d12frosted/emacs-plus brew install emacs-plus@28 --with-native-comp #+end_src Sit tight. Homebrew will build and install some chunky dependencies (including gcc and libgccjit). Note: Your init.el needs tweaking to take advantage of native compilation. See my [[https://xenodium.com/trying-out-gccemacs-on-macos/][previous post]] for how I set mine, or go straight to [[https://github.com/xenodium/dotsies/blob/main/emacs/features/fe-package-extensions.el#L19][my config]]. * [2021-05-02 Sun] Cycling window layouts with hammerspoon :PROPERTIES: :CUSTOM_ID: cycling-window-layouts-via-hammerspoon :END: Back in January, Patrik Collison [[https://twitter.com/patrickc/status/1351650517869465601][tweeted]] about [[https://rectangleapp.com/][Rectangle]]'s [[https://github.com/rxhanson/Rectangle/wiki/Todo-Mode][Todo mode]]. Rectangle looks great. Although I've not yet adopted it, Todo mode really resonates with me. I've been achieving similar functionality with [[https://www.hammerspoon.org/][hammerspoon]]. #+ATTR_HTML: :width 75% :height 75% [[file:images/cycling-window-layouts-via-hammerspoon/cycle.gif]] Here's a quick and dirty function to cycle through my window layouts: #+begin_src python function reframeFocusedWindow() local win = hs.window.focusedWindow() local maximizedFrame = win:screen():frame() maximizedFrame.x = maximizedFrame.x + 15 maximizedFrame.y = maximizedFrame.y + 15 maximizedFrame.w = maximizedFrame.w - 30 maximizedFrame.h = maximizedFrame.h - 30 local leftFrame = win:screen():frame() leftFrame.x = leftFrame.x + 15 leftFrame.y = leftFrame.y + 15 leftFrame.w = leftFrame.w - 250 leftFrame.h = leftFrame.h - 30 local rightFrame = win:screen():frame() rightFrame.x = rightFrame.w - 250 + 15 rightFrame.y = rightFrame.y + 15 rightFrame.w = 250 - 15 - 15 rightFrame.h = rightFrame.h - 30 -- Make space on right if win:frame() == maximizedFrame then win:setFrame(leftFrame) return end -- Make space on left if win:frame() == leftFrame then win:setFrame(rightFrame) return end win:setFrame(maximizedFrame) end #+end_src A here's my *⌥-F* binding to *reframeFocusedWindow*: #+begin_src python hs.hotkey.bind({"alt"}, "F", reframeFocusedWindow) #+end_src * [2021-04-10 Sat] Flat Habits meets org agenda :PROPERTIES: :CUSTOM_ID: flat-habits-meets-org-agenda :END: UPDATE: Flat Habits now has its own page at [[https://flathabits.com/][flathabits.com]]. Flat Habits v1.0.2 is [[https://apps.apple.com/app/id1558358855][out today]], with habit-toggling now supported from the streak view. Flat Habits runs on org, making it a great complement to Emacs and org agenda \o/ #+ATTR_HTML: :width 75% :height 75% [[file:images/flat-habits-meets-org-agenda/flat_agenda.gif]] #+BEGIN_EXPORT html
today_no_filter.png
#+END_EXPORT * [2021-03-23 Tue] Flat Habits v1.0.1 (org import menu) :PROPERTIES: :CUSTOM_ID: flat-habits-v101-org-import-menu :END: UPDATE: Flat Habits now has its own page at [[https://flathabits.com/][flathabits.com]]. Flat Habits v1.0.1 is now released and [[https://apps.apple.com/app/id1558358855][available]] in the App Store. ** org import (import vs in-place) We can now import org files from the menu. Importing gives ya the option to either import (copy into the app) or open in-place. The latter enables users to sync org files with other iOS apps or just open/edit from Emacs for the full org-mode/agenda experience. #+BEGIN_EXPORT html
today_no_filter.png today_no_filter.png
#+END_EXPORT Syncing with your desktop can be achieved by either iCloud or by enabling other providers in the Files app (after installing the likes of Google Drive, Dropbox, etc). /Please note that importing (copying into the app) is currently the recommended flow./ Opening in-place and syncing is still fairly experimental, so please back up your org files regularly. If you do run into syncing issues, please get in touch. Good luck with your habits! * [2021-03-17 Wed] Flat Habits for iOS (powered by org) :PROPERTIES: :CUSTOM_ID: flat-habits-for-ios :END: UPDATE: Flat Habits now has its own page at [[https://flathabits.com/][flathabits.com]]. /No friction. No social. No analytics. No account. No cloud. No lock-in./ ** So what is it? An iOS app to help you form and track lasting habits. #+BEGIN_EXPORT html
today_no_filter.png today_no_filter.png today_no_filter.png
#+END_EXPORT ** Why an app? Tracking and accountability may help you develop positive habits. A simple habit-tracking app should make this easy. I'm not a habits expert, but got inspired by James Clear's [[https://jamesclear.com/atomic-habits][Atomic Habits]]. Read that book if you're interested in the topic. I wanted a frictionless habit tracker that gets out of the way, so I built one to my taste. ** Sounds like a lot of work? You mean habit tracking? It's not. I tried to make the app simple and focused. Mark a habit done whenever you do it. It's really encouraging to see your daily streaks grow. I really don't want to break them. ** What kind of habits? Any recurring habit you'd like to form like exercise, water the plants, read, make your bed, recycle, call grandma, yoga, cleaning, drink water, meditate, take a nap, make your lunch, journal, laundry, push-ups, sort out the dryer filter, floz, take your vitamins, take your meds, eat salad, eat fruit, practice a language, practice an instrument, go to bed early... ** So it's like a task/todo app? Nope. This app focuses solely on habits. Unlike todos/tasks, habits must happen regularly. If you don't water the plants, they will die. If you don't exercise regularly, you won't get the health benefits. Keep your habits separate from that long list of todos. You know, that panic-inducing list you're too afraid to look at. ** Where is my data stored? On your iPhone as a plain text file (in [[https://orgmode.org/][org mode]] format). You can view, edit, or migrate your data at any time (use export from the menu). You may also save it to a shared location, so you can access it from multiple devices/apps. Some of us like to [[http://xenodium.com/frictionless-org-habits-on-ios/][use our beloved text editors]] (Emacs, Vim, VSCode, etc.) to poke at [[https://orgmode.org/manual/Tracking-your-habits.html][habits]]. ** Got more questions? I may not have the answer, but I can try. Ping me at /flathabits*at*xenodium.com/. ** Privacy policy No personal data is sent to any server, as there is no server component to this app. There are neither third party integrations, accounts, analytics, nor trackers in this app. All your data is kept on your iPhone, unless you choose a cloud provider to sync or store your data. See your cloud provider's privacy policy for details on how they may handle it. If you choose to send feedback by email, you have the option to review and attach logs to help diagnose issues. If you'd like an email thread to be deleted, just ask. To join TestFlight as a beta tester, you likely gave your email address. If you'd like your email removed, just ask. Note that TestFlight has its own [[https://www.apple.com/legal/internet-services/itunes/testflight/sren/terms.html][Terms Of Service]]. * [2021-02-21 Sun] Frictionless org habits on iOS :PROPERTIES: :CUSTOM_ID: frictionless-org-habits-on-ios :END: UPDATE: Flat Habits now has its own page at [[https://flathabits.com/][flathabits.com]]. #+ATTR_HTML: :width 80% :height 80% [[file:images/frictionless-org-habits-on-ios/flat_habits.gif]] I've been wanting org to keep track of my daily habits for a little while. The catalyst: reading James Clear's wonderful [[https://jamesclear.com/atomic-habits][Atomic Habits]] (along with plenty of lock-down inspiration). As much as I live in Emacs and org mode, it just wasn't practical enough to rely on my laptop for tracking habits. I wanted less friction, so I've been experimenting with building a toy app for my needs. Naturally, org support was a strict requirement, so I could always poke at it from my beloved editor. I've been using the app every day with success. The habits seem to be sticking, but equally important, it's been really fun to join the fabulous world of Emacs/Org with iOS/SwiftUI. This is all very experimental[fn:1] and as mentioned on [[https://www.reddit.com/r/emacs/comments/ljurwx/org_habits_ios_app_want_to_try_it/][reddit]] (follow-up [[https://www.reddit.com/r/emacs/comments/lp62vn/org_habits_ios_app_followup_twoway_edit/][here]]) and [[https://twitter.com/xenodium/status/1361034010047176705][twitter]], the app isn't available on the App Store. I may consider publishing if there's enough interest, but in the mean time, you can reach out and install via [[https://testflight.apple.com/][TestFlight]]. Send me an email address to /flathabits*at*xenodium.com/ for a TestFlight invite. [fn:1] The app's been fairly stable, but who knows... please backup your org file before feeding it to the lion. ** 2021-03-12 Update: Now with iOS Files app/sync integration If you can sync your org file with your iPhone (ie. Drive/Dropbox/iCloud), and list it in the Files app, you should be able to open/edit[fn:1] with /Flat Habits/ (that's the name now). With iOS Files integration, you should be able to sync your habits between your iPhone and your [[https://www.gnu.org/software/emacs/][funky editor]] powering org mode[fn:2]. #+ATTR_HTML: :width 40% [[file:images/frictionless-org-habits-on-ios/filesapp_shorter.gif]] [fn:2] Yes, this post was written in [[https://orgmode.org/][org mode]]. * [2021-02-20 Sat] Symbolicating iOS crashes :PROPERTIES: :CUSTOM_ID: symbolicating-ios-crashes :END: #+begin_src sh export DEVELOPER_DIR=$(xcode-select --print-path) /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash crashlog.crash MyFoo.app.dSYM #+end_src * [2021-01-23 Sat] Emacs: mu4e icons :PROPERTIES: :CUSTOM_ID: mu4e-icons :END: Recently spotted [[https://github.com/stardiviner/mu4e-marker-icons][mu4e-marker-icons]], which adds mu4e icons using [[https://github.com/domtronn/all-the-icons.el][all-the-icons]]. Although I'm not currently using all-the-icons, it did remind me to take a look at mu4e's built-in variables to spiff up my email. It's pretty simple. Find the icons you like and set them as follows: #+ATTR_HTML: :width 50% :height 50% [[file:images/mu4e-icons/mu4eicons.png]] #+begin_src emacs-lisp (setq mu4e-headers-unread-mark '("u" . "📩 ")) (setq mu4e-headers-draft-mark '("D" . "🚧 ")) (setq mu4e-headers-flagged-mark '("F" . "🚩 ")) (setq mu4e-headers-new-mark '("N" . "✨ ")) (setq mu4e-headers-passed-mark '("P" . "↪ ")) (setq mu4e-headers-replied-mark '("R" . "↩ ")) (setq mu4e-headers-seen-mark '("S" . " ")) (setq mu4e-headers-trashed-mark '("T" . "🗑️")) (setq mu4e-headers-attach-mark '("a" . "📎 ")) (setq mu4e-headers-encrypted-mark '("x" . "🔑 ")) (setq mu4e-headers-signed-mark '("s" . "🖊 ")) #+end_src * [2021-01-02 Sat] Luxembourg travel bookmarks :PROPERTIES: :CUSTOM_ID: luxembourg-travel-bookmarks :END: - [[https://www.mullerthal-trail.lu/en][Hiking in Luxembourg - Mullerthal Trail]]. * [2021-01-02 Sat] South Africa travel bookmarks :PROPERTIES: :CUSTOM_ID: south-africa-travel-bookmarks :END: - [[https://www.tripsavvy.com/blyde-river-canyon-south-africa-guide-4157668][Blyde River Canyon, South Africa: The Complete Guide]]. * [2020-12-29 Tue] Swift package code coverage (plus Emacs overlay) :PROPERTIES: :CUSTOM_ID: swift-package-code-coverage :END: While playing around with Swift package manager, I had a quick look into code coverage options. Luckily, coverage reporting and exporting are supported out of the box (via [[https://llvm.org/docs/CommandGuide/llvm-cov.html][llvm-cov]]). Ensure tests are invoked as follows: #+begin_src sh swift test --enable-code-coverage #+end_src A high level report can be generated with: #+begin_src bash :results verbatim xcrun llvm-cov report .build/x86_64-apple-macosx/debug/FooPackageTests.xctest/Contents/MacOS/FooPackageTests \ -instr-profile=.build/x86_64-apple-macosx/debug/codecov/default.profdata -ignore-filename-regex=".build|Tests" #+end_src #+RESULTS: : Filename Regions Missed Regions Cover Functions Missed Functions Executed Lines Missed Lines Cover : -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- : /tmp/Foo/Sources/Foo/Foo.swift 2 1 50.00% 2 1 50.00% 6 3 50.00% : -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- : TOTAL 2 1 50.00% 2 1 50.00% 6 3 50.00% llvm-cov can export as lcov format: #+begin_src sh xcrun llvm-cov export -format="lcov" .build/x86_64-apple-macosx/debug/FooPackageTests.xctest/Contents/MacOS/FooPackageTests -instr-profile=.build/x86_64-apple-macosx/debug/codecov/default.profdata -ignore-filename-regex=".build|Tests" > coverage.lcov #+end_src With the report in lcov format, we can look for an Emacs package to visualize coverage in source files. Found [[https://github.com/twada/coverlay.el][coverlay.el]] to require minimal setup. I was interested in highlighting only untested areas, so I set /tested-line-background-color/ to nil: #+begin_src emacs-lisp (use-package coverlay :ensure t :config (setq coverlay:tested-line-background-color nil)) #+end_src After installing coverlay, I enabled the minor mode via /M-x coverlay-minor-mode/, invoked /M-x coverlay-watch-file/ to watch /coverage.lcov/ for changes, and voilà! [[file:images/swift-package-code-coverage/coverage.png]] * [2020-12-29 Tue] Hiking bookmarks :PROPERTIES: :CUSTOM_ID: hiking-bookmarks :END: - [[https://news.ycombinator.com/item?id=25568856][A growing list of long distance hikes around the world (Hacker News)]]. * [2020-12-28 Mon] Patience :PROPERTIES: :CUSTOM_ID: patience :END: Via [[https://twitter.com/orangebook_/status/1291844997097099265?s=12][Orange Book]], a reminder to myself: - In investing, patience is rewarded. - In growing a talent, patience is rewarded. - In building a business, patience is rewarded. - In love and friendships, patience is rewarded. - Patience = success I feel like there's an Emacs lesson somewhere in there... * [2020-12-26 Sat] Chess bookmarks :PROPERTIES: :CUSTOM_ID: chess-bookmarks :END: - [[https://dwheeler.com/chess-openings/][A Beginner's Garden of Chess Openings]]. - [[https://news.ycombinator.com/item?id=25446399][A Beginner's Garden of Chess Openings (2002) (Hacker News)]]. * [2020-12-20 Sun] 40 Coolest neighbourhoods in the world :PROPERTIES: :CUSTOM_ID: 40-coolest-neighborhoods-in-the-world :END: Via TimeOut's [[https://www.timeout.com/coolest-neighbourhoods-in-the-world][40 Coolest Neighbourhoods in the World Right Now]]: 1. Esquerra de l’Eixample, Barcelona 2. Downtown, Los Angeles 3. Sham Shui Po, Hong Kong 4. Bedford-Stuyvesant, New York 5. Yarraville, Melbourne 6. Wedding, Berlin 7. Shaanxi Bei Lu/Kangding Lu, Shanghai 8. Dennistoun, Glasgow 9. Haut-Marais, Paris 10. Marrickville, Sydney 11. Verdun, Montreal 12. Kalamaja, Tallinn 13. Hannam-dong, Seoul 14. Bonfim, Porto 15. Ghosttown, Oakland 16. Chula-Samyan, Bangkok 17. Alvalade, Lisbon 18. Noord, Amsterdam 19. Centro, São Paulo 20. Holešovice, Prague 21. Lavapiés, Madrid 22. Opebi, Lagos 23. Narvarte, Mexico City 24. Uptown, Chicago 25. Little Five Points, Atlanta 26. Wynwood, Miami 27. Phibsboro, Dublin 28. Nørrebro, Copenhagen 29. Bugis, Singapore 30. Gongguan, Taipei 31. Soho, London 32. Binh Thanh, Ho Chi Minh City 33. Melville, Johannesburg 34. Kabutocho, Tokyo 35. Porta Venezia, Milan 36. Taman Paramount, Kuala Lumpur 37. Allston, Boston 38. Bandra West, Mumbai 39. Arnavutköy, Istanbul 40. Banjar Nagi, Ubud * [2020-12-05 Sat] Emacs: Rotate my macOS display :PROPERTIES: :CUSTOM_ID: emacs-rotate-my-macos-display :END: Every so often, I rotate my monitor (vertical vs horizontal) for either work or to watch a movie. macOS enables changing the display rotation via a dropdown menu (under /Preferences > Displays > Rotation/) where you can pick between /Standard/, /90°/, /180°/, and /270°/. That's all fine, but what I'd really like is a quick way to toggle between my preferred two choices: /Standard/ and /270°/. Unsurprisingly, I'd also like to invoke it as an interactive command via Emacs's /M-x/ (see [[http://xenodium.com/emacs-connect-my-bluetooth-speaker/index.html][Emacs: connect my Bluetooth speaker]]). With narrowing frameworks like [[https://github.com/abo-abo/swiper][ivy]], [[https://emacs-helm.github.io/helm/][helm]], and [[https://www.gnu.org/software/emacs/manual/html_mono/ido.html][ido]], invoking these commands is just a breeze. Turns out, this was pretty simple to accomplish, thanks to Eric Nitardy's [[https://github.com/CdLbB/fb-rotate][fb-rotate]] command line utility. All that's left to do is wrap it in a tiny elisp +function+ hack, add the toggling logic, and voilà! #+ATTR_HTML: :width 75% :height 75% [[file:images/emacs-rotate-my-macos-display/rotate.gif]] /The screen capture goes a little funky when rotating the display, but you get the idea. It works better in person :)/ ...and here's the snippet: #+begin_src emacs-lisp (defun ar/display-toggle-rotation () (interactive) (require 'cl-lib) (cl-assert (executable-find "fb-rotate") nil "Install fb-rotate from https://github.com/CdLbB/fb-rotate") ;; # Display_ID Resolution ____Display_Bounds____ Rotation ;; 2 0x2b347692 1440x2560 0 0 1440 2560 270 [main] ;; From fb-rotate output, get the `current-rotation' from Column 7, row 1 zero-based. (let ((current-rotation (nth 7 (split-string (nth 1 (process-lines "fb-rotate" "-i")))))) (call-process-shell-command (format "fb-rotate -d 1 -r %s" (if (equal current-rotation "270") "0" "270"))))) #+end_src * [2020-11-29 Sun] Emacs: Clone git repo from clipboard :PROPERTIES: :CUSTOM_ID: emacs-clone-git-repo-from-clipboard :END: Cloning git repositories is a pretty common task. For me, it typically goes something like: - Copy git repo URL from browser. - Drop to Emacs eshell. - Change current directory. - Type "git clone ". - Paste git repo URL. - Run git command. - Change directory to cloned repo. - Open dired. No biggie, but why go through the same steps every time? We can do better. We have a hyper malleable editor, so let's get it to grab the URL from clipboard and do its thing. /shell-command/ or /async-shell-command/ can help in this space, but require additional work: change location, re-type command, what if directory already exists... This is Emacs, so we can craft the exact experience we want. I did take inspiration from /shell-command/ to display the process buffer correctly (git progress, control codes, etc.) and landed on the following experience: #+ATTR_HTML: :width 75% :height 75% [[file:images/emacs-clone-git-repo-from-clipboard/git_clone_dired.gif]] #+begin_src emacs-lisp ;; -*- lexical-binding: t -*- (defun ar/git-clone-clipboard-url () "Clone git URL in clipboard asynchronously and open in dired when finished." (interactive) (cl-assert (string-match-p "^\\(http\\|https\\|ssh\\)://" (current-kill 0)) nil "No URL in clipboard") (let* ((url (current-kill 0)) (download-dir (expand-file-name "~/Downloads/")) (project-dir (concat (file-name-as-directory download-dir) (file-name-base url))) (default-directory download-dir) (command (format "git clone %s" url)) (buffer (generate-new-buffer (format "*%s*" command))) (proc)) (when (file-exists-p project-dir) (if (y-or-n-p (format "%s exists. delete?" (file-name-base url))) (delete-directory project-dir t) (user-error "Bailed"))) (switch-to-buffer buffer) (setq proc (start-process-shell-command (nth 0 (split-string command)) buffer command)) (with-current-buffer buffer (setq default-directory download-dir) (shell-command-save-pos-or-erase) (require 'shell) (shell-mode) (view-mode +1)) (set-process-sentinel proc (lambda (process state) (let ((output (with-current-buffer (process-buffer process) (buffer-string)))) (kill-buffer (process-buffer process)) (if (= (process-exit-status process) 0) (progn (message "finished: %s" command) (dired project-dir)) (user-error (format "%s\n%s" command output)))))) (set-process-filter proc #'comint-output-filter))) #+end_src Comment on [[https://www.reddit.com/r/emacs/comments/k3iter/simplequick_git_repo_clone_from_browser_to_emacs/][reddit]] or [[https://twitter.com/xenodium/status/1333111043791458309][twitter]]. ** Updates - Added lexical binding. - Checks clipboard for ssh urls also. * [2020-11-23 Mon] Pulled pork recipe :PROPERTIES: :CUSTOM_ID: pulled-pork-recipe :END: Made pulled pork a couple of times. Freestyled a bit. No expert here, but result was yummie. ** Grind/blend spices - 2 teaspoons smoked paprika - 2 teaspoons cumin seeds - 2 teaspoons whole pepper corn mix - 2 teaspoons chilly flakes If spices are whole, grind or blend them. Set aside. Optionally: Substitute 1 teaspoon of paprika with chipotle pepper. #+ATTR_HTML: :width 50% :height 50% [[file:images/pulled-pork-recipe/grind.jpg]] #+ATTR_HTML: :width 50% :height 50% [[file:images/pulled-pork-recipe/ground.jpg]] ** Mix into a paste - 2 tablespoons honey - 1 teaspoon of dijon mustard Mix the honey, mustard, and previous spices into a paste. ** Rub the mix in Rub mix thoroughly into the pork shoulder. ** Bake (1 hour) Place in a pot (lid off) and bake in the oven for 1 hour at 200 °C. ** Add liquids - 1/2 cup of water. - 4 tablespoons of apple cider vinegar. Add liquids to pot. #+ATTR_HTML: :width 50% :height 50% [[file:images/pulled-pork-recipe/almost.jpg]] ** Bake (3-5 hours) Bake between 3 to 5 hours 150 °C. Check every hour or two. Does the meat fall easily when spread with two forks? If so, you're done. #+ATTR_HTML: :width 50% :height 50% [[file:images/pulled-pork-recipe/out.jpg]] ** Pull apart Use two forks to pull the meat apart. #+ATTR_HTML: :width 50% :height 50% [[file:images/pulled-pork-recipe/final.jpg]] * [2020-11-01 Sun] Zettelkasten bookmarks :PROPERTIES: :CUSTOM_ID: zettelkasten-bookmarks :END: :MODIFIED: [2020-12-25 Fri] :END: - [[https://zettelkasten.de/introduction/][Introduction to the Zettelkasten Method]]. - [[https://blog.viktomas.com/posts/slip-box/#fnref:1][Zettelkasten note-taking in 10 minutes · Tomas Vik]]. * [2020-10-28 Wed] Battlestation bookmarks :PROPERTIES: :CUSTOM_ID: battlestation-bookmarks :END: :MODIFIED: [2020-10-28 Wed] :END: - [[https://twitter.com/twostraws/status/1321064772276789248][Hacking with Swift's battlestation.]]. - [[https://www.reddit.com/r/battlestations/][/r/battlestations]]. * [2020-10-27 Tue] Emacs: chaining org babel blocks :PROPERTIES: :CUSTOM_ID: emacs-chaining-org-babel-blocks :END: Recently wanted to chain org babel blocks. That is, aggregate separate source blocks and execute as one combined block. #+ATTR_HTML: :width 50% :height 50% [[file:images/emacs-chaining-org-babel-blocks/chain.gif]] I wanted the chaining primarily driven through header arguments as follows: #+begin_src org ,#+name: block-0 ,#+begin_src swift print("hello 0") ,#+end_src ,#+name: block-1 ,#+begin_src swift :include block-0 print("hello 1") ,#+end_src ,#+RESULTS: block-1 : hello 0 : hello 1 #+end_src I didn't find the above syntax and behaviour supported out of the box (or didn't search hard enough?). Fortunately, this is our beloved and malleable editor, so we can always bend it our way! Wasn't quite sure how to go about it, so I looked at other babel packages for inspiration. [[https://github.com/astahlman/ob-async][ob-async]] was great for that. Turns out, advicing /org-babel-execute-src-block/ did the job: #+begin_src emacs-lisp (defun adviced:org-babel-execute-src-block (&optional orig-fun arg info params) (let ((body (nth 1 info)) (include (assoc :include (nth 2 info))) (named-blocks (org-element-map (org-element-parse-buffer) 'src-block (lambda (item) (when (org-element-property :name item) (cons (org-element-property :name item) item)))))) (while include (unless (cdr include) (user-error ":include without value" (cdr include))) (unless (assoc (cdr include) named-blocks) (user-error "source block \"%s\" not found" (cdr include))) (setq body (concat (org-element-property :value (cdr (assoc (cdr include) named-blocks))) body)) (setf (nth 1 info) body) (setq include (assoc :include (org-babel-parse-header-arguments (org-element-property :parameters (cdr (assoc (cdr include) named-blocks))))))) (funcall orig-fun arg info params))) (advice-add 'org-babel-execute-src-block :around 'adviced:org-babel-execute-src-block) #+end_src Before I built my own support, I did find that [[https://orgmode.org/manual/Noweb-Reference-Syntax.html][noweb]] got me most of what I needed, but required sprinkling blocks with placeholder references. #+ATTR_HTML: :width 50% :height 50% [[file:images/emacs-chaining-org-babel-blocks/noweb.gif]] Combining [[https://orgmode.org/manual/Noweb-Reference-Syntax.html][:noweb]] and [[https://org-babel.readthedocs.io/en/latest/header-args/#prologue][:prologue]] would have been a great match, if only prologue did expand the noweb reference. I'm sure there's an alternative I'm missing. Either way, it was fun to poke at babel blocks and build my own chaining support. * [2020-10-25 Sun] Emacs: quote wrap all in region :PROPERTIES: :CUSTOM_ID: emacs-quote-wrap-all-in-region :END: As I find myself moving more shell commands into Emacs interactive commands to [[http://xenodium.com/emacs-create-a-swift-packageproject/][create a Swift package/project]], [[http://xenodium.com/enrich-your-dired-batching-toolbox/][enrich dired's featureset]], or [[http://xenodium.com/emacs-searchplay-music-macos/][search/play Music (macOS)]], I often need to take a single space-separated string, make an elisp list of strings, and feed it to functions like /process-lines/. No biggie, but I thought it'd be a fun little function to write: take the region and wrap all items in quotes. As a bonus, made it toggable. #+ATTR_HTML: :width 50% :height 50% [[file:images/emacs-quote-wrap-all-in-region/wrap-toggle-region.gif]] #+begin_src emacs-lisp (defun ar/toggle-quote-wrap-all-in-region (beg end) "Toggle wrapping all items in region with double quotes." (interactive (list (mark) (point))) (unless (region-active-p) (user-error "no region to wrap")) (let ((deactivate-mark nil) (replacement (string-join (mapcar (lambda (item) (if (string-match-p "^\".*\"$" item) (string-trim item "\"" "\"") (format "\"%s\"" item))) (split-string (buffer-substring beg end))) " "))) (delete-region beg end) (insert replacement))) #+end_src * [2020-10-18 Sun] Emacs: org block complete and edit :PROPERTIES: :CUSTOM_ID: emacs-edit-after-org-block-completion :END: I quickly got used to [[http://xenodium.com/emacs-org-block-company-completion/][Emacs org block company completion]]. I did, however, almost always found myself running /org-edit-special/ immediately after inserting completion. I use *C-c '* for that. That's all fine, but it just felt redundant. Why not automatically edit the source block in corresponding major mode after completion? I think I can also get used to that! #+ATTR_HTML: :width 50% :height 50% [[file:images/emacs-edit-after-org-block-completion/automatic.gif]] Or maybe the automatic approach is too eager? There's also a middle ground: ask immediately after. #+ATTR_HTML: :width 50% :height 50% [[file:images/emacs-edit-after-org-block-completion/prompted.gif]] Or maybe I don't want either in the end? Time will tell, but I now have all three options available: #+begin_src emacs-lisp (defcustom company-org-block-edit-mode 'auto "Customize whether edit mode, post completion was inserted." :type '(choice (const :tag "nil: no edit after insertion" nil) (const :tag "prompt: ask before edit" prompt) (const :tag "auto edit, no prompt" auto))) #+end_src The new option is now in the [[https://github.com/xenodium/dotsies/blob/main/emacs/ar/company-org-block.el][company-org-block snippet]] with my latest config. * [2020-10-11 Sun] Emacs: create a Swift package/project :PROPERTIES: :CUSTOM_ID: emacs-create-a-swift-packageproject :END: Been playing around with [[https://swift.org/package-manager/][Swift Package Manager (SPM)]]. Creating a new Swift package (ie. project) is pretty simple. To create a library package, we can use the following: #+begin_src sh swift package init --type library #+end_src Alternatively, to create a command-line utility use: #+begin_src sh swift package init --type executable #+end_src Turns out, there are a few options: empty, library, executable, system-module, manifest. With a little elisp, we can write a completing function to quickly generate a Swift package/project without the need to drop to the shell. Bonus: I won't have to look up SPM options if I ever forget them. #+ATTR_HTML: :width 75% :height 75% [[file:images/emacs-create-swift-package/swift-package.gif]] #+begin_src emacs-lisp (defun ar/swift-package-init () "Execute `swift package init', with optional name and completing type." (interactive) (let* ((name (read-string "name (default): ")) (type (completing-read "project type: " ;; Splits "--type empty|library|executable|system-module|manifest" (split-string (nth 1 (split-string (string-trim (seq-find (lambda (line) (string-match "--type" line)) (process-lines "swift" "package" "init" "--help"))) " ")) "|"))) (command (format "swift package init --type %s" type))) (unless (string-empty-p name) (append command "--name " name)) (shell-command command)) (dired default-directory) (revert-buffer)) #+end_src * [2020-10-04 Sun] Improved Ctrl-p/Ctrl-n macOS movement :PROPERTIES: :CUSTOM_ID: improved-ctrl-p-ctrl-n-macos-movement :END: macOS supports many Emacs bindings (out of the box). You can, for example, press C-p and C-n to move the cursor up and down (whether editing text in Emacs or any other macOS app). Jacob Rus's [[http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html][Customizing the Cocoa Text System]] offers a more in-depth picture and also shows how to customize global macOS keybindings (via DefaultKeyBinding.dict). In addition to moving Emacs [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Point.html][point]] (cursor) up/down using C-p/C-n, I've internalized the same bindings to select an option from a list. Good Emacs examples of these are [[https://company-mode.github.io/][company mode]] and [[https://github.com/abo-abo/swiper][ivy]]. Vertical cursor movement using Emacs bindings works well in most macOS apps, including forms and text boxes in web pages. However, selecting from a completion list doesn't quite work as expected. Although the binding is technically handled, it moves the cursor within the text widget, ignoring the suggested choices. #+ATTR_HTML: :width 75% :height 75% [[file:images/improved-ctrl-p-ctrl-n-macos-movement/bindings-borked.gif]] Atif Afzal's [[https://www.atfzl.com/use-emacs-key-bindings-everywhere][Use emacs key bindings everywhere]] has a solution for the ignored case. He uses [[https://github.com/pqrs-org/Karabiner-Elements][Karabiner Elements]] to remap c-p and c-n to arrow-up and arrow-down. It's been roughly a week since I started using the Karabiner remapping, and I've yet to find a case where a web page (or any other macOS app) did not respond to c-p and c-n to move selection from a list. #+ATTR_HTML: :width 75% :height 75% [[file:images/improved-ctrl-p-ctrl-n-macos-movement/bindings-fixed.gif]] My ~/.config/karabiner/karabiner.json configuration is as follows: #+begin_src json { "global": { "check_for_updates_on_startup": true, "show_in_menu_bar": true, "show_profile_name_in_menu_bar": false }, "profiles": [ { "complex_modifications": { "parameters": { "basic.simultaneous_threshold_milliseconds": 50, "basic.to_delayed_action_delay_milliseconds": 500, "basic.to_if_alone_timeout_milliseconds": 1000, "basic.to_if_held_down_threshold_milliseconds": 500, "mouse_motion_to_scroll.speed": 100 }, "rules": [ { "description": "Ctrl+p/Ctrl+n to arrow up/down", "manipulators": [ { "from": { "key_code": "p", "modifiers": { "mandatory": [ "control" ] } }, "to": [ { "key_code": "up_arrow" } ], "conditions": [ { "type": "frontmost_application_unless", "bundle_identifiers": [ "^org\\.gnu\\.Emacs" ] } ], "type": "basic" }, { "from": { "key_code": "n", "modifiers": { "mandatory": [ "control" ] } }, "to": [ { "key_code": "down_arrow" } ], "conditions": [ { "type": "frontmost_application_unless", "bundle_identifiers": [ "^org\\.gnu\\.Emacs" ] } ], "type": "basic" } ] } ] }, "devices": [], "fn_function_keys": [], "name": "Default profile", "parameters": { "delay_milliseconds_before_open_device": 1000 }, "selected": true, "simple_modifications": [], "virtual_hid_keyboard": { "country_code": 0, "mouse_key_xy_scale": 100 } } ] } #+end_src ** Bonus (C-g to exit) Pressing Esc often dismisses or cancels macOS windows, menus, etc. This is also the case for web pages. As an Emacs user, I'm pretty used to pressing C-g to cancel, quit, or exit things. With that in mind, mapping C-g to Esc is surprisingly useful outside of Emacs. Here's the relevant Karabiner C-g binding for that: #+begin_src json { "description": "Ctrl+G to Escape", "manipulators": [ { "description": "emacs like escape", "from": { "key_code": "g", "modifiers": { "mandatory": [ "left_control" ] } }, "to": [ { "key_code": "escape" } ], "conditions": [ { "type": "frontmost_application_unless", "bundle_identifiers": [ "^org\\.gnu\\.Emacs" ] } ], "conditions": [ { "type": "frontmost_application_unless", "bundle_identifiers": [ "^org\\.gnu\\.Emacs" ] } ], "type": "basic" } ] } #+end_src UPDATE: Ensure bindings are only active when Emacs is _not_ active. * [2020-10-04 Sun] Basmati rice pudding recipe :PROPERTIES: :CUSTOM_ID: basmati-rice-pudding-recipe :END: #+ATTR_HTML: :width 75% :height 75% [[file:images/basmati-rice-pudding-recipe/rice_pudding.jpg]] ** Combine in a pot - 2/3 cup of basmati rice - 400 ml of coconut milk - 4 cups of milk [1] - 3 tablespoons of honey [2] - 1/4 teaspoon of crushed cardamom seeds [3] - 1/8 teaspoon of salt Simple. Combine all ingredients in a pot. [1] Been using powder milk since lockdown, end-result's been tasty. [2] Only tried raw honey so far. [3] Can likely use ground cardamom. I enjoy the scents while crushing. ** Boil and simmer Bring ingredients to a boil and simmer at low heat for 45 minutes. Stir occasionally. ** Mix in butter - 1 tablespoon of butter. Turn stove off, add a tablespoon of butter, and mix in. ** Serve warm or cold After mixing in the butter, the rice pudding is done. You can serve warm or cold. ** Garnish (optional) - Pistachios - Cinnamon Optionally garnish with either pistachios or cinnamon (or both). * [2020-09-27 Sun] Adding images to pdfs (macOS) :PROPERTIES: :CUSTOM_ID: adding-images-to-pdfs-macos :END: The macOS Preview app does a great job inserting signatures to existing pdfs. I was hoping it could overlay images just as easily. Doesn't look like it's possible, without exporting/reimporting to image formats and losing pdf structure. Did I miss something? In any case, I found [[https://code.google.com/archive/p/formulatepro/][formulatepro]]. Dormant at Google Code Archive, but also [[https://github.com/adlr/formulatepro][checked in to github]]. With a tiny [[https://github.com/xenodium/formulatepro/commit/cd43b1e73c2f180f4b4b7fb11fdec975b6960dc6][patch]], it builds and runs on Catalina. One can easily insert an image via "File > Place Image...". #+ATTR_HTML: :width 75% :height 75% [[file:images/adding-images-to-pdfs-macos/formulatepro.png]] * [2020-09-27 Sun] DIY bookmarks :PROPERTIES: :CUSTOM_ID: diy-bookmarks :END: :MODIFIED: [2020-10-19 Mon] :END: - [[https://linuxhint.com/best_electrical_insulation_tape/][Best electrical insulation tape]]. - [[https://twitter.com/rosen/status/1317843289530376196][I’ve spent the last 3 months building the home office of my dreams]]. * [2020-09-24 Thu] Skiing bookmarks :PROPERTIES: :CUSTOM_ID: skiing-bookmarks :END: - [[https://www.lonelyplanet.com/articles/remote-ski-resorts-europe][7 far-flung European ski resorts - Lonely Planet]]. * [2020-09-19 Sat] Emacs: search/play Music (macOS) :PROPERTIES: :CUSTOM_ID: emacs-searchplay-music-macos :END: While trying out macOS's Music app to manage offline media, I wondered if I could easily search and control playback from Emacs. Spoiler alert: yes it can be done and fuzzy searching music is rather gratifying. #+ATTR_HTML: :width 75% :height 75% [[file:images/emacs-searchplay-music-macos/music_search.gif]] Luckily, the hard work's already handled by [[https://github.com/hile/pytunes][pytunes]], a command line interface to macOS's iTunes/Music app. We add [[https://ffmpeg.org/ffprobe.html][ffprobe]] and some elisp glue to the mix, and we can generate an Emacs media index. Indexing takes roughly a minute per 1000 files. Prolly suboptimal, but I don't intend to re-index frequently. For now, we can use a separate process to prevent Emacs from blocking, so we can get back to playing tetris from our beloved editor: #+begin_src emacs-lisp (defun musica-index () "Indexes Music's tracks in two stages: 1. Generates \"Tracks.sqlite\" using pytunes (needs https://github.com/hile/pytunes installed). 2. Caches an index at ~/.emacs.d/.musica.el." (interactive) (message "Indexing music... started") (let* ((now (current-time)) (name "Music indexing") (buffer (get-buffer-create (format "*%s*" name)))) (with-current-buffer buffer (delete-region (point-min) (point-max))) (set-process-sentinel (start-process name buffer (file-truename (expand-file-name invocation-name invocation-directory)) "--quick" "--batch" "--eval" (prin1-to-string `(progn (interactive) (require 'cl-lib) (require 'seq) (require 'map) (message "Generating Tracks.sqlite...") (process-lines "pytunes" "update-index") ;; Generates Tracks.sqlite (message "Generating Tracks.sqlite... done") (defun parse-tags (path) (with-temp-buffer (if (eq 0 (call-process "ffprobe" nil t nil "-v" "quiet" "-print_format" "json" "-show_format" path)) (map-elt (json-parse-string (buffer-string) :object-type 'alist) 'format) (message "Warning: Couldn't read track metadata for %s" path) (message "%s" (buffer-string)) (list (cons 'filename path))))) (let* ((paths (process-lines "sqlite3" (concat (expand-file-name "~/") "Music/Music/Music Library.musiclibrary/Tracks.sqlite") "select path from tracks")) (total (length paths)) (n 0) (records (seq-map (lambda (path) (let ((tags (parse-tags path))) (message "%d/%d %s" (setq n (1+ n)) total (or (map-elt (map-elt tags 'tags) 'title) "No title")) tags)) paths))) (with-temp-buffer (prin1 records (current-buffer)) (write-file "~/.emacs.d/.musica.el" nil)))))) (lambda (process state) (if (= (process-exit-status process) 0) (message "Indexing music... finished (%.3fs)" (float-time (time-subtract (current-time) now))) (message "Indexing music... failed, see %s" buffer)))))) #+end_src Once media is indexed, we can feed it to [[https://github.com/abo-abo/swiper][ivy]] for that narrowing-down fuzzy-searching goodness! It's worth mentioning the [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Size-of-Displayed-Text.html][truncate-string-to-width]] function. Super handy for truncating strings to a fixed width and visually organizing search results in columns. #+begin_src emacs-lisp (defun musica-search () (interactive) (cl-assert (executable-find "pytunes") nil "pytunes not installed") (let* ((c1-width (round (* (- (window-width) 9) 0.4))) (c2-width (round (* (- (window-width) 9) 0.3))) (c3-width (- (window-width) 9 c1-width c2-width))) (ivy-read "Play: " (mapcar (lambda (track) (let-alist track (cons (format "%s %s %s" (truncate-string-to-width (or .tags.title (file-name-base .filename) "No title") c1-width nil ?\s "…") (truncate-string-to-width (propertize (or .tags.artist "") 'face '(:foreground "yellow")) c2-width nil ?\s "…") (truncate-string-to-width (propertize (or .tags.album "") 'face '(:foreground "cyan1")) c3-width nil ?\s "…")) track))) (musica--index)) :action (lambda (selection) (let-alist (cdr selection) (process-lines "pytunes" "play" .filename) (message "Playing: %s [%s] %s" (or .tags.title (file-name-base .filename) "No title") (or .tags.artist "No artist") (or .tags.album "No album"))))))) (defun musica--index () (with-temp-buffer (insert-file-contents "~/.emacs.d/.musica.el") (read (current-buffer)))) #+end_src The remaining bits are straigtforward. We add a few interactive functions to control playback: #+begin_src emacs-lisp (defun musica-info () (interactive) (let ((raw (process-lines "pytunes" "info"))) (message "%s [%s] %s" (string-trim (string-remove-prefix "Title" (nth 3 raw))) (string-trim (string-remove-prefix "Artist" (nth 1 raw))) (string-trim (string-remove-prefix "Album" (nth 2 raw)))))) (defun musica-play-pause () (interactive) (cl-assert (executable-find "pytunes") nil "pytunes not installed") (process-lines "pytunes" "play") (musica-info)) (defun musica-play-next () (interactive) (cl-assert (executable-find "pytunes") nil "pytunes not installed") (process-lines "pytunes" "next")) (defun musica-play-next-random () (interactive) (cl-assert (executable-find "pytunes") nil "pytunes not installed") (process-lines "pytunes" "shuffle" "enable") (let-alist (seq-random-elt (musica--index)) (process-lines "pytunes" "play" .filename)) (musica-info)) (defun musica-play-previous () (interactive) (cl-assert (executable-find "pytunes") nil "pytunes not installed") (process-lines "pytunes" "previous")) #+end_src Finally, if we want some convenient keybindings, we can add something like: #+begin_src emacs-lisp (global-set-key (kbd "C-c m SPC") #'musica-play-pause) (global-set-key (kbd "C-c m i") #'musica-info) (global-set-key (kbd "C-c m n") #'musica-play-next) (global-set-key (kbd "C-c m p") #'musica-play-previous) (global-set-key (kbd "C-c m r") #'musica-play-next-random) (global-set-key (kbd "C-c m s") #'musica-search) #+end_src Hooray! Controlling music is now an Emacs keybinding away: \o/ comments on [[https://twitter.com/xenodium/status/1307294369326731264][twitter]]. UPDATE1: Installing pytunes with /pip3 install pytunes/ didn't just work for me. Instead, I cloned and installed as: #+begin_src sh git clone https://github.com/hile/pytunes pip3 install file:///path/to/pytunes pip3 install pytz brew install libmagic #+end_src UPDATE2: Checked in to [[https://github.com/xenodium/dotsies/blob/master/emacs/ar/musica.el][dot files]]. * [2020-09-12 Sat] Cheese cake recipe (no crust) :PROPERTIES: :CUSTOM_ID: cheese-cake-recipe-no-crust :END: #+ATTR_HTML: :width 75% :height 75% [[file:images/cheese-cake-recipe-no-crust/berried.jpg]] #+ATTR_HTML: :width 75% :height 75% [[file:images/cheese-cake-recipe-no-crust/inoven.jpg]] ** Preheat oven Preheat oven at 175°C. ** Ingredients at room temperature Ensure the cream cheese, sour cream, and eggs are at room temperature before starting. ** Mix cream cheese - 900g of cream cheese Mix the cream cheese thoroughly. ** Mix sugar - 240g of sugar Add half the sugar. Mix in thoroughly. Add second half and mix. ** Mix sour cream, corn flour, and vanilla. - 100g sour cream - 40g corn flour - 1tbsp vanilla bean paste Add the three ingredients and mix well. ** Mix eggs - 3 eggs - 1 egg yolk Add the eggs and mix for 30 seconds. ** Mix by hand Finish mixing thoroughly by hand, using a wooden spoon. ** Prepare pan - Springform pan - Parchment paper A springform pan works best here. Wrap its plate with parchment paper and lock it in place. ** Pour mix - Strainer Pour the mix through a strainer and into the prepared pan. ** Rest mix Let the mix rest in the pan for 10 minutes to let air bubbles out. ** Bake Bake for an 1 hour 10 minutes. Maybe add another 10 minutes (or more) if surface is still pale. Turn the oven off, leave door half open, and let it sit for 20 minutes. ** Cool off Take out and let it cool off to room temperature. ** Refrigerate Refrigerate for 4 hours (or overnight) before removing the sides of the pan. ** Eat! Nom nom. Yum yum. ** Bonus (topping) I winged this one and it worked out well. Heated up frozen berries with some honey and used it as topping. The whole combo was pretty tasty. * [2020-08-28 Fri] Faster macOS dock auto-hide :PROPERTIES: :CUSTOM_ID: faster-macos-dock-auto-hide :END: #+ATTR_HTML: :width 75% :height 75% [[file:images/faster-macos-dock-auto-hide/dock.gif]] Via Marcin Swieczkowski's [[https://www.bytedude.com/upgrading-the-osx-dock/][Upgrading The OSX Dock]], change default to make macOS's dock auto-hide faster: #+begin_src bash defaults write com.apple.dock autohide-time-modifier -float 0.2; killall Dock #+end_src * [2020-08-25 Tue] Smarter Swift snippets :PROPERTIES: :CUSTOM_ID: smarter-snippets :END: [[https://twitter.com/safijari][Jari Safi]] published a wonderful Emacs video [[https://youtu.be/xmBovJvQ3KU][demoing python yasnippets in action]]. The constructor snippet, automatically setting ivars, is just magical. I wanted it for Swift! I took a look at the [[https://github.com/jorgenschaefer/elpy/blob/060a4eb78ec8eba9c8fe3466c40a414d84b3dc81/snippets/python-mode/__init__][__init__ snippet]] from [[https://github.com/jorgenschaefer][Jorgen Schäfer]]'s [[https://github.com/jorgenschaefer/elpy][elpy]]. It uses [[https://github.com/jorgenschaefer/elpy/blob/060a4eb78ec8eba9c8fe3466c40a414d84b3dc81/snippets/python-mode/.yas-setup.el#L33][elpy-snippet-init-assignments]] to generate the assignments. With small tweaks, we can get the same action going on for Swift \o/ #+ATTR_HTML: :width 75% :height 75% [[file:images/smarter-snippets/snippet.gif]] init.yasnippet: #+begin_src snippet # -*- mode: snippet -*- # name: init with assignments # key: init # -- init(${1:, args}) { ${1:$(swift-snippet-init-assignments yas-text)} } $0 #+end_src .yas-setup.el: #+begin_src emacs-lisp (defun swift-snippet-init-assignments (arg-string) (let ((indentation (make-string (save-excursion (goto-char start-point) (current-indentation)) ?\s))) (string-trim (mapconcat (lambda (arg) (if (string-match "^\\*" arg) "" (format "self.%s = %s\n%s" arg arg indentation))) (swift-snippet-split-args arg-string) "")))) (defun swift-snippet-split-args (arg-string) (mapcar (lambda (x) (if (and x (string-match "\\([[:alnum:]]*\\):" x)) (match-string-no-properties 1 x) x)) (split-string arg-string "[[:blank:]]*,[[:blank:]]*" t))) #+end_src * [2020-08-23 Sun] Swift package manager build for iOS :PROPERTIES: :CUSTOM_ID: swift-package-manager-build-for-ios :END: While playing around with Swift package manager, it wasn't immediately obvious how to build for iOS from the command line. The default behaviour of invoking /swift build/ is to build for the host. In my case, macOS. In any case, this was it: #+begin_src sh swift build -Xswiftc "-sdk" -Xswiftc "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.0.sdk" -Xswiftc "-target" -Xswiftc "x86_64-apple-ios13.0-simulator" #+end_src ps. Can get the SDK path with: #+begin_src sh xcrun --sdk iphonesimulator --show-sdk-path #+end_src * [2020-08-23 Sun] QR code bookmarks :PROPERTIES: :CUSTOM_ID: qr-code-bookmarks :END: :MODIFIED: [2020-12-26 Sat] :END: - [[https://github.com/divan/txqr][divan/txqr: Transfer data via animated QR codes]]. - [[https://research.swtch.com/qart][research!rsc: QArt Codes]]. - [[https://news.ycombinator.com/item?id=24158125][Show HN: Photo Realistic QR-Codes (Hacker News)]]. * [2020-08-16 Sun] Trying out gccemacs on macOS :PROPERTIES: :CUSTOM_ID: trying-out-gccemacs-on-macos :END: /UPDATE: I'm no longer using these steps. See [[https://xenodium.com/emacs-plus-with-native-comp/][Emacs plus --with-native-comp]] for an easier alternative./ Below are the instructions I use to build Andrea Corallo's [[http://akrl.sdf.org/gccemacs.html][gccemacs]] on macOS. It is based on [[https://github.com/AllenDang][Allen Dang]]'s handy [[https://gist.github.com/AllenDang/f019593e65572a8e0aefc96058a2d23e][instructions]] plus some changes of my own. ** Install gcc and libgccjit via homebrew #+begin_src sh brew install gcc libgccjit #+end_src ** Save configure script Create configure-gccemacs.sh #+begin_src sh #!/bin/bash set -o nounset set -o errexit # Configures Emacs for building native comp support # http://akrl.sdf.org/gccemacs.html readonly GCC_DIR="$(realpath $(brew --prefix libgccjit))" [[ -d $GCC_DIR ]] || { echo "${GCC_DIR} not found"; exit 1; } readonly SED_DIR="$(realpath $(brew --prefix gnu-sed))" [[ -d $SED_DIR ]] || { echo "${SED_DIR} not found"; exit 1; } readonly GCC_INCLUDE_DIR=${GCC_DIR}/include [[ -d $GCC_INCLUDE_DIR ]] || { echo "${GCC_INCLUDE_DIR} not found"; exit 1; } readonly GCC_LIB_DIR=${GCC_DIR}/lib/gcc/10 [[ -d $GCC_LIB_DIR ]] || { echo "${GCC_LIB_DIR} not found"; exit 1; } export PATH="${SED_DIR}/libexec/gnubin:${PATH}" export CFLAGS="-O2 -I${GCC_INCLUDE_DIR}" export LDFLAGS="-L${GCC_LIB_DIR} -I${GCC_INCLUDE_DIR}" export LD_LIBRARY_PATH="${GCC_LIB_DIR}" export DYLD_FALLBACK_LIBRARY_PATH="${GCC_LIB_DIR}" echo "Environment" echo "-----------" echo PATH: $PATH echo CFLAGS: $CFLAGS echo LDFLAGS: $LDFLAGS echo DYLD_FALLBACK_LIBRARY_PATH: $DYLD_FALLBACK_LIBRARY_PATH echo "-----------" ./autogen.sh ./configure \ --prefix="$PWD/nextstep/Emacs.app/Contents/MacOS" \ --enable-locallisppath="${PWD}/nextstep/Emacs.app/Contents/MacOS" \ --with-mailutils \ --with-ns \ --with-imagemagick \ --with-cairo \ --with-modules \ --with-xml2 \ --with-gnutls \ --with-json \ --with-rsvg \ --with-native-compilation \ --disable-silent-rules \ --disable-ns-self-contained \ --without-dbus #+end_src Make it executable #+begin_src shell chmod +x configure-gccemacs.sh #+end_src ** Clone Emacs source #+begin_src shell git clone --branch master https://github.com/emacs-mirror/emacs gccemacs #+end_src ** Configure build #+begin_src sh cd gccemacs ../configure-gccemacs.sh #+end_src ** Native lisp compiler found? Verify native lisp compiler is found: #+begin_src fundamental Does Emacs have native lisp compiler? yes #+end_src ** Build Put those cores to use. Find out how many you got with: #+begin_src sh sysctl hw.logicalcpu #+end_src #+RESULTS: : hw.logicalcpu: 4 Ok so build with: #+begin_src sh make -j4 NATIVE_FAST_BOOT=1 cp -r lisp nextstep/Emacs.app/Contents/Resources/ cp -r native-lisp nextstep/Emacs.app/Contents make install #+end_src *Note:* Using /NATIVE_FAST_BOOT=1/ significantly improves build time (totalling between 20-30 mins, depending on your specs). Without it, the build can take *hours*. The macOS app build (under nextstep/Emacs.app) is ready, but read on before launching. ** Remove ~/emacs.d You likely want to start with a clean install, byte-compiling all packages with the latest Emacs version. In any case, rename ~/emacs.d (for backup?) or remove ~/emacs.d. ** init.el config Ensure /exec-path/ includes the script's "--prefix=" value, /LIBRARY_PATH/ points to gcc's lib dir, and finally set /comp-deferred-compilation/. I wrapped the snippet in my /exec-path-from-shell/ config, but setting early in init.el should be enough. #+begin_src emacs-lisp (use-package exec-path-from-shell :ensure t :config (exec-path-from-shell-initialize) (if (and (fboundp 'native-comp-available-p) (native-comp-available-p)) (progn (message "Native comp is available") ;; Using Emacs.app/Contents/MacOS/bin since it was compiled with ;; ./configure --prefix="$PWD/nextstep/Emacs.app/Contents/MacOS" (add-to-list 'exec-path (concat invocation-directory "bin") t) (setenv "LIBRARY_PATH" (concat (getenv "LIBRARY_PATH") (when (getenv "LIBRARY_PATH") ":") ;; This is where Homebrew puts gcc libraries. (car (file-expand-wildcards (expand-file-name "~/homebrew/opt/gcc/lib/gcc/*"))))) ;; Only set after LIBRARY_PATH can find gcc libraries. (setq comp-deferred-compilation t)) (message "Native comp is *not* available"))) #+end_src ** Launch Emacs.app You're good to go. Open Emacs.app via finder or shell: #+begin_src sh open nextstep/Emacs.app #+end_src ** Deferred compilation logs After setting /comp-deferred-compilation/ (in init.el config section), .elc files should be asyncronously compiled. Function definition should be updated to native compiled equivalent. Look out for an **Async-native-compile-log** buffer. Should have content like: #+begin_src fundamental Compiling .emacs.d/elpa/moody-20200514.1946/moody.el... Compiling .emacs.d/elpa/minions-20200522.1052/minions.el... Compiling .emacs.d/elpa/persistent-scratch-20190922.1046/persistent-scratch.el... Compiling .emacs.d/elpa/which-key-20200721.1927/which-key.el... ... #+end_src Can also check for .eln files: #+begin_src sh find ~/.emacs.d -iname *.eln | wc -l #+end_src #+RESULTS: : 149 UPDATE1: Added /Symlink Emacs.app/Contents/eln-cache/ section for [[http://akrl.sdf.org/gccemacs.html#org4b11ea1][update 11]]. UPDATE2: Noted using NATIVE_FAST_BOOT makes the build much faster. UPDATE3: Removed symlinks and copied content instead. This simplifies things. Inspired by Ian Wahbe's [[https://github.com/iwahbe/doom-config/blob/master/build-emacs.sh][build-emacs.sh]]. UPDATE4: Removed homebrew recipe patching. Thanks to Dmitry Shishkin's [[https://github.com/shshkn/emacs.d/blob/master/docs/nativecomp.md][instructions]]. UPDATE5: Use new flag --with-native-compilation and master branch. * [2020-08-02 Sun] SwiftUI macOS desk clock :PROPERTIES: :CUSTOM_ID: swiftui-desk-clock :END: [[file:images/swiftui-desk-clock/everclock.gif]] For time display, I've gone back and forth between an always-displayed macOS's menu bar to an auto-hide menu bar, and letting Emacs display the time. Neither felt great nor settled. With some tweaks, Paul Hudson's [[https://www.hackingwithswift.com/quick-start/swiftui/how-to-use-a-timer-with-swiftui][How to use a timer with SwiftUI]], led me to build a simple desk clock. Ok, let's not get fancy. It's really just an always-on-top floating window, showing a swiftUI label, but hey I like the minimalist feel ;) Let's see if it sticks around or it gets in the way... Either way, here's standalone snippet. Run with /swift deskclock.swift/. #+begin_src swift import Cocoa import SwiftUI let application = NSApplication.shared let appDelegate = AppDelegate() NSApp.setActivationPolicy(.regular) application.delegate = appDelegate application.mainMenu = NSMenu.makeMenu() application.run() struct ClockView: View { @State var time = "--:--" let timer = Timer.publish(every: 1, on: .main, in: .common).autoconnect() var body: some View { GeometryReader { geometry in VStack { Text(time) .onReceive(timer) { input in let formatter = DateFormatter() formatter.dateFormat = "HH:mm" time = formatter.string(from: input) } .font(.system(size: 40)) .padding() }.frame(width: geometry.size.width, height: geometry.size.height) .background(Color.black) .cornerRadius(10) .frame(maxWidth: .infinity, maxHeight: .infinity) } } } extension NSWindow { static func makeWindow() -> NSWindow { let window = NSWindow( contentRect: NSRect.makeDefault(), styleMask: [.closable, .miniaturizable, .resizable, .fullSizeContentView], backing: .buffered, defer: false) window.level = .floating window.setFrameAutosaveName("everclock") window.collectionBehavior = [.canJoinAllSpaces, .stationary, .ignoresCycle, .fullScreenPrimary] window.makeKeyAndOrderFront(nil) window.isMovableByWindowBackground = true window.titleVisibility = .hidden window.backgroundColor = .clear return window } } class AppDelegate: NSObject, NSApplicationDelegate { var window = NSWindow.makeWindow() var hostingView: NSView? func applicationDidFinishLaunching(_ notification: Notification) { hostingView = NSHostingView(rootView: ClockView()) window.contentView = hostingView NSApp.activate(ignoringOtherApps: true) } } extension NSRect { static func makeDefault() -> NSRect { let initialMargin = CGFloat(60) let fallback = NSRect(x: 0, y: 0, width: 100, height: 150) guard let screenFrame = NSScreen.main?.frame else { return fallback } return NSRect( x: screenFrame.maxX - fallback.width - initialMargin, y: screenFrame.maxY - fallback.height - initialMargin, width: fallback.width, height: fallback.height) } } extension NSMenu { static func makeMenu() -> NSMenu { let appMenu = NSMenuItem() appMenu.submenu = NSMenu() appMenu.submenu?.addItem( NSMenuItem( title: "Quit \(ProcessInfo.processInfo.processName)", action: #selector(NSApplication.terminate(_:)), keyEquivalent: "q" )) let mainMenu = NSMenu(title: "Main Menu") mainMenu.addItem(appMenu) return mainMenu } } #+end_src * [2020-07-30 Thu] Mending bookmarks :PROPERTIES: :CUSTOM_ID: mending-bookmarks :END: - [[https://youtu.be/S6UfWgMDlkQ][12 Great Sewing Tips and Tricks ! Best great sewing tips and tricks #7 - YouTube]]. * [2020-06-17 Wed] ffmpeg bookmarks :PROPERTIES: :CUSTOM_ID: ffmpeg-bookmarks :END: :MODIFIED: [2021-05-02 Sun] :END: - [[https://news.ycombinator.com/item?id=23540704][FFmpeg 4.3 (Hacker News)]]. - [[https://news.ycombinator.com/item?id=26370704][FFMPEG from Zero to Hero | Hacker News]]. - [[https://el-tramo.be/blog/ken-burns-ffmpeg/][Ken Burns Effect Slideshows with FFMPeg (mko.re)]]. - [[https://ottverse.com/stack-videos-horizontally-vertically-grid-with-ffmpeg/][Stack Videos Horizontally, Vertically, in a Grid With FFmpeg - OTTVerse]]. * [2020-06-14 Sun] Black lives matter (BLM) bookmarks :PROPERTIES: :CUSTOM_ID: black-lives-matter-blm-bookmarks :END: - [[https://projects.fivethirtyeight.com/racism-polls/][Do You Know How Divided White And Black Americans Are On Racism? (FiveThirtyEight)]]. - [[https://marker.medium.com/its-time-we-dealt-with-white-supremacy-in-tech-8f7816fe809][It’s Time We Dealt With White Supremacy in Tech]]. - [[https://www.politico.com/magazine/story/2014/05/religious-right-real-origins-107133][The Real Origins of the Religious Right - POLITICO Magazine]]. * [2020-06-14 Sun] Dogs bookmarks :PROPERTIES: :CUSTOM_ID: dogs-bookmarks :END: - [[https://thedogspov.com/need-know-romanian-rescue-dogs/][All You Need to Know About Romanian Rescue Dogs]]. * [2020-06-06 Sat] Emacs, search hackingwithswift.com :PROPERTIES: :CUSTOM_ID: emacs-search-hackingwithswiftcom :END: #+ATTR_HTML: :width 75% :height 75% [[file:images/emacs-search-hackingwithswiftcom/hws.gif]] [[https://twitter.com/twostraws][Paul Hudson]] authors excellent Swift material at [[https://www.hackingwithswift.com/][hackingwithswift.com]]. I regularly land on the site while searching for snippets from the browser. I was wondering if I could search for snippets directly from Emacs. Turns out, hackingwithswift uses a JSON HTTP request for querying code examples. With this in mind, we can use /ivy-read/ like Oleh Krehel's [[https://github.com/abo-abo/swiper/blob/8d840b2e8680e2768edb794c9ccecf975f6ba4cf/counsel.el#L6680][counsel-search]] and search for Swift snippets from our favorite editor: #+begin_src emacs-lisp (require 'request) (require 'json) (defun ar/counsel-hacking-with-swift-search () "Ivy interface to query hackingwithswift.com." (interactive) (ivy-read "hacking with swift: " (lambda (input) (or (ivy-more-chars) (let ((request-curl-options (list "-H" (string-trim (url-http-user-agent-string))))) (request "https://www.hackingwithswift.com/example-code/search" :type "GET" :params (list (cons "search" input)) :parser 'json-read :success (cl-function (lambda (&key data &allow-other-keys) (ivy-update-candidates (mapcar (lambda (item) (let-alist item (propertize .title 'url .url))) data))))) 0))) :action (lambda (selection) (browse-url (concat "https://www.hackingwithswift.com" (get-text-property 0 'url selection)))) :dynamic-collection t :caller 'ar/counsel-hacking-with-swift-search)) #+end_src * [2020-05-23 Sat] Preview SwiftUI layouts using Emacs org blocks :PROPERTIES: :CUSTOM_ID: swiftui-layout-previews-using-emacs-org-blocks :END: #+ATTR_HTML: :width 75% :height 75% [[file:images/swiftui-layout-previews-using-emacs-org-blocks/ob-swiftui.gif]] ✨ /UPDATE: The snippets in this post are outdated. See [[https://github.com/xenodium/ob-swiftui][ob-swiftui]] for better SwiftUI babel support/. ✨ Chris Eidhof [[https://twitter.com/chriseidhof/status/1261360332594974721][twitted]] a handy [[https://gist.github.com/chriseidhof/26768f0b63fa3cdf8b46821e099df5ff][snippet]] that enables quickly bootstrapping throwaway SwiftUI code. It can be easily integrated into other tools for rapid experimentation. Being a SwiftUI noob, I could use some SwiftUI integration with my editor of choice. With some elisp glue and a small patch, Chris's snippet can be used to generate SwiftUI inline previews using Emacs org babel. This is particularly handy for playing around with SwiftUI layouts. We can piggyback ride off zweifisch's [[https://github.com/zweifisch/ob-swift][ob-swift]] by advicing /org-babel-execute:swift/ to inject the org source block into the bootstrapping snippet. We also add a hook to /org-babel-after-execute-hook/ to automatically refresh the inline preview. If you're a [[https://github.com/jwiegley/use-package][use-package]] user, the following snippet should make things fairly self-contained (if you have [[https://melpa.org/][melpa]] set up already). #+begin_src emacs-lisp (use-package org :hook ((org-mode . org-display-inline-images)) :config (use-package ob :config (use-package ob-swift :ensure t :config (org-babel-do-load-languages 'org-babel-load-languages (append org-babel-load-languages '((swift . t)))) (defun ar/org-refresh-inline-images () (when org-inline-image-overlays (org-redisplay-inline-images))) ;; Automatically refresh inline images. (add-hook 'org-babel-after-execute-hook 'ar/org-refresh-inline-images) (defun adviced:org-babel-execute:swift (f &rest args) "Advice `adviced:org-babel-execute:swift' enabling swiftui header param." (let* ((body (nth 0 args)) (params (nth 1 args)) (swiftui (cdr (assoc :swiftui params))) (output)) (when swiftui (assert (or (string-equal swiftui "preview") (string-equal swiftui "interactive")) nil ":swiftui must be either preview or interactive") (setq body (format " import Cocoa import SwiftUI import Foundation let screenshotURL = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true).appendingPathComponent(ProcessInfo.processInfo.globallyUniqueString + \".png\") let preview = %s NSApplication.shared.run { %s } extension NSApplication { public func run(@ViewBuilder view: () -> V) { let appDelegate = AppDelegate(view()) NSApp.setActivationPolicy(.regular) mainMenu = customMenu delegate = appDelegate run() } } extension NSApplication { var customMenu: NSMenu { let appMenu = NSMenuItem() appMenu.submenu = NSMenu() let quitItem = NSMenuItem( title: \"Quit \(ProcessInfo.processInfo.processName)\", action: #selector(NSApplication.terminate(_:)), keyEquivalent: \"q\") quitItem.keyEquivalentModifierMask = [] appMenu.submenu?.addItem(quitItem) let mainMenu = NSMenu(title: \"Main Menu\") mainMenu.addItem(appMenu) return mainMenu } } class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate { var window = NSWindow( contentRect: NSRect(x: 0, y: 0, width: 414 * 0.2, height: 896 * 0.2), styleMask: [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView], backing: .buffered, defer: false) var contentView: V init(_ contentView: V) { self.contentView = contentView } func applicationDidFinishLaunching(_ notification: Notification) { window.delegate = self window.center() window.contentView = NSHostingView(rootView: contentView) window.makeKeyAndOrderFront(nil) if preview { screenshot(view: window.contentView!, saveTo: screenshotURL) // Write path (without newline) so org babel can parse it. print(screenshotURL.path, terminator: \"\") NSApplication.shared.terminate(self) return } window.setFrameAutosaveName(\"Main Window\") NSApp.activate(ignoringOtherApps: true) } } func screenshot(view: NSView, saveTo fileURL: URL) { let rep = view.bitmapImageRepForCachingDisplay(in: view.bounds)! view.cacheDisplay(in: view.bounds, to: rep) let pngData = rep.representation(using: .png, properties: [:]) try! pngData?.write(to: fileURL) } " (if (string-equal swiftui "preview") "true" "false") body)) (setq args (list body params))) (setq output (apply f args)) (when org-inline-image-overlays (org-redisplay-inline-images)) output)) (advice-add #'org-babel-execute:swift :around #'adviced:org-babel-execute:swift)))) #+end_src +Snippet also at github [[https://gist.github.com/xenodium/79154033bc26e733b8c43af228cbce5b][gist]] and included in [[https://github.com/xenodium/dotsies/blob/master/emacs/features/fe-org.el][my emacs config]]+. /UPDATE: See [[https://github.com/xenodium/ob-swiftui][ob-swiftui]] for a better version of babel SwiftUI support./ Once the snippet is evaluated, we're ready to use in an org babel block. We introduced the /:swiftui/ header param to switch between inline static /preview/ and /interactive/ mode. To try out an inline /preview/, create a new org file (eg. swiftui.org) and a source block like: #+begin_src org :exports src ,#+begin_src swift :results file :swiftui preview VStack(spacing: 10) { HStack(spacing: 10) { Rectangle().fill(Color.yellow) Rectangle().fill(Color.green) } Rectangle().fill(Color.blue) HStack(spacing: 10) { Rectangle().fill(Color.green) Rectangle().fill(Color.yellow) } } .frame(maxWidth: .infinity, maxHeight: .infinity) ,#+end_src #+end_src #+begin_src org :exports src ,#+results: #+end_src [[file:images/swiftui-layout-previews-using-emacs-org-blocks/vstack.jpg]] Place the cursor anywhere inside the source block (#+begin_src/#+end_src) and press C-c C-c (or M-x org-ctrl-c-ctrl-c). To run interactively, change the /:swiftui/ param to /interactive/ and press C-c C-c (or M-x org-ctrl-c-ctrl-c). When running interactively, press "q" (without ⌘) to quit the Swift app. comments on [[https://twitter.com/xenodium/status/1194224168709083137][twitter]]. ** Update - Tweaked the snippet to make it more self-contained and made the steps more reproducible. Need to work out how to package things to make them more accessible. May be best to contribute as a patch to [[https://github.com/zweifisch/ob-swift][ob-swift]] and we can avoid the icky /advice-add/. - Thanks to Chris Eidhof for PNG support (instead of TIFF). Also TIL Swift's /print/ has got a terminator param. * [2020-05-22 Fri] Open Emacs elfeed links in the background :PROPERTIES: :CUSTOM_ID: open-emacs-elfeed-links-in-background :END: #+ATTR_HTML: :width 75% :height 75% [[file:images/open-emacs-elfeed-links-in-background/background-browse.gif]] Christopher Wellons's [[https://github.com/skeeto/elfeed][elfeed]] is a wonderful Emacs rss reader. In Mike Zamansky's [[https://cestlaz.github.io/post/using-emacs-72-customizing-elfeed/][Using Emacs 72 - Customizing Elfeed]] video, he highlights a desire to open elfeed entries in the background. That is, open the current rss entry (or selected entries) without shifting focus from Emacs to your browser. This behaviour is somewhat analogous to ⌘-clicking/ctrl-clicking on multiple links in the browser without losing focus. I've been wanting elfeed to open links in the background for some time. Zamansky's post was a great nudge to look into it. He points to the relevant [[https://github.com/skeeto/elfeed/blob/58ab1f8bcc3014206db42a7a26f3120ba5de4ca6/elfeed-search.el#L783][elfeed-search-browse-url]] function, re-implemented to suit his needs. In a similar spirit, I wrote a function to open the current rss entry (or selected entries) in the background. I'm running macOS, so I took a look at [[https://github.com/emacs-mirror/emacs/blob/d714aa753b744c903d149a1f6c69262d958c313e/lisp/net/browse-url.el#L1018 I ][browse-url-default-macosx-browser]] to get an idea of how URLs are opened. Simple. It let's macOS handle it via the "open" command, invoked through /start process/. Looking at open's command-line options, we find /--background/ which "does not bring the application to the foreground." #+begin_src emacs-lisp open --background http://xenodium.com #+end_src "b" is already bound to /elfeed-search-browse-url/, so in our snippet we'll bind "B" to our new background function, giving us some flexibility: #+begin_src emacs-lisp (use-package elfeed :ensure t :bind (:map elfeed-search-mode-map ("B" . ar/elfeed-search-browse-background-url)) :config (defun ar/elfeed-search-browse-background-url () "Open current `elfeed' entry (or region entries) in browser without losing focus." (interactive) (let ((entries (elfeed-search-selected))) (mapc (lambda (entry) (assert (memq system-type '(darwin)) t "open command is macOS only") (start-process (concat "open " (elfeed-entry-link entry)) nil "open" "--background" (elfeed-entry-link entry)) (elfeed-untag entry 'unread) (elfeed-search-update-entry entry)) entries) (unless (or elfeed-search-remain-on-entry (use-region-p)) (forward-line))))) #+end_src Maybe xdg-open does a similar thing on linux (I've not looked). Ping me if you have a linux solution and I can update the function. Happy Emacsing. ps. I noticed elfeed uses /browse-url-generic/ if /elfeed-search-browse-url/'s is invoked with a prefix. Setting [[https://github.com/emacs-mirror/emacs/blob/d0e2a341dd9a9a365fd311748df024ecb25b70ec/lisp/net/browse-url.el#L534][browse-url-generic-program]] and [[https://github.com/emacs-mirror/emacs/blob/d0e2a341dd9a9a365fd311748df024ecb25b70ec/lisp/net/browse-url.el#L539][browse-url-generic-args]] to use background options may be a more generic solution. For now, a custom function does the job. comments on [[https://twitter.com/xenodium/status/1263839324023525376][twitter]]. * [2020-05-11 Mon] Enrich Emacs dired's batching toolbox :PROPERTIES: :CUSTOM_ID: enrich-your-dired-batching-toolbox :END: ** Update I now use [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]], which reduces the logic to: #+begin_src emacs-lisp :lexical no (defun dwim-shell-commands-image-to-jpg () "Convert all marked images to jpg(s)." (interactive) (dwim-shell-command-on-marked-files "Convert to jpg" "convert -verbose '<>' '<>.jpg'" :utils "convert")) #+end_src ** Original post Shell one-liners are super handy for batch-processing files. Say you'd like to convert a bunch of images from HEIC to jpg, you could use something like: #+begin_src sh for f in *.HEIC ; do convert "$f" "${f%.*}.jpg"; done #+end_src Save the one-liner (or memorize it) and pull it from your toolbox next time you need it. This is handy as it is, but [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][Emacs dired]] is just a file-management powerhouse. Its /dired-map-over-marks/ function is just a few elisp lines away from enabling all sorts of batch processing within your dired buffers. Dired already enables selecting and deselecting files using all sorts of built-in mechanisms ([[https://www.gnu.org/software/emacs/manual/html_node/emacs/Marks-vs-Flags.html][dired-mark-files-regexp]], [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired-and-Find.html][find-name-dired]], etc) or wonderful third-party packages like Matus Goljer's [[https://github.com/Fuco1/dired-hacks][dired-filters]]. Regardless of how you selected your files, here's a snippet to run ImageMagick's [[https://imagemagick.org/script/convert.php][convert]] on a bunch of selected files: #+begin_src emacs-lisp ;;; -*- lexical-binding: t; -*- (defun ar/dired-convert-image (&optional arg) "Convert image files to other formats." (interactive "P") (assert (or (executable-find "convert") (executable-find "magick.exe")) nil "Install imagemagick") (let* ((dst-fpath) (src-fpath) (src-ext) (last-ext) (dst-ext)) (mapc (lambda (fpath) (setq src-fpath fpath) (setq src-ext (downcase (file-name-extension src-fpath))) (when (or (null dst-ext) (not (string-equal dst-ext last-ext))) (setq dst-ext (completing-read "to format: " (seq-remove (lambda (format) (string-equal format src-ext)) '("jpg" "png"))))) (setq last-ext dst-ext) (setq dst-fpath (format "%s.%s" (file-name-sans-extension src-fpath) dst-ext)) (message "convert %s to %s ..." (file-name-nondirectory dst-fpath) dst-ext) (set-process-sentinel (if (string-equal system-type "windows-nt") (start-process "convert" (generate-new-buffer (format "*convert %s*" (file-name-nondirectory src-fpath))) "magick.exe" "convert" src-fpath dst-fpath) (start-process "convert" (generate-new-buffer (format "*convert %s*" (file-name-nondirectory src-fpath))) "convert" src-fpath dst-fpath)) (lambda (process state) (if (= (process-exit-status process) 0) (message "convert %s ✔" (file-name-nondirectory dst-fpath)) (message "convert %s ❌" (file-name-nondirectory dst-fpath)) (message (with-current-buffer (process-buffer process) (buffer-string)))) (kill-buffer (process-buffer process))))) (dired-map-over-marks (dired-get-filename) arg)))) #+end_src The snippet can be shorter, but wouldn't be as friendly. We ask users to provide desired image format, spawn separate processes (avoids blocking Emacs), and generate a basic report. Also adds support for Windows. [[file:images/enrich-your-dired-batching-toolbox/batch-dired.gif]] ** BEWARE The snippet isn't currently capping the number of processes, but hey we can revise in the future... ** Update Thanks to [[https://github.com/pbeliveau][Philippe Beliveau]] for pointing out a bug in snippet (now updated) and changes to make it Windows compatible. * [2020-05-09 Sat] Banana oats pancakes recipe :PROPERTIES: :CUSTOM_ID: banana-oats-pancakes-recipe :END: #+ATTR_HTML: :width 50% :height 50% [[file:images/banana-oats-pancakes-recipe/banpan.jpg]] ** Blend - Ripe banana. - 2 Eggs. - 1/3 cup instant oats. - 1/2 teaspoon baking powder. Really is this easy. Add all ingredients and blend. ** Cook Medium to low heat. Cook for 3 minutes. Flip. Cook for 1 minute. You're done. * [2020-05-06 Wed] Emacs: connect my Bluetooth speaker :PROPERTIES: :CUSTOM_ID: emacs-connect-my-bluetooth-speaker :END: Connecting and disconnecting bluetooth devices on macOS is fairly simple: use the menu bar utility. #+ATTR_HTML: :width 75% :height 75% [[file:images/emacs-connect-my-bluetooth-speaker/macos-menu.png]] /But could we make it quicker from our beloved editor?/ Turns out with a little elisp glue, we can fuzzy search our Bluetooth devices and toggle connections. We can use [[https://twitter.com/_abo_abo][Oleh Krehel's]] [[https://github.com/abo-abo/swiper][ivy-read]] for fuzzy searching and [[https://twitter.com/lap_felix][Felix Lapalme]]'s nifty [[https://github.com/lapfelix/BluetoothConnector][BluetoothConnector]] to list devices and toggle Bluetooth connections. As a bonus, we can make it remember the last selected device, so you can quickly toggle it again. #+begin_src emacs-lisp (defun ar/ivy-bluetooth-connect () "Connect to paired bluetooth device." (interactive) (assert (string-equal system-type "darwin") nil "macOS only. Sorry :/") (assert (executable-find "BluetoothConnector") nil "Install BluetoothConnector from https://github.com/lapfelix/BluetoothConnector") (ivy-read "(Dis)connect: " (seq-map (lambda (item) (let* ((device (split-string item " - ")) (mac (nth 0 device)) (name (nth 1 device))) (propertize name 'mac mac))) (seq-filter (lambda (line) ;; Keep lines like: af-8c-3b-b1-99-af - Device name (string-match-p "^[0-9a-f]\\{2\\}" line)) (with-current-buffer (get-buffer-create "*BluetoothConnector*") (erase-buffer) ;; BluetoothConnector exits with 64 if no param is given. ;; Invoke with no params to get a list of devices. (unless (eq 64 (call-process "BluetoothConnector" nil (current-buffer))) (error (buffer-string))) (split-string (buffer-string) "\n")))) :require-match t :preselect (when (boundp 'ar/misc-bluetooth-connect--history) (nth 0 ar/misc-bluetooth-connect--history)) :history 'ar/misc-bluetooth-connect--history :caller 'ar/toggle-bluetooth-connection :action (lambda (device) (start-process "BluetoothConnector" (get-buffer-create "*BluetoothConnector*") "BluetoothConnector" (get-text-property 0 'mac device) "--notify")))) #+end_src #+ATTR_HTML: :width 50% :height 50% [[file:images/emacs-connect-my-bluetooth-speaker/connect-disconnect.gif]] comments on [[https://twitter.com/xenodium/status/1258148035319734273][twitter]]. * [2020-05-02 Sat] Duti: changing default macOS apps :PROPERTIES: :CUSTOM_ID: duti-changing-default-macos-apps :END: Future self example, setting [[https://mpv.io/][mpv.io]] to open all aiff files on macOS: #+begin_src bash duti -s io.mpv aiff #+end_src * [2020-04-26 Sun] Neapolitan pizza recipe :PROPERTIES: :CUSTOM_ID: neapolitan-pizza-recipe :END: Full disclosure: I'm a complete noob at making pizza. It's my second pizza, but hey, it was tasty and fun to make! Making pizza at home is not as far-fetched as I initially thought. ** UPDATES: I've made this recipe a couple of times. Made two improvements worth mentioning. *** Flan tin / quiche pan #+ATTR_HTML: :width 50% :height 50% [[file:images/neapolitan-pizza-recipe/round_pie.jpg]] My first pizzas were rectangular, matching the baking tray shape, but I really wanted round pies. I found a quiche pan at home and gave that a try. Worked pretty well. The dish bottom comes up, which is pretty handy. *** Double baking Bake in two stages: 1. Bake the pizza for 6 minutes (without the mozarella) at bottom of oven. 2. Add mozzarella and make for 4 minutes at top of the oven. ** Recipe Ok, on to the recipe now... *** Dissolve the yeast - 7g of yeast. - 325ml of lukewarm water. Dissolve the yeast in the lukewarm water. *** Mixing the dough #+ATTR_HTML: :width 50% :height 50% [[file:images/neapolitan-pizza-recipe/mix1.jpg]] #+ATTR_HTML: :width 50% :height 50% [[file:images/neapolitan-pizza-recipe/mix2.jpg]] - 500g of flour. - 1 teaspoon of salt. Gradually add flour to the yeast and water mix, using the bottom of a spoon to work it until smooth (no lumps). The dough will be very sticky at first. Stay faithful to the spoon. It'll work. BBC's [[http://www.bbc.com/travel/story/20200415-how-to-make-pizza-like-a-neapolitan-master][How to make pizza like a Neapolitan master]] has a great demo. I followed the dough technique. *** Kneading the dough #+ATTR_HTML: :width 50% :height 50% [[file:images/neapolitan-pizza-recipe/knead1.jpg]] #+ATTR_HTML: :width 50% :height 50% [[file:images/neapolitan-pizza-recipe/knead2.jpg]] Sprinkle some flour on the table and knead the dough (punch, stretch, and fold many times) from previous step. Eventually, the dough will hold its shape. *** Make 4 balls #+ATTR_HTML: :width 50% :height 50% [[file:images/neapolitan-pizza-recipe/cut_in_four.jpg]] #+ATTR_HTML: :width 50% :height 50% [[file:images/neapolitan-pizza-recipe/four_balls.jpg]] Roll the dough into a cylinder and cut into 4 pieces. Make 4 balls. *** Make the tomato sauce #+ATTR_HTML: :width 50% :height 50% [[file:images/neapolitan-pizza-recipe/garlic_slice.jpg]] #+ATTR_HTML: :width 50% :height 50% [[file:images/neapolitan-pizza-recipe/sauce_done.jpg]] - 500g of passata. - 3 cloves of garlic. I love garlic. Who doesn't? Slice the garlic finely and combine with the passata in a class jar. Shake it a little. Garlic and passata. That's your sauce. *** Cover for 2 hours #+ATTR_HTML: :width 50% :height 50% [[file:images/neapolitan-pizza-recipe/put_away.jpg]] #+ATTR_HTML: :width 50% :height 50% [[file:images/neapolitan-pizza-recipe/after_hours.jpg]] Place the 4 dough balls into a container and cover with a damp cloth for 2 hours. You can make 4 pizzas. /*Rookie mistake: I should have used a bigger container. The balls grew and merged./ *** Preheat oven Preheat the oven at 250°C. *** Stretch base #+ATTR_HTML: :width 50% :height 50% [[file:images/neapolitan-pizza-recipe/stretch.jpg]] Sprinkle more flour on table prior to shaping the dough. Place ball on table, flatten. Flip over, flatten again. Gradually stretch until you have the shape and thickness desired. *** Place base on baking tray - Semolina - Aluminium foil Line up the tray with some aluminium foil. Before transferring the base on to the baking tray, sprinkle semolina (or breadcrumbs) on the foil (it helps prevent the dough from sticking). *** Toppings #+ATTR_HTML: :width 50% :height 50% [[file:images/neapolitan-pizza-recipe/oiled.jpg]] #+ATTR_HTML: :width 50% :height 50% [[file:images/neapolitan-pizza-recipe/parmesan.jpg]] #+ATTR_HTML: :width 50% :height 50% [[file:images/neapolitan-pizza-recipe/mozarella.jpg]] - Tomato sauce. - Salt. - Olive oil. - Parmesan cheese. - 125g of Mozzarella cheese. - Fresh basil. Spread some of the tomato sauce with a spoon. Sprinkle salt, olive oil, and parmesan cheese. Break the mozzarella into pieces and spread throughout. Add some basil leaves. Your basic margherita pizza is now ready for the oven. *** Bake pizza Place the tray in the oven for 10 minutes. This worked for my oven, which goes up to 250°C. Either way, keep an eye on it. *** Post baking toppings #+ATTR_HTML: :width 50% :height 50% [[file:images/neapolitan-pizza-recipe/final.jpg]] - Anchovies. Controversial, but I really like anchovies. Add them post-baking and you're good to go. Enjoy your pizza. *** Helpful references - [[http://www.bbc.com/travel/story/20200415-how-to-make-pizza-like-a-neapolitan-master][How to make pizza like a Neapolitan master (BBC)]]. - [[https://www.youtube.com/watch?v=1-SJGQ2HLp8][How to Make Perfect Pizza (Gennaro Contaldo - YouTube)]]. * [2020-04-21 Tue] Oatmeal cookie recipe :PROPERTIES: :CUSTOM_ID: oatmeal-cookie-recipe :END: #+ATTR_HTML: :width 50% :height 50% [[file:images/oatmeal-cookie-recipe/oatcookies.jpg]] #+ATTR_HTML: :width 50% :height 50% [[file:images/oatmeal-cookie-recipe/ingredients.jpg]] I combined elements from two recipes: [[https://thefoodmedic.co.uk/2020/01/3-ingredient-oatmeal-cookies/][3 Ingredient oatmeal cookies (The Food Medic)]], Amy's [[https://amyshealthybaking.com/blog/2018/01/21/banana-oatmeal-raisin-cookies/][Healthy Banana Oatmeal Raisin Cookies (Amy's Healthy Baking)]] and added my own touches. ** Preheat oven Preheat the oven at 180°C. ** Mash bananas - 2 medium ripe bananas. Mash until bananas have no significant lumps. ** Mix most ingredients (except oats) - 4 tablespoons crunchy peanut butter. - 1/2 teaspoon of ground cinnamon. - 1/2 teaspoon of ground cardamom. - 1/4 teaspoon of vanilla. - 1/3 cup raisins. Add the peanut butter, cinnamon, cardamom, and vanilla into the mashed bananas. Mix well. Add raisins and mix a little further to spread them out. ** Add oats - 1 3/4 cups of oats. Add the oats to the mix in a few rounds to ensure its evenly mixed. ** Flattened balls in tray Make balls, place on baking tray, and gently flatten. They'll be on the chunky side. /Note: They won't spread as much as traditional cookies./ ** Bake for 15 mins Bake for about 15 minutes or until golden. ** Let cool off and enjoy Wait a little and nom nom nom... ps. Full recipe source in [[https://github.com/xenodium/xenodium.github.io/blob/master/index.org][org file]]. * [2020-04-21 Tue] TIL (today I learned) bookmarks :PROPERTIES: :CUSTOM_ID: til-today-i-learned-bookmarks :END: :MODIFIED: [2020-04-24 Fri] :END: - [[https://til.hashrocket.com/][Hashrocket - Today I Learned]]. - [[https://github.com/jbranchaud/til][jbranchaud/til: Today I Learned]]. - [[https://til.secretgeek.net/][secretgeek: Today I Learned]]. - [[https://til.simonwillison.net/][Simon Willison: TIL]]. - [[https://zerokspot.com/tags/til][til - zerokspot.com]]. - [[https://www.sarasoueidan.com/today-i-learned/][Today I Learned — Sara Soueidan – Freelance-Front-End UI/UX Developer]]. * [2020-04-19 Sun] mu/mu4e 1.4 released :PROPERTIES: :CUSTOM_ID: mumu4e-14-released :END: #+ATTR_HTML: :width 50% :height 50% [[file:images/mumu4e-14-released/mu14.png]] [[https://www.reddit.com/r/emacs/comments/g3nsgg/mumu4e_14_has_been_released/][mu/mu4e 1.4 is out]]. About a week ago, I built and installed its [[https://github.com/djcb/mu/releases/tag/1.3.10][pre-release version (1.3.10)]] and noted [[http://xenodium.com/building-mumu4e-on-macos/][build steps on macOS]]. It's been working great for me. Today, I updated to 1.4. I was keen to try the new release out. I had been experiencing a short delay immediately after syncing/indexing mail. An initial investigation pointed to contact syncing, but I didn't dig further. The 1.4 release notes had a promising entry: #+begin_quote In many cases, `mu4e' used to receive /all/ contacts after each indexing operation; this was slow for some users, so we have updated this to /only/ get the contacts that have changed since the last round. #+end_quote After upgrading. The delay is gone for me \o/ *Note*: there are a few config tweaks needed for the 1.4 upgrade, but these are well-documented in the [[https://github.com/djcb/mu/releases/tag/1.4][release notes]]. For me, it primarily consisted of: - Swapping elisp /mu4e-maildir/ var for /mu init --maildir path/to/local/IMAP/. - Swapping elisp /mu4e-user-mail-address-list/ for /mu init --my-address address1@domain.com --my-address address2@domain.com/. - Disabling /mu4e-maildirs-extension/ (not yet compatible with mu 1.4). No issues here, since I hardly ever look at the /mu4e-main/ buffer. I have global binding to my unread messages that looks a little something like this: #+begin_src emacs-lisp (defun ar/mu4e-view-unread-messages () (interactive) (mu4e-headers-search-bookmark (concat "flag:unread AND " "flag:unread AND " "NOT flag:trashed AND " "(maildir:/box1/INBOX OR " "maildir:/box2/INBOX)"))) #+end_src comments on [[https://twitter.com/xenodium/status/1251852526246379520][twitter]]. * [2020-04-14 Tue] Libya travel bookmarks :PROPERTIES: :CUSTOM_ID: libya-travel-bookmarks :END: - [[https://twitter.com/wrathofgnon/status/1249544131715534849?s=12][The city of Ghadames on the edge of the Saharan desert]]. * [2020-04-07 Tue] Trimming videos with ffmpeg :PROPERTIES: :CUSTOM_ID: trimming-videos-with-ffmpeg :END: Via Bernd Verst's [[https://bernd.dev/2020/04/trim-videos-instantly/][Trim Videos Instantly]]: Start time + duration #+begin_src bash ffmpeg -ss hh:mm:ss.msec -i in.mpeg -c copy -map 0 -t hh:mm:ss.msec out.mpeg #+end_src Start time + end time #+begin_src bash ffmpeg -ss hh:mm:ss.msec -i in.mpeg -c copy -map 0 -to hh:mm:ss.msec out.mpeg #+end_src * [2020-04-06 Mon] Emacs's counsel-M-x meets multiple cursors :PROPERTIES: :CUSTOM_ID: emacss-counsel-m-x-meets-multiple-cursors :END: I'm a fan of Magnar Sveen's [[https://github.com/magnars/multiple-cursors.el][multiple cursors]] Emacs implementation. It's just so fun to use and works very well with commands bound to my favorite keys. Every now and then I'd like to execute extended commands on all cursors, but they have no keys bound to them. If you're an [[https://github.com/abo-abo/swiper][ivy/counsel]] fan like me (and all packages by [[https://oremacs.com/about/][Abo Abo]]), you use /counsel-M-x/ to invoke commands. However, /counsel-M-x/ doesn't support multiple cursors out of the box. Luckily, this is Emacs and we can fix that... Back in December 2019, I made a note to revisit [[https://www.reddit.com/user/snippins1987/][u/snippins1987]]'s weekly tip to pair [[https://www.reddit.com/r/emacs/comments/eeyhdz/weekly_tipstricketc_thread/fch1bkv?utm_source=share&utm_medium=web2x][helm-M-x with multiple cursors]]. Finally got back to it. With a few changes, we can also make the snippet work with /counsel-M-x/ \o/. #+ATTR_HTML: :width 40% :height 40% #+begin_src emacs-lisp (defun adviced:counsel-M-x-action (orig-fun &rest r) "Additional support for multiple cursors." (apply orig-fun r) (let ((cmd (intern (car r)))) (when (and (boundp 'multiple-cursors-mode) multiple-cursors-mode cmd (not (memq cmd mc--default-cmds-to-run-once)) (not (memq cmd mc/cmds-to-run-once)) (or mc/always-run-for-all (memq cmd mc--default-cmds-to-run-for-all) (memq cmd mc/cmds-to-run-for-all) (mc/prompt-for-inclusion-in-whitelist cmd))) (mc/execute-command-for-all-fake-cursors cmd)))) (advice-add #'counsel-M-x-action :around #'adviced:counsel-M-x-action) #+end_src [[file:images/emacss-counsel-m-x-meets-multiple-cursors/counsel-mx-mc.gif]] * [2020-04-05 Sun] Portland travel bookmarks :PROPERTIES: :CUSTOM_ID: portland-travel-bookmarks :END: - [[https://www.powells.com/][Powell’s Books | The World’s Largest Independent Bookstore]]. * [2020-03-29 Sun] String inflection Emacs package :PROPERTIES: :CUSTOM_ID: string-inflection-emacs-package :END: [[https://github.com/akicho8/string-inflection][string-inflection]] (by [[https://github.com/akicho8][Akira Ikeda]]) is a nifty package to cycle through string case styles: [[https://en.wikipedia.org/wiki/Letter_case#Special_case_styles][camel, snake, kebab...]] The package includes a handful of cycling functions for different languages (Ruby, Python and Java), but it's easy to mix and match to roll your own. For now, I'm binding /C-M-j/ to /string-inflection-cycle/, which is an alias to /string-inflection-ruby-style-cycle/. #+ATTR_HTML: :width 40% :height 40% #+begin_src emacs-lisp (use-package string-inflection :ensure t :bind (:map prog-mode-map ("C-M-j" . string-inflection-cycle))) #+end_src [[file:images/string-inflection-emacs-package/string_inflection.gif]] comments on [[https://twitter.com/xenodium/status/1244355205698912261?s=20][twitter]] * [2020-03-28 Sat] Turkey travel bookmarks :PROPERTIES: :CUSTOM_ID: turkey-travel-bookmarks :END: - [[https://en.wikipedia.org/wiki/Tomb_of_Amyntas][Tomb of Amyntas - Wikipedia]]. * [2020-03-25 Wed] Dal Makhani (black lentils) recipe :PROPERTIES: :CUSTOM_ID: dal-makhani-black-lentils-recipe :END: #+ATTR_HTML: :width 40% :height 40% [[file:images/dal-makhani-black-lentils-recipe/dal.jpg]] ** Soak beans (overnight) - 1 cup of rajmah (kidney beans). - 2 cups of sabut urad (black lentils). Place the beans in a bowl with plenty of water. The beans will soak it up so ensure there's enough. ** Cooking the beans - 3 liters of water. - 1 cinamon stick. - 1 tablespoon of turmeric. - 2 bay leaves. Drain the beans and combine new ingredients into a pot. Bring to a boil and simer for 1.5 hours. Check beans aren't firm (give 'em a try'). If so extend another 15-30 mins. ** Prepare paste - 1 4 cm piece of ginger. - 1 large onion. - 6 garlic cloves. - 2 tomatoes. Put through blender (with choppin pulse) or food processor until you get a paste. ** Golden paste - Paste. - 3 tablespoons of butter. - 1 tablespoon of cumin seeds. - 1 tablespoon of coriander powder. - 1 tablespoon of chilly powder (or less to make milder). - 1 fresh red hot pepper (find one with medium heat level) chopped. - 1 tablespoon of cumin powder. - 1/4 cup of water. - 3/4 tablespoon of salt. Heat up the butter (medium heat) and brown the cumin seeds (maybe 30 seconds). Add the paste from previous step. Cook for about 4 minutes or until golden. Add the remaining ingredients in step (except water) and cook for another 30 seconds. Add the water and salt and mix to make more fluid and remove from heat. ** Tying it all together - 1 tablespoon of panchpuram (cumin, fenugreek, mistard, and fennel seeds). - 300 ml of double cream. Combine the cooked beans, golden paste, and seeds. Simmer for about 15 minutes. Add the cream and cook for about 2 minutes. You are effectively done. ** Garnish (optional) You can serve and optionally garnish with some chopped coriander. Recommended. ** Serve with Basmati rice, rotis, buttered buns, or even corn tortillas (unorthodox, but hey). * [2020-03-21 Sat] Modern Emacs lisp libraries :PROPERTIES: :CUSTOM_ID: modern-elisp-libraries :END: Quickly finding related built-in elisp functions (without prefixes) can sometimes take a little poking around. Some modern and predictable built-in exceptions I now reach out to are: - [[https://nicolas.petton.fr/ressources/emacsconf2015/][map.el]] for key/values, alists, hash-tables and arrays (built-in as of Emacs 25.1). - [[https://nicolas.petton.fr/ressources/emacsconf2015/][seq.el]] for sequence manipulation functions (built-in as of Emacs 25.1). - [[https://github.com/emacs-mirror/emacs/blob/master/lisp/emacs-lisp/subr-x.el][subr-x.el]] has a handful of string functions (built-in as of Emacs 24.4). - [[https://endlessparentheses.com/new-on-elpa-and-in-emacs-25-1-let-alist.html][let-alist.el]] wonderful syntax for alists, great for json (built-in as of Emacs 25.1). If you don't mind reaching out to third-party libs (you likely have some of these already installed), here are some modern, predictable, and well-documented ones that always get me out of trouble: - [[https://github.com/magnars/s.el#functions][s.el]] string manipulation. - [[https://github.com/rejeep/f.el][f.el]] file/path handling. - [[https://github.com/magnars/dash.el#functions][dash.el]] for lists. - [[https://github.com/Wilfred/ht.el][ht.el]] for hashtables. - [[https://github.com/alphapapa/ts.el][ts.el]] for date and time. I'm happy with built-ins like map.el, seq.el, and let-alist.el. subr-x.el is also pretty nice, although not as full-featured as third-party s.el. Am I missing out on other modern built-ins or third-party libraries? UPDATE: Added a handful of newly discovered libraries plus [[https://twitter.com/dmartincy/status/1241444701754085383?s=20][suggestions by Daniel Martín]] (thanks!). Not tried any of these myself. - [[https://github.com/emacs-mirror/emacs/blob/master/lisp/rtree.el][rtree.el]] binary tree that stores ranges (Built-in). - [[https://github.com/emacsorphanage/ov][ov.el]] simple way to manipulate overlay. - Toby Cubitt's [[http://www.dr-qubit.org/tags/computing-code-emacs.html][libraries]] (heap, overlays, queue, avl-tree, trie, dict-tree, etc). - [[https://github.com/VincentToups/shadchen-el][shadchen.el]] pattern-matching. - [[https://phillord.github.io/m-buffer-el][m-buffer.el]] buffers. - [[https://github.com/tali713/esxml][esxml.el]] xml and html. - [[https://github.com/plexus/a.el][a.el]] associative structures. - [[https://github.com/troyp/asoc.el][asoc.el]] association list library. - [[https://github.com/yurikhan/yk-color][yk-color.el]] linear RGB color manipulation. comments on [[https://twitter.com/xenodium/status/1241439306511720448][twitter]] * [2020-03-20 Fri] Emacs smartparens auto-indent :PROPERTIES: :CUSTOM_ID: emacs-smartparens-auto-indent :END: While I do most editing in Emacs, I use Xcode every now and then. I like Xcode's pair matching (of brackets) combined with its auto-indent. #+ATTR_HTML: :width 50% :height 50% [[file:images/emacs-smartparens-auto-indent/xcode_indent.gif]] While the wonderful [[https://github.com/Fuco1/smartparens][smartparens]] gives Emacs pair-matching powers, it doesn't automatically indent between pairs (out of the box anyway). #+ATTR_HTML: :width 50% :height 50% [[file:images/emacs-smartparens-auto-indent/indent_bracket_before.gif]] Luckily, smartparens does provide /sp-local-pair,/ which enables us to achieve a similar goal. With a short snippet, we can autoindent between {}, [], and () when pressing return in-between. #+begin_src emacs-lisp (defun indent-between-pair (&rest _ignored) (newline) (indent-according-to-mode) (forward-line -1) (indent-according-to-mode)) (sp-local-pair 'prog-mode "{" nil :post-handlers '((indent-between-pair "RET"))) (sp-local-pair 'prog-mode "[" nil :post-handlers '((indent-between-pair "RET"))) (sp-local-pair 'prog-mode "(" nil :post-handlers '((indent-between-pair "RET"))) #+end_src #+ATTR_HTML: :width 50% :height 50% [[file:images/emacs-smartparens-auto-indent/indent_bracket_after.gif]] comments on [[https://twitter.com/xenodium/status/1241104117264781312][twitter]] * [2020-03-20 Fri] Solarpunk bookmarks :PROPERTIES: :CUSTOM_ID: solarpunk-bookmarks :END: :MODIFIED: [2020-03-20 Fri] :END: - [[https://medium.com/solarpunks/solarpunk-a-reference-guide-8bcf18871965#060e][SOLARPUNK : A REFERENCE GUIDE - Solarpunks - Medium]]. - [[https://hieroglyph.asu.edu/2014/09/solarpunk-notes-toward-a-manifesto/][Solarpunk: Notes toward a manifesto (Project Hieroglyph)]]. * [2020-03-10 Tue] sqlite bookmarks :PROPERTIES: :CUSTOM_ID: sqlite-bookmarks :END: :MODIFIED: [2021-11-23 Tue] :END: - [[https://news.ycombinator.com/item?id=23287278][DuckDB: SQLite for Analytics | Hacker News]]. - [[https://news.ycombinator.com/item?id=27944065][Inserting 130M SQLite rows per minute from a scripting language | Hacker News]]. - [[https://avi.im/blag/2021/fast-sqlite-inserts/][Inserting One Billion Rows in SQLite Under A Minute - blag]]. - [[https://news.ycombinator.com/item?id=18831470][LiteCLI – A user-friendly command-line client for SQLite database (Hacker News)]]. - [[https://www.sqlite.org/appfileformat.html][SQLite As An Application File Format]]. - [[http://ericsink.com/entries/rss_cat_3.html][Zumero: Efficient sync by using multiple SQLite files]]. * [2020-02-26 Wed] covid-19 bookmarks :PROPERTIES: :CUSTOM_ID: covid-19-bookmarks :END: :MODIFIED: [2021-06-27 Sun] :END: - [[https://www.linkedin.com/pulse/data-centric-approach-plan-appropriate-covid-19-response-tee][A Data-Centric Approach to Plan Appropriate COVID-19 Response in the United States]]. - [[https://www.gov.uk/government/publications/coronavirus-action-plan/coronavirus-action-plan-a-guide-to-what-you-can-expect-across-the-uk][Coronavirus action plan: a guide to what you can expect across the UK - GOV.UK]]. - [[https://gisanddata.maps.arcgis.com/apps/opsdashboard/index.html#/bda7594740fd40299423467b48e9ecf6][Coronavirus COVID-19 Global Cases by Johns Hopkins CSSE]]. - [[https://www.reddit.com/r/COVID19][COVID-19 (r/COVID19)]]. - [[https://www.reddit.com/r/China_Flu/][COVID-19 Discussion (r/China_Flu/)]]. - [[https://covid-search.doctorevidence.com][Covid-19 DocSearch free access]]. - [[https://www.reddit.com/r/COVID19/comments/f9dbeq/covid19_what_do_we_have_to_fear_from_a_pandemic/][COVID19 - AMA with r/COVID19 mod u/Jennifer Cole at 10.00pm GMT 25 Feb]]. - [[https://news.ycombinator.com/item?id=22624091][Handbook of Covid-19 Prevention and Treatment from Hospital with 0% fatality (HN)]]. - [[https://www.microcovid.org][microCOVID Project (calculate risk)]]. - [[https://www.runnersworld.com/uk/news/a32094750/coronavirus-runner-slipstream/][New research suggests runners should be further than 2m apart]]. - [[https://www.reddit.com/r/Coronavirus/][Novel Coronavirus (2019-nCoV) (r/coronavirus)]]. - [[https://ocw.mit.edu/resources/res-10-s95-physics-of-covid-19-transmission-fall-2020/][Physics of COVID-19 Transmission | MIT OpenCourseWare]]. - [[https://docs.google.com/document/u/1/d/1DioVg-8nu25up0JMdd-w3AsJPy1tl0MsobfG6TzGOws/mobilebasic][Self-care Tips if you become sick with COVID-19 from an activist nurse]]. - [[https://www.who.int/emergencies/diseases/novel-coronavirus-2019/advice-for-public/when-and-how-to-use-masks][WHO: When and how to use masks]]. * [2020-02-15 Sat] Security bookmarks :PROPERTIES: :CUSTOM_ID: security-bookmarks :END: :MODIFIED: [2020-04-26 Sun] :END: - [[https://news.ycombinator.com/item?id=22980003][A Graduate Course in Applied Cryptography | Hacker News]]. - [[https://sneak.berlin/20191011/stupid-unix-tricks/][Jeffrey Paul: Stupid Unix Tricks (ssh)]]. - [[https://sneak.berlin/20191011/stupid-unix-tricks/][Jeffrey Paul: Stupid Unix Tricks (yubikey setup)]]. - [[https://lchsk.com/stay-paranoid-and-trust-no-one-overview-of-common-security-vulnerabilities-in-web-applications.html][Stay paranoid and trust no one. Overview of common security vulnerabilities in web applications]]. * [2020-02-15 Sat] Nix bookmarks :PROPERTIES: :CUSTOM_ID: nix-bookmarks :END: :MODIFIED: [2020-02-15 Sat] :END: - [[https://github.com/bergey/dotfiles/blob/4807ef9de187018a9cf7e1d571fc530e3ce07bfb/emacs/emacs.nix][Daniel Bergey's dotfiles/emacs.nix]]. - [[https://news.ycombinator.com/item?id=22295102][I Was Wrong about Nix | Hacker News]]. - [[https://christine.website/blog/i-was-wrong-about-nix-2020-02-10][I was wrong about Nix]]. * [2020-01-10 Fri] Plants bookmarks :PROPERTIES: :CUSTOM_ID: plants-bookmarks :END: :MODIFIED: [2021-07-11 Sun] :END: - [[https://www.houseofplants.co.uk/plants/aechmea-blue-rain_blue-rain-bromeliad_63988.html][Aechmea 'Blue Rain' Blue rain Bromeliad | House of Plants]]. - [[https://en-gb.bakker.com/collections/air-purifying-plants][Air-purifying Plants – Bakker.com]]. - [[https://twitter.com/Hydeez411/status/1409883023772901379][Citronella Mosquito Plant]]. - [[https://www.elmshop.co.uk/plants][Elm plants]]. - [[https://farmhack.org/tools][Farm Hack]]. - [[https://news.ycombinator.com/item?id=21859303][Guerilla Gardening (2015) | Hacker News]]. - [[https://www.thegardeningclub.co.uk/][The Gardening Club® - Crews Hill, Enfield]]. * [2019-12-29 Sun] Fixing Honeywell CM927's dead screen :PROPERTIES: :CUSTOM_ID: fixing-honeywell-cm927-dead-screens :END: My Honeywell CM927 thermostat's screen had been getting progressively worse over the last year. As of late, the screen was of little use. #+ATTR_HTML: :width 75% :height 75% [[file:images/fixing-honeywell-cm927-dead-screens/before.png]] A random search yielded the [[https://www.homeownershub.com/uk-diy/honeywell-cm927-lcd-screen-fail-common-1058940-.htm][Honeywell CM927 LCD screen fail - common?]] thread, with a promising comment by Phil: #+begin_quote "Strip the unit and remove the circuit board (just a few plastic clips, no screws). Remove the LCD assembly from the circuit board (more plastic clips and an eight pin push connection). Removed the LCD unit from the clear plastic housing (more plastic clips). Finally heat up the plastic ribbon where it is stuck to the circuit board (hair dryer will do trick) and then firmly press it onto the circuit board... probably worth doing this several times; in effect you are remating the ribbon to the circuit board by softening the adhesive. Put it all back together and it should be working again." #+end_quote Phil's instructions were great. There's also a super handy [[https://www.youtube.com/watch?v=W4LxHn5Y_l4][video]] by [[https://www.youtube.com/channel/UC3Dbv6X-_7fCfa4AvsxK_zw][El Tucan]], also [[https://www.homeownershub.com/uk-diy/honeywell-cm927-lcd-screen-fail-common-1058940-3.htm][linked by Stevie]]. ** Success \o/ Heating up the plastic ribbon and pressing it onto the circuit board did the trick for me. Took a few tries for all segments to appear, but the screen is looking great again. Thank you Internet strangers! :) #+ATTR_HTML: :width 75% :height 75% [[file:images/fixing-honeywell-cm927-dead-screens/after.png]] * [2019-12-29 Sun] SwiftUI bookmarks :PROPERTIES: :CUSTOM_ID: swiftui-bookmarks :END: :MODIFIED: [2021-11-23 Tue] :END: - [[https://github.com/AndreaMiotto/ActionOver][ActionOver: A custom SwiftUI modifier to present an Action Sheet on iPhone and a Popover on iPad and Mac]]. - [[https://www.hackingwithswift.com/articles/224/common-swiftui-mistakes-and-how-to-fix-them][8 Common SwiftUI Mistakes - and how to fix them – Hacking with Swift]]. - [[https://schwiftyui.com/swiftui/building-a-widget-for-ios-with-swiftui-and-widgetkit/][Building a Widget for iOS with SwiftUI and WidgetKit - SchwiftyUI]]. - [[https://swiftui.diegolavalle.com/posts/linewrapping-stacks/][Line-Wrapping Stacks - Swift You and I]]. - [[https://swiftwithmajid.com/2021/07/14/pull-to-refresh-in-swiftui/][Pull-to-Refresh in SwiftUI | Swift with Majid]]. - [[https://blog.rizwan.dev/blog/swiftui-import-export-files][SwiftUI Import/Export files | Rizwan's Blog 👨‍💻]]. - [[https://betterprogramming.pub/the-swiftui-toolbar-in-ios-14-b4a0fe6a3034][The SwiftUI Toolbar in iOS 14]]. - [[https://trailingclosure.com/][Trailing Closure (SwiftUI tutotials)]]. - [[https://www.avanderlee.com/swift/urlsession-common-pitfalls-with-background-download-upload-tasks/][URLSession: Common pitfalls with background download & upload tasks]]. - [[https://twitter.com/clarko/status/1284940951031439361][ SwiftUI live-blur materials that you can use like a background color]]. - [[https://emacsist.github.io/2020/01/07/swiftui-for-absolute-beginners%E8%AF%BB%E4%B9%A6/][读书 - emacsist]]. - [[https://developer.apple.com/documentation/swiftui/environmentvalues][@Environment values]]. - [[https://twitter.com/natpanferova/status/1275903292946567168][`@State` `onChange`]]. - [[https://github.com/Jinxiansen/SwiftUI][`SwiftUI` Framework Learning and Usage Guide]]. - [[https://swiftui-lab.com/companion/][A Companion for SwiftUI - The SwiftUI Lab]]. - [[https://swiftbysundell.com/articles/deep-dive-into-swift-function-builders/][A deep dive into Swift’s function builders | Swift by Sundell]]. - [[https://www.objc.io/blog/2020/08/18/fuzzy-search/][A Fast Fuzzy Search Implementation · objc.io]]. - [[https://swiftbysundell.com/articles/swiftui-state-management-guide/][A guide to SwiftUI’s state management system | Swift by Sundell]]. - [[https://swiftbysundell.com/articles/swiftui-layout-system-guide-part-1/][A guide to the SwiftUI layout system - Part 1 | Swift by Sundell]]. - [[https://github.com/jordansinger/SwiftUI-Kit][A SwiftUI iOS system components and interactions demo app based on iOS 14]]. - [[https://swiftui-lab.com/swiftui-animations-part1/][Advanced SwiftUI Animations - Part 1: Paths - The SwiftUI Lab]]. - [[https://swiftui-lab.com/advanced-transitions/][Advanced SwiftUI Transitions - The SwiftUI Lab]]. - [[https://github.com/krzysztofzablocki/AutomaticSettings][AutomaticSettings: Data driven settings UI]]. - [[https://www.morningswiftui.com/blog/build-mapview-app-with-swiftui][Building a MapView app with SwiftUI — Morning SwiftUI]]. - [[https://swiftwithmajid.com/2019/12/25/building-pager-view-in-swiftui/][Building Pager view in SwiftUI | Majid’s blog about Swift development]]. - [[https://swiftwithmajid.com/2020/02/05/building-viewmodels-with-combine-framework/][Building ViewModels with Combine framework]]. - [[https://www.donnywals.com/category/combine/][Category: Combine – Donny Wals]]. - [[https://store.raywenderlich.com/products/combine-asynchronous-programming-with-swift][Combine: Asynchronous Programming with Swift]]. - [[https://swiftwithmajid.com/2019/08/28/composable-styling-in-swiftui/][Composable styling in SwiftUI | Swift with Majid]]. - [[https://www.oliverbinns.co.uk/2020/07/23/constructing-data-with-swift-function-builders/][Constructing Data with Swift Function Builders – Oliver Binns]]. - [[https://medium.com/flawless-app-stories/context-menu-alert-and-actionsheet-in-swiftui-b6ff0d1f8493][Context Menu, Alert and ActionSheet in SwiftUI]]. - [[https://danielsaidi.com/blog/2020/01/05/create-an-spm-package-for-swiftui][Create an SPM Package for SwiftUI | Daniel Saidi]]. - [[https://github.com/mattgallagher/CwlFitting][CwlFitting: A small SwiftUI package to aid with "shrink-to-fit" + "fill-aligned" VStack and HStack arrangements]]. - [[https://twitter.com/twostraws/status/1280996740053827584][debugPrint() SwiftUI modifier]]. - [[https://theswiftdev.com/2018/01/25/deep-dive-into-swift-frameworks/][Deep dive into Swift frameworks - The.Swift.Dev.]]. - [[https://dev.to/maeganwilson_/default-a-view-in-navigationview-with-swiftui-183p][Default a View in NavigationView with SwiftUI - DEV Community]]. - [[https://designcode.io/swiftui?promo=learnswiftui][designcode's SwiftUI course]]. - [[https://medium.com/over-engineering/monitoring-a-folder-for-changes-in-ios-dc3f8614f902][Detecting changes to a folder in iOS using Swift]]. - [[https://swiftui-lab.com/modal-dismiss-gesture/][Dismiss Gesture for SwiftUI Modals - The SwiftUI Lab]]. - [[https://medium.com/@karaiskc/first-learnings-from-adopting-swiftui-be2ee4289007][First learnings from adopting SwiftUI - Christos Karaiskos - Medium (card example)]]. - [[https://www.vadimbulavin.com/swift-function-builders-swiftui-view-builder/][Function Builders in Swift and SwiftUI]]. - [[https://swiftui-lab.com/geometryreader-to-the-rescue/][GeometryReader to the Rescue - The SwiftUI Lab]]. - [[https://medium.com/better-programming/gestures-in-swiftui-e94b784ecc7][Gestures in SwiftUI - Better Programming - Medium]]. - [[https://github.com/AppPear/ChartView][GitHub - AppPear/ChartView: ChartView made in SwiftUI]]. - [[https://github.com/dasautoooo/Parma][GitHub - dasautoooo/Parma: A SwiftUI view for displaying Markdown with custom.]]. - [[https://github.com/Dimillian/MovieSwiftUI][GitHub - Dimillian/MovieSwiftUI: SwiftUI & Combine app using MovieDB API.]]. - [[https://github.com/Jinxiansen/SwiftUI][GitHub - Jinxiansen/SwiftUI: `SwiftUI` Framework Learning and Usage Guide.]]. - [[https://github.com/mecid/SwiftUICharts][GitHub - mecid/SwiftUICharts: A simple line and bar charting library written for SwiftUI]]. - [[https://github.com/nalexn/EnvironmentOverrides][GitHub - nalexn/EnvironmentOverrides: QA assistant for a SwiftUI app]]. - [[https://github.com/nerdsupremacist/FancyScrollView][GitHub - nerdsupremacist/FancyScrollView (list with growing/snapping header)]]. - [[https://github.com/paololeonardi/WaterfallGrid][GitHub - paololeonardi/WaterfallGrid: A waterfall grid layout view for SwiftUI.]]. - [[https://github.com/SimpleBoilerplates/SwiftUI-Cheat-Sheet][GitHub - SimpleBoilerplates/SwiftUI-Cheat-Sheet: SwiftUI Cheat Sheet]]. - [[https://github.com/siteline/SwiftUI-Introspect][GitHub - siteline/SwiftUI-Introspect: Introspect underlying UIKit components]]. - [[https://github.com/SwiftUIX/SwiftUIX][GitHub - SwiftUIX/SwiftUIX: An extension to the standard SwiftUI library.]]. - [[https://swiftwithmajid.com/2019/11/13/gradient-in-swiftui/][Gradient in SwiftUI | Majid’s blog about Swift development]]. - [[https://www.hackingwithswift.com/example-code/uikit/how-to-add-a-toolbar-above-the-keyboard-using-inputaccessoryview][How to add a toolbar above the keyboard using inputAccessoryView]]. - [[https://twitter.com/myridiphis/status/1339840448689549312][How to animate along zIndex in SwiftUI]]. - [[https://blckbirds.com/post/side-menu-hamburger-menu-in-swiftui/][How to create a side menu (hamburger menu) in SwiftUI | BLCKBIRDS]]. - [[https://www.raywenderlich.com/4503153-how-to-create-a-splash-screen-with-swiftui][How to Create a Splash Screen With SwiftUI | raywenderlich.com]]. - [[https://stackoverflow.com/questions/56490963/how-to-display-a-search-bar-with-swiftui][how to display a search bar with SwiftUI - Stack Overflow]]. - [[https://www.hackingwithswift.com/articles/210/how-to-fix-slow-list-updates-in-swiftui][How to fix slow List updates in SwiftUI – Hacking with Swift]]. - [[https://medium.com/better-programming/scheduling-notifications-and-badges-in-swiftui-9edf8574b893][How to Schedule Notifications and Add Badges in SwiftUI]]. - [[https://twitter.com/icanzilb/status/1324685822063497217][Image resizing techniques in Swift (smooth scroll)]]. - [[https://medium.com/better-programming/implement-searchbar-in-swiftui-556a204e1970][Implement a Search Bar in SwiftUI - Better Programming - Medium]]. - Implementing Context Menus in iOS 13 Using SwiftUI or UIKit. - [[https://twitter.com/chriseidhof/status/1280138752409636864][In the new SwiftUI, is there any reason you would still use ObservedObject instead of StateObject?]]. - [[https://swiftui-lab.com/communicating-with-the-view-tree-part-1/][Inspecting the View Tree with PreferenceKey - Part 1 - The SwiftUI Lab]]. - [[https://twitter.com/misaellandero/status/1285318302013837312][Integrate SwiftUI on UIKIT project its actually pretty easy]]. - [[https://stackoverflow.com/questions/56505043/how-to-make-view-the-size-of-another-view-in-swiftui][ios - How to make view the size of another view in SwiftUI - Stack Overflow]]. - [[https://elliehuxtable.com/lessons-learned-with-swift-ios-development/][Lessons learned with Swift + iOS development]]. - [[https://twitter.com/dmartincy/status/1275913911506780161][LLDB "_regexp-break ::", breakpoint at a particular source code line and column]]. - [[https://swiftwithmajid.com/2020/07/08/mastering-grids-in-swiftui/][Mastering grids in SwiftUI | Swift with Majid]]. - [[https://swiftwithmajid.com/2020/09/24/mastering-scrollview-in-swiftui/][Mastering ScrollView in SwiftUI | Swift with Majid]]. - [[https://github.com/jordansinger/messages-multiplatform-swiftui-sample][Multiplatform Messages app for macOS, iOS, iPadOS in SwiftUI]]. - [[https://swiftwithmajid.com/2019/12/04/must-have-swiftui-extensions/][Must-have SwiftUI extensions | Majid’s blog about Swift development]]. - [[https://swiftwithmajid.com/2020/06/29/new-property-wrappers-in-swiftui/][New property wrappers in SwiftUI (@ScaledMetric, @SceneStorage, @AppStorage, @StateObject)]]. - [[https://twitter.com/natpanferova/status/1296725502305034240][On iOS 14, the keyboard is added to safe area]]. - [[https://www.objc.io/blog/2020/03/17/thinking-in-swiftui/][Our New Book: Thinking in SwiftUI · objc.io]]. - [[https://nalexn.github.io/anyview-vs-group/][Performance Battle: AnyView vs Group - Alexey Naumov]]. - [[https://gumroad.com/l/practical-combine/wwdc2020][Practical Combine: An introduction to Combine with real examples]]. - [[https://nalexn.github.io/swiftui-deep-linking/][Programmatic navigation in SwiftUI project - Alexey Naumov]]. - [[https://medium.com/get-chip/propert-wrappers-in-swift-5-1-14f610530710][Property Wrappers in Swift 5.1. An introduction to one of Swift 5.1’s]]. - [[https://twitter.com/navdeep_ua/status/1296591355485945856][Recreate iOS style Welcome Screen to any app in 3 minutes]]. - [[https://twitter.com/jsngr/status/1276700160643551232][Recreate this Control Center widget in SwiftUI]]. - [[https://dev.to/gualtierofr/remote-images-in-swiftui-49jp][Remote images in SwiftUI - DEV Community]]. - [[https://medium.com/ymedialabs-innovation/resizing-techniques-and-image-quality-that-every-ios-developer-should-know-e061f33f7aba][Resizing Techniques and Image Quality That Every iOS Developer Should Know (Swift)]]. - [[https://medium.com/flawless-app-stories/reusable-image-cache-in-swift-9b90eb338e8d][Reusable Image Cache in Swift - Flawless iOS - Medium]]. - [[https://ordinarycoding.com/articles/search-view-in-swiftui/][Search View in SwiftUI | Ordinary Coding]]. - [[https://www.hackingwithswift.com/books/ios-swiftui/selecting-dates-and-times-with-datepicker][Selecting dates and times with DatePicker]]. - [[https://twitter.com/icanzilb/status/1235884754576322560][Short video showing you how to debug, learn, or teach Combine operators with Timelane - the approach is always the same, add lanes - analyze the data]]. - [[https://swiftwithmajid.com/2020/07/21/sidebar-navigation-in-swiftui/][Sidebar navigation in SwiftUI | Swift with Majid]]. - [[https://github.com/alfianlosari/SwiftUIStaggeredNote][StaggeredList Sample App: A Staggered Pinterest Like Layout using SwiftUI]]. - [[https://developer.apple.com/documentation/swiftui/state_and_data_flow][State and Data Flow | Apple Developer Documentation]]. - [[https://twitter.com/twostraws/status/1279487425581133831][Stretchable header]]. - [[https://stackoverflow.com/questions/56578072/hstack-with-sf-symbols-image-not-aligned-centered][swift - HStack with SF Symbols Image not aligned centered - Stack Overflow]]. - [[https://stackoverflow.com/questions/59227158/imagepicker-in-swiftui][swift - ImagePicker in SwiftUI - Stack Overflow]]. - [[https://nshipster.com/propertywrapper/][Swift Property Wrappers - NSHipster]]. - [[https://swiftuipropertywrappers.com/][Swift UI Property Wrappers (@State, @StateObject, @EnvironmentObject, @ObservedObject, @Binding)]]. - [[https://stackoverflow.com/questions/62840571/not-receiving-scenephase-changes][swiftui - Not Receiving scenePhase Changes (foreground/background)]]. - [[https://medium.com/better-programming/swiftui-and-redux-clean-code-and-small-independent-components-6f46a5eb46b3][SwiftUI and Redux — Clean Code and Small, Independent Components]]. - [[https://sarunw.com/posts/swiftui-animation/][SwiftUI Animation (buttons, current-rotations, etc) | Sarun]]. - [[https://sarunw.com/posts/swiftui-animation/][SwiftUI Animation | Sarun]]. - [[https://medium.com/swlh/learn-master-%EF%B8%8F-swiftui-basic-components-in-10-minutes-dc327e71d245][SwiftUI basic components (form example)]]. - [[https://www.hackingwithswift.com/books/ios-swiftui/buttons-and-images][SwiftUI Buttons and images (using systemName)]]. - [[https://designcode.io/courses][SwiftUI courses]]. - [[https://swiftui-lab.com/custom-styling/][SwiftUI Custom Styling - The SwiftUI Lab (scaleEffect and opacity on isPressed)]]. - [[https://www.swiftcompiled.com/swiftui-datepicker/][SwiftUI DatePicker]]. - [[https://github.com/Leon12345679/QuickActionCard][SwiftUI displaying customizable quick action card]]. - [[https://troz.net/post/2020/swiftui_mac_big_sur/][SwiftUI for Mac on Big Sur :: TrozWare]]. - [[https://twitter.com/jsngr/status/1276931917628219398][SwiftUI gives you .isPlaceholder in WidgetKit generate a placeholders]] - [[https://kean.github.io/post/swiftui-layout-system][SwiftUI Layout System | Alexander Grebenyuk]]. - [[https://www.simpleswiftguide.com/swiftui-navigationview-tutorial-with-examples/][SwiftUI NavigationView tutorial with examples - Simple Swift Guide]]. - [[https://www.tomasznazarenko.com/frameworks/SwiftUI-notes/][SwiftUI notes - Tomasz Nazarenko Blog]]. - [[https://twitter.com/jamesthomson/status/1293506487063584770][SwiftUI picker gotchas]]. - [[https://twitter.com/Geri_Borbas/status/1262390699611369477][SwiftUI Search Bar in the Navigation Bar]]. - [[https://zonneveld.dev/][SwiftUI snippets by Jeroen Zonneveld]]. - [[https://www.appcoda.com/swiftui-form-ui/][SwiftUI Tutorial: How to Build a Form UI for iOS Apps]]. - [[https://swiftuihub.com/][SwiftUI Tutorials on SwiftUI Hub]]. - [[https://swiftui.gallery/][swiftui.gallery | A gallery of SwiftUI code example snippets]]. - [[https://swiftui.gallery/uploads/code/SignUpForm][swiftui.gallery: sign up form sample]]. - [[https://github.com/ygit/swiftui][swiftui: A collaborative list of awesome SwiftUI resources]]. - [[https://finestructure.co/blog/2020/1/20/swiftui-equal-widths-view-constraints][SwiftUI: Equal widths view constraints — finestructure]]. - [[https://www.objc.io/blog/2019/10/01/swiftui-shake-animation/][SwiftUI: Shake Animation · objc.io]]. - [[https://github.com/alfianlosari/SwiftUIStaggeredList][SwiftUIStaggeredList: Staggered Layout List Using SwiftUI]]. - [[https://medium.com/better-programming/swiftuis-new-app-lifecycle-and-replacements-for-appdelegate-and-scenedelegate-in-ios-14-c9cf4a2367a9][SwiftUI’s New App Lifecycle and Replacements for AppDelegate]]. - [[https://danielsaidi.com/blog/2020/01/05/create-an-spm-package-for-swiftui][Swipe gesture SwiftUI | Daniel Saidi]]. - [[https://www.reddit.com/r/swift/comments/elhakp/so_i_guess_my_journey_begins_now/][SwuiftUI books]]. - [[https://sarunw.com/tags/swiftui/][Tagged “SwiftUI” | Sarun]]. - [[https://swiftwithmajid.com/2020/02/26/textfield-in-swiftui/][TextField in SwiftUI | Majid’s blog about Swift development]]. - [[https://medium.com/better-programming/the-complete-swiftui-documentation-youve-been-waiting-for-fdfe7241add9][The Complete SwiftUI Documentation You’ve Been Waiting For]]. - [[https://swiftwithmajid.com/2020/07/02/the-difference-between-stateobject-environmentobject-and-observedobject-in-swiftui/][The difference between @StateObject, @EnvironmentObject, and @ObservedObject]]. - [[https://swiftui-lab.com/a-powerful-combo/][The Power of the Hosting+Representable Combo (scroll SwiftUI list)]]. - [[https://theswiftdev.com/2019/10/31/the-ultimate-combine-framework-tutorial-in-swift/][The ultimate Combine framework tutorial in Swift - The.Swift.Dev.]]. - [[https://twitter.com/dbuchanandev/status/1236411023340511233][Tweet on improving List SwiftUI performace (searching)]]. - [[https://www.raywenderlich.com/4829472-uicollectionview-custom-layout-tutorial-pinterest][UICollectionView Custom Layout Tutorial: Pinterest | raywenderlich.com]]. - [[https://medium.com/@dmytro.anokhin/url-image-view-in-swiftui-f08f85d942d8][URL Image view in SwiftUI]]. - [[https://heckj.github.io/swiftui-notes/][Using Combine (extensive online book)]]. - [[https://medium.com/better-programming/using-ios-14s-menu-as-a-picker-in-swiftui-b036c772037][Using iOS 14's Menu as a Picker in SwiftUI]]. - [[https://swiftwithmajid.com/2019/10/30/view-composition-in-swiftui/][View composition in SwiftUI | Majid’s blog about Swift development]]. - [[https://netsplit.com/swiftui/views-choose-their-own-sizes/][Views Choose Their Own Sizes – Netsplit.com]]. - [[https://medium.com/flawless-app-stories/visualize-combine-magic-with-swiftui-part-1-3a56e2a461b3][Visualize Combine Magic with SwiftUI Part 1 - Flawless iOS - Medium]]. - [[https://www.donnywals.com/whats-the-difference-between-stateobject-and-observedobject/][What’s the difference between @StateObject and @ObservedObject? – Donny Wals]]. - [[https://nalexn.github.io/swiftui-observableobject][Why I quit using the ObservableObject - Alexey Naumov]]. - [[https://swiftui-lab.com/working-with-focus-on-swiftui-views/][Working with Focus on SwiftUI Views - The SwiftUI Lab]]. * [2019-12-17 Tue] Studying for Life in the UK test :PROPERTIES: :CUSTOM_ID: studying-for-life-in-the-uk-test :END: Today, I passed the [[https://www.gov.uk/life-in-the-uk-test][Life in the UK test]]. Wasn't quite sure how to study for it. During my commutes, I listened to the [[https://www.audible.co.uk/pd/Life-in-the-UK-2019-Test-Contains-the-Official-Course-300-Practice-Questions-Audiobook/B07VD9SR3L][Life in the UK 2019 Test audio book]]. A friend recommended [[https://lifeintheuktestweb.co.uk][lifeintheuktestweb.co.uk]]. Overall, I found their practice tests very useful. Taking a bunch tests helped me internalize the material. Took some notes along the way (mostly data with years attached) and dumped it into an [[https://orgmode.org/manual/Built_002din-Table-Editor.html#Built_002din-Table-Editor][org table]]. This helped me form a mental timeline. *NOTE:* /These tables alone are *not* comprehensive enough to prepare for the exam. You'll need to know additional information without dates attached./ ** Events |----------------+--------------------------------------------------------------------------------| | Year | Event | |----------------+--------------------------------------------------------------------------------| | 2012 | Diamond Jubilee | | 1999 | Scottish Parliament formed | | 1973 | UK joins the EU \o/ | | 1972 | Mary Peters wins Gold medal (pentathlon) | | 1957 | Treaty of Rome signed (March 25) | | 1950 | UK signs European Convention of Human Rights | | 1949 | Ireland become a republic | | 1947 | Granted independence India, Pakistan and Ceylon (Sri Lanka) | | 1945 | Clement Attlee elected | | 1945 | Alexander Fleming discovers penicillin | | 1945 | WWII ends | | 1944 | Butler Act (free secondary education England/Wales) | | 1940 | Battle of Britain | | 1939 | Germany invades Poland | | 1930s | Turing Machine | | 1936 | BBC first regular television service | | 1932 | First television broadcast | | 1930 | British Film Studios Fluorish | | 1928 | Women/men with same voting age | | 1918 | WWI ends (November 11, 11am) | | 1903 | Emmeline Pankhurst Women’s Social and Political Union (suffragettes) | | 1902 | Motor-car racing in UK | | 1896 | First film shown publicly | | 1899-1902 | The Boer War (South Africa) | | 1870-1914 | 120000 Russian and Polish Jews fled to Britain to escape prosecution | | 1853-1856 | Crimean War | | 1851 | Great Exhibition (showcased Crystal Palance) | | 1837 | Queen Victoria becomes queen (at 18) | | 1833 | Emancipation Act (abolished slavery throughout British Emprire) | | 1832 | The Reform Act (increase number of people with voting rights) | | 1776 | North American colonies want out (don't tax us without representation) | | 1745 | Bonnie Prince Charlie gets support by clansmen from Scottish highlands | | 1714 | Queen Ann dies, George I becomes King | | 1689 | Bill of rights (limit rights of kings) | | 1688 | William of Orange invades England (proclaims king) | | 1680-1720 | Huguenots refugees came to England (from France) | | 1695 | Free press (newspapers) established | | 1679 | Habeas Corpus Act (right to trial) | | 1649-1660 | Cromwell rules republic for 11 years (Charles I executed) | | 1642 | English Civil war (Cavaliers vs Roundheads) | | 1606 | Union flag created | | 1588 | English beat Spanish Armada | | 1348 | Black death (third population die) | | 1314 | Battle of Bannockburn: Robert the Bruce (Scottish King) beats English invasion | | 1284 | Statute of Rhuddlan (Wales joins Crown, by King Edward I) | | 1215 | Magna Carta created | | 1066 | Norman Conquest (Saxon King Harold killed by William I) | | 300-400 AD | Christians appear in Britain | | 789 AD | Vikings first visit Britain and raid coastal towns | | 6000 years ago | Farmers come to Britain | |----------------+--------------------------------------------------------------------------------| ** Population |------+--------------| | Year | Population | |------+--------------| | 2010 | > 62 million | | 2005 | < 60 million | | 1998 | 57 million | | 1951 | 50 million | | 1901 | 40 million | | 1851 | 20 million | | 1700 | 5 million | | 1600 | > 4 million | |------+--------------| * [2019-12-01 Sun] Georgia travel bookmarks :PROPERTIES: :CUSTOM_ID: georgia-travel-bookmarks :END: - [[https://www.abandonedamerica.us/abandoned-georgia][Abandoned Georgia]]. * [2019-11-24 Sun] Wizard zines comics in Emacs eshell :PROPERTIES: :CUSTOM_ID: wizard-zines-comics-eshell-util :END: Over at [[http://wizardzines.com][wizardzines.com]], [[https://jvns.ca][Julia Evans]] authors wonderful zines on topics like git, networking, linux, command-line utilities, and others. Some zines are paid. Some are free. No affiliation here, just a fan. A little while ago, Julia [[https://twitter.com/b0rk/status/1192304892435738624][tweeted]] about a utility she's building to view her original comics on similar topics. I instantly thought it'd be a fun tool to implement for Emacs [[https://www.gnu.org/software/emacs/manual/html_mono/eshell.html][eshell]]. Since then, I subscribed to [[https://wizardzines.com/saturday-comics/][wizardzines.com/saturday-comics]] and received a few comics (awk, tar, and bash tricks). I saved them locally (using topic name and dropping file extensions). #+begin_src sh :exports both ls -1 ~/Downloads/wizardzines-comics/ #+end_src #+RESULTS: | awk | | bash | | tar | By no means battle-tested, but here's an elisp snippet defining the /ecomic/ command. It displays inlined comics in the handy eshell. #+begin_src emacs-lisp (require 'eshell) (require 'iimage) (defvar wizardzines-comics-path "~/Downloads/wizardzines-comics") (defun eshell/ecomic (&rest args) "Display command comic in ARGS. Note: ensure comic images live in `wizardzines-comics-path', named with command name and no extension." (eshell-eval-using-options "ecomic" args '((?h "help" nil nil "show this usage screen") :external "ecomic" :show-usage :usage "COMMAND Show COMMAND comic from Julia Evans' https://wizardzines.com/saturday-comics") (let* ((command (nth 0 (eshell-stringify-list (eshell-flatten-list args)))) (image-fpath (concat (file-name-as-directory (expand-file-name wizardzines-comics-path)) command))) (unless (file-exists-p image-fpath) (error "comic: \"%s\" not found :-(" command)) (eshell-buffered-print "\n") (add-text-properties 0 (length image-fpath) `(display ,(create-image image-fpath) modification-hooks (iimage-modification-hook)) image-fpath) (eshell-buffered-print image-fpath) (eshell-flush)))) #+end_src #+ATTR_HTML: :width 75% :height 75% [[file:images/wizard-zines-comics-eshell-util/ecomic.gif]] comments on [[https://twitter.com/xenodium/status/1198542659704504321][twitter]] ** Updates - Tweaked title. * [2019-11-21 Thu] Emacs counsel default search switches :PROPERTIES: :CUSTOM_ID: emacs-counsel-default-search-switches :END: Following up from [[http://xenodium.com/enhanced-emacs-searching-with-counsel-switches][Enhanced Emacs searching with counsel switches]], rather than remembering [[https://github.com/ggreer/the_silver_searcher][silver searcher]] and [[https://github.com/BurntSushi/ripgrep][ripgrep]] switches, we can use [[https://github.com/abo-abo/swiper][counsel's]] /ivy-initial-inputs-alist/ to set these up as default visible switches. #+begin_src emacs-lisp (push '(counsel-ag . "--file-search-regex '' -- ") ivy-initial-inputs-alist) (push '(counsel-rg . "--glob '**' -- ") ivy-initial-inputs-alist) #+end_src The default switches stay out of the way in typical searches, but can be easily modified to include (or exclude) results matching specific file /names/. #+ATTR_HTML: :width 75% :height 75% [[file:images/emacs-counsel-default-search-switches/default-switches.gif]] comments on [[https://twitter.com/xenodium/status/1197673205688864768?s=20][twitter]] * [2019-11-10 Sun] Enhanced Emacs searching with counsel switches :PROPERTIES: :CUSTOM_ID: enhanced-emacs-searching-with-counsel-switches :END: The [[https://github.com/abo-abo/swiper][counsel]] family of Emacs search commands are great for searching the filesystem. More specifically, /counsel-rg/, /counsel-ag/, and /counsel-pt/, which use the popular [[https://github.com/BurntSushi/ripgrep][ripgrep]], [[https://github.com/ggreer/the_silver_searcher][silver searcher]], and [[https://github.com/monochromegane/the_platinum_searcher][platinum searcher]] utilities. counsel-rg is my default searcher. It returns results quickly, with live updates as I tweak the search query. Up until recently, my queries typically matched text in files only. This works great, but every so often I wished I could amend the query to include (or exclude) results matching specific file /names/. Turns out, you can prepend the search query with additional switches using the "--" separator. The switches are usually utility-specific, but if we wanted to keep results from file names matching a glob, we can prepend the ripgrep query with something like /"--glob Make* --"/ or the shorter version /"-g Make* --"/. rg: -g Make* -- install #+ATTR_HTML: :width 75% :height 75% [[file:images/enhanced-emacs-searching-with-counsel-switches/counsel-rg-switch.gif]] * [2019-11-10 Sun] Emacs org block company completion :PROPERTIES: :CUSTOM_ID: emacs-org-block-company-completion :END: UPDATE: This is now available [[https://melpa.org/#/company-org-block][on melpa]]. Back in 2015, I bound the "<" key to a hydra for quickly inserting org blocks. The idea came from Oleg's post on [[https://oremacs.com/2015/03/07/hydra-org-templates/][org-mode block templates in Hydra]]. The suggested binding settled in my muscle memory without much effort. Fast forward to Febrary 2019. I replaced the hydra with /[[https://orgmode.org/manual/Easy-templates.html][org-insert-structure-template]]/ when /org-try-structure-completion/ was removed from org mode. No biggie, as I kept the same binding to "<" and hardly noticed the change. Since my primary use-case for easy templates is inserting [[https://orgmode.org/manual/Working-with-source-code.html][source blocks]], I was keen to expedite choosing the source language as well as inserting the source block itself. Writing a small [[https://company-mode.github.io/][company mode]] completion backend fits my primary use-case pretty well. #+ATTR_HTML: :width 50% :height 50% [[file:images/emacs-org-block-company-completion/company-org-block.gif]] The company backend looks as follow (*Warning:* [[https://twitter.com/tpanum/status/1197772426072997888][Snippet needs Org v9.2]]). Note: This code is not up to date. Install via [[https://melpa.org/#/company-org-block][melpa]] or see [[https://github.com/xenodium/company-org-block][its repository]]. #+begin_src emacs-lisp :results value (require 'map) (require 'org) (require 'seq) (defvar company-org-block-bol-p t "If t, detect completion when at begining of line, otherwise detect completion anywhere.") (defvar company-org--regexp "<\\([^ ]*\\)") (defun company-org-block (command &optional arg &rest ignored) "Complete org babel languages into source blocks." (interactive (list 'interactive)) (cl-case command (interactive (company-begin-backend 'company-org-block)) (prefix (when (derived-mode-p 'org-mode) (company-org-block--grab-symbol-cons))) (candidates (company-org-block--candidates arg)) (post-completion (company-org-block--expand arg)))) (defun company-org-block--candidates (prefix) "Return a list of org babel languages matching PREFIX." (seq-filter (lambda (language) (string-prefix-p prefix language)) ;; Flatten `org-babel-load-languages' and ;; `org-structure-template-alist', join, and sort. (seq-sort #'string-lessp (append (mapcar #'prin1-to-string (map-keys org-babel-load-languages)) (map-values org-structure-template-alist))))) (defun company-org-block--template-p (template) (seq-contains (map-values org-structure-template-alist) template)) (defun company-org-block--expand (insertion) "Replace INSERTION with actual source block." (delete-region (point) (- (point) (1+ ;; Include "<" in length. (length insertion)))) (if (company-org-block--template-p insertion) (company-org-block--wrap-point insertion ;; May be multiple words. ;; Take the first one. (nth 0 (split-string insertion))) (company-org-block--wrap-point (format "src %s" insertion) "src"))) (defun company-org-block--wrap-point (begin end) "Wrap point with block using BEGIN and END. For example: ,#+begin_BEGIN | ,#+end_END" (insert (format "#+begin_%s\n" begin)) (insert (make-string org-edit-src-content-indentation ?\s)) ;; Saving excursion restores point to location inside code block. (save-excursion (insert (format "\n#+end_%s" end)))) (defun company-org-block--grab-symbol-cons () "Return cons with symbol and t whenever prefix of < is found. For example: \" (\"e\" . t)" (when (looking-back (if company-org-block-bol-p (concat "^" company-org--regexp) company-org--regexp) (line-beginning-position)) (cons (match-string-no-properties 1) t))) #+end_src To use, add the backend enable /company-mode/ in /org-mode/: #+begin_src emacs-lisp :results value (add-to-list 'company-backends 'company-org-block) (company-mode +1) #+end_src ** Updates - Removed language-specific header logic (use /[[https://www.orgmode.org/worg/org-contrib/babel/header-args.html][org-babel-default-header-args]]/ instead). - Also completes non-source block templates from [[https://orgmode.org/manual/Easy-templates.html][org-structure-template-alist]]. - Source in my [[https://github.com/xenodium/dotsies/blob/master/emacs/ar/company-org-block.el][dot files]]. - Removed unnecessary binding. Just add company backend as usual. - Thanks to [[https://twitter.com/takaxp][Takaaki Ishikawa]] for [[https://twitter.com/takaxp/status/1195884481535561729?s=20][suggesting `org-edit-src-content-indentation']]. - Thanks to [[https://twitter.com/tpanum][Thomas Kobber]] for [[https://twitter.com/xenodium/status/1194224168709083137][highlighting incompatibility]] with older org versions. * [2019-11-08 Fri] IRC bookmarks :PROPERTIES: :CUSTOM_ID: irc-bookmarks :END: - [[https://github.com/davisonio/awesome-irc][Awesome IRC]]. * [2019-11-03 Sun] A more reusable Emacs shell-command history :PROPERTIES: :CUSTOM_ID: more-reusable-emacs-shell-command-history :END: [[https://twitter.com/camdez][Cameron Desautel]] has a great post on [[https://engineering.collbox.co/post/working-faster-in-emacs-by-reading-the-future/][Working Faster in Emacs by Reading the "Future"]], highlighting /M-n/'s usefulness for inserting minibuffer default values. Invoking /M-n/ in /shell-command/'s prompt is handy for quickly getting the current buffer's file name. This works great for one-off shell commands like /"chmod +x script.sh"/ or /"tidy -xml -i -m data.xml"/. Unfortunately, these commands aren't easily reusable from /shell-command/'s minibuffer history, since it'll keep hardcoded file names. There's likely existing built-in functionality or a more elaborate package for this, but advising /read-shell-command/ enables us to write more reusable commands like /"chmod +x $f"/ or /"tidy -xml -i -m $f"./ We merely replace /$f/ with /(buffer-file-name)/, and let everything else continue as usual. #+ATTR_HTML: :width 50% :height 50% [[file:images/more-reusable-emacs-shell-command-history/expanded-shell-command.png]] #+begin_src emacs-lisp (defun ar/adviced-read-shell-command (orig-fun &rest r) "Advice around `read-shell-command' to replace $f with buffer file name." (let ((command (apply orig-fun r))) (if (string-match-p "\\$f" command) (replace-regexp-in-string "\\$f" (or (buffer-file-name) (user-error "No file file visited to replace $f")) command) command))) (advice-add 'read-shell-command :around 'ar/adviced-read-shell-command) #+end_src It's worth mentioning that searching minibuffer history is pretty simple when leveraging [[https://github.com/abo-abo/swiper][counsel]] to fuzzy search (via /counsel-minibuffer-history/, bound to /C-r/ by default). #+ATTR_HTML: :width 50% :height 50% [[file:images/more-reusable-emacs-shell-command-history/richer-shell-command-history.gif]] On a final note, searching minibuffer history for cache hits is way more useful with richer history content. Be sure to save minibuffer history across Emacs sessions and increase /shell-command-history/ using the built-in [[https://www.emacswiki.org/emacs/SaveHist][savehist-mode]]. #+begin_src emacs-lisp (use-package savehist :custom (savehist-file "~/.emacs.d/savehist") (savehist-save-minibuffer-history t) (history-length 10000) (savehist-additional-variables '(shell-command-history)) :config (savehist-mode +1)) #+end_src * [2019-10-20 Sun] Taiwan travel bookmarks :PROPERTIES: :CUSTOM_ID: taiwan-travel-bookmarks :END: :MODIFIED: [2021-07-13 Tue] :END: - [[https://www.nickkembel.com/sun-moon-lake-tea/][Sun Moon Lake Tea: Why is it so good? (Spiritual Travels)]]. - [[https://blog.calebjay.com/posts/taipei-in-2019/][Taipei, 2019]]. - [[https://blog.calebjay.com/posts/why-taiwan/][Why You Should Remote Work in Taiwan]]. * [2019-10-10 Thu] Emacs swiper and multiple cursors :PROPERTIES: :CUSTOM_ID: emacs-swiper-and-multiple-cursors :END: Emacs [[https://github.com/abo-abo/swiper][swiper]] is awesome. I bound /swiper-isearch/ to /C-s/. Also a big fan of [[https://github.com/magnars/multiple-cursors.el][multiple cursors]]. I use it regularly (it's fun). I had totally missed Ole's post back in 2015: [[https://oremacs.com/2015/10/14/swiper-mc/][A simple multiple-cursors extension to swiper]]. Turns out, swiper has multiple cursors support out of the box (bound to /C-7/ by default). Yay! UPDATE: Thanks to [[https://irreal.org/blog/?p=8370][irreal's post]], please remember to add /swiper-mc/ to /mc/cmds-to-run-once/ list (or things won't work as expected). This typically happens interactively when you invoke C-7 the first time around. Make sure you answer "n" when you see a prompt like: #+ATTR_HTML: :width 50% :height 50% [[file:images/emacs-swiper-and-multiple-cursors/swiper-mc-no.png]] If you happen to choose "y" by mistake, take a look at *~/.emacs.d/.mc-lists.el* to correct it. Remove /swiper-mc/ from /mc/cmds-to-run-for-all/ and add it to /mc/cmds-to-run-once/. Invoke /m-x eval-buffer/ to reset the values and you're good to go. #+ATTR_HTML: :width 75% :height 75% [[file:images/emacs-swiper-and-multiple-cursors/swipermc.gif]] * [2019-10-08 Tue] Speeding up gifs with gifsycle :PROPERTIES: :CUSTOM_ID: speeding-up-gifs-with-gifsycle :END: Drop frames and speed gif up with [[https://www.lcdf.org/gifsicle/][gifsycle]] (via [[https://graphicdesign.stackexchange.com/a/20937][How to remove every second frame from an animated gif?]]): #+begin_src bash gifsicle -U in.gif `seq -f "#%g" 0 3 398` -O2 -o out.gif #+end_src ps. 398 is the total number of frames, which you can get with: #+begin_src bash identify in.gif #+end_src * [2019-10-08 Tue] Spam blacklisting with Emacs org babel :PROPERTIES: :CUSTOM_ID: spam-blacklisting-with-emacs-org-babel :END: Some email provider accept regular expressions to blacklist additional spam. My blacklist is long and tedious to update, but hey... Emacs org babel can simplify things here. It's way easier to maintain a blacklist (with no regex) using an org table. ** Blacklist #+begin_src org :exports src ,#+name: spam-entries | .spammy | | dodgyfella@hotmail.com | | henryzeespammer.com | | yumspam.com | #+end_src and subsequently use org babel (elisp snippet) to generate the regex. ** Regex gen #+begin_src org :exports src ,#+begin_src emacs-lisp :var rows=spam-entries (require 'dash) (require 's) (concat "^" (s-join "|" (mapcar (lambda (entry) (setq entry (regexp-quote (s-trim entry))) (assert (s-present? entry)) (cond ;; Blacklist email address: joe@spammer.spammy ((s-contains-p "@" entry) (format "(%s)" entry)) ;; Blacklist top-level domain: .spammy ((s-starts-with-p "\\." entry) (format "([^.]*%s)" entry)) ;; Blacklist domain: @spammer.spammy (t (format "(.*@%s)" entry)))) (-sort 'string< (-map (lambda (row) (nth 0 row)) rows)))) "$") ,#+end_src ,#+RESULTS: : ^([^.]*\.spammy)|(dodgyfella@hotmail\.com)|(.*@henryzeespammer\.com)|(.*@yumspam\.com)$ #+end_src UPDATE: Tweaked elisp and regex (but not animation) also found John Bokma's post: [[http://johnbokma.com/blog/2019/05/13/blacklisting-domains-with-postfix.html][Blacklisting domains with Postfix]]. #+ATTR_HTML: :width 75% :height 75% [[file:images/spam-blacklisting-with-emacs-org-babel/blacklist.png]] * [2019-10-06 Sun] Rewriting dates with Emacs multiple cursors :PROPERTIES: :CUSTOM_ID: rewriting-dates-with-emacs-multiple-cursors :END: Needed to rewrite the date format in a couple of csv columns. Emacs multiple cursors helps here, but needed a function to parse and reformat the dates themselves. I can likely reformat dates using the built-in /parse-time-string/ and /format-time-string/ functions, but hey why not give the [[https://github.com/alphapapa/ts.el][ts.el]] library a try... #+begin_src emacs-lisp (defun ar/region-to-timestamp () "Convert date like \"29 Apr 2019\" to \"2019-04-29\"." (interactive) (let ((date (ts-parse (buffer-substring (region-beginning) (region-end))))) (delete-region (region-beginning) (region-end)) (insert (ts-format "%Y-%m-%d" date)))) #+end_src Bound the new function to a temporary keybinding, so I can invoke from multiple cursors: #+begin_src emacs-lisp (bind-key "M-q" #'ar/region-to-timestamp) #+end_src and voilà! #+ATTR_HTML: :width 40% :height 40% [[file:images/rewriting-dates-with-emacs-multiple-cursors/ts.gif]] * [2019-10-05 Sat] Show/hide Emacs dired details in style :PROPERTIES: :CUSTOM_ID: showhide-emacs-dired-details-in-style :END: Emacs [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][dired]] is a powerful directory browser/editor. By default, it shows lots of handy file and directory details. #+ATTR_HTML: :width 75% :height 75% [[file:images/showhide-emacs-dired-details-in-style/dired.png]] I typically prefer hiding file and directory details until I need them. The built-in [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Misc-Dired-Features.html][dired-hide-details-mode]] makes this easy with the "(" key toggle. Coupled with [[https://twitter.com/sanityinc][Steve Purcell]]'s [[https://github.com/purcell/diredfl][diredfl]] (for coloring), it strikes a great user experience. #+ATTR_HTML: :width 75% :height 75% [[file:images/showhide-emacs-dired-details-in-style/diredfl.gif]] With a short snippet, you can also show/hide dired details in style: #+begin_src emacs-lisp (use-package dired :hook (dired-mode . dired-hide-details-mode) :config ;; Colourful columns. (use-package diredfl :ensure t :config (diredfl-global-mode 1))) #+end_src *UPDATE:* Thanks to [[https://twitter.com/dmartincy][Daniel Martín]], who [[https://twitter.com/dmartincy/status/1180512330288975872][pointed me]] to [[https://github.com/clemera/dired-git-info][dired-git-info]]. This package adds git logs to dired file and directory details. #+ATTR_HTML: :width 90% :height 90% [[file:images/showhide-emacs-dired-details-in-style/dired-git-info.gif]] Binding /dired-git-info-mode/ to ")" is a nice complement to /dired-hide-details-mode/'s "(" binding. #+begin_src emacs-lisp (use-package dired-git-info :ensure t :bind (:map dired-mode-map (")" . dired-git-info-mode))) #+end_src * [2019-09-29 Sun] Bulk buying bookmarks :PROPERTIES: :CUSTOM_ID: bulk-buying-bookmarks :END: - [[https://www.realfoods.co.uk][Real foods]]. * [2019-09-01 Sun] Speeding up Emacs tramp via ControlMaster :PROPERTIES: :CUSTOM_ID: speeding-up-emacs-tramp-via-controlmaster :END: Via [[https://gist.github.com/ralt/a36288cd748ce185b26237e6b85b27bb][Florian Margaine's Eshell config]], I discovered ssh's [[https://man.openbsd.org/ssh_config#ControlMaster][ControlMaster]]. It enables sharing multiple sessions over a single network connection. This has the benefit of speeding up Emacs TRAMP. In your ~/.ssh/config add: #+begin_src fundamental Host * ControlPath ~/.ssh/master-%h:%p ControlMaster auto ControlPersist 10m #+end_src * [2019-09-01 Sun] csv bookmarks :PROPERTIES: :CUSTOM_ID: csv-bookmarks :END: :MODIFIED: [2020-06-06 Sat] :END: - [[https://til.secretgeek.net/banking/convert_ofx_to_csv.html][convert ofx to csv . Today I Learned (secretGeek)]]. - [[https://www.johndcook.com/blog/2019/12/30/excel-to-csv/][Exporting Excel files to CSV with in2csv from csvkit]]. - [[https://news.ycombinator.com/item?id=20848581][TSV Utilities: Command line tools for large, tabular data files (Hacker News)]]. - [[https://haveagooddata.net/posts/why-you-dont-want-to-use-csv-files/][Why You Don't Want to Use CSV Files (Have a good data)]]. * [2019-08-10 Sat] Slovakia travel bookmarks :PROPERTIES: :CUSTOM_ID: slovakia-travel-bookmarks :END: - [[https://en.wikipedia.org/wiki/High_Tatras][High Tatras mountains (wonderful hikes)]]. * [2019-07-14 Sun] Thumbnailing pdf page :PROPERTIES: :CUSTOM_ID: thumbnailing-pdf-page :END: If you ever need to thumbnail a pdf page, imagemagick has got you covered. For example, to thumbnail page 3, you can use: #+begin_src sh :results verbatim convert path/to/input.pdf[2] path/to/output.png #+end_src #+RESULTS: #+begin_example convert -resize 10000x10000 path/to/input.pdf[2] path/to/output.png convert: FailedToExecuteCommand `'gs' -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pngalpha' -dTextAlphaBits=4 -dGraphicsAlphaBits=4 '-r72x72' -dFirstPage=3 -dLastPage=3 '-sOutputFile=/var/folders/2y/nj_s07ms7l5gfsffh89_79zm0000gn/T/magick-30950xzlPsgqGUwtA%d' '-f/var/folders/2y/nj_s07ms7l5gfsffh89_79zm0000gn/T/magick-30950jpGyui82uGOQ' '-f/var/folders/2y/nj_s07ms7l5gfsffh89_79zm0000gn/T/magick-30950cuDVTNjArshs'' (1) @ error/pdf.c/InvokePDFDelegate/292. #+end_example However, I had the error above (missing gs), resolved by installing ghostscript. #+begin_src sh brew install ghostscript #+end_src * [2019-07-12 Fri] Outdoor bookmarks :PROPERTIES: :CUSTOM_ID: outdoor-bookmarks :END: - [[https://lnt.org/why/7-principles/][The Seven Principles of Leave No Trace]]. * [2019-07-07 Sun] gnuplot bookmarks :PROPERTIES: :CUSTOM_ID: gnuplot-bookmarks :END: :MODIFIED: [2020-08-22 Sat] :END: - [[https://raymii.org/s/tutorials/GNUplot_tips_for_nice_looking_charts_from_a_CSV_file.html][GNUplot tips for nice looking charts from a CSV file]]. - [[https://lwn.net/SubscriberLink/828761/6d8c7ddc142a67a0/][Voxel plotting with gnuplot 5.4 {LWN.net}]]. * [2019-06-04 Tue] gnu global, ctags, and Emacs setup :PROPERTIES: :CUSTOM_ID: gnu-global-ctags-and-emacs-setup :END: ** Universal ctags (newer) I'm now using universal [[https://ctags.io/][ctags]], as recommended by [[https://github.com/redguardtoo/counsel-etags][counsel-etags]]. From universal ctag's [[https://docs.ctags.io/en/latest/osx.html][Building on Mac OS]]: #+begin_src sh brew tap universal-ctags/universal-ctags brew install --HEAD universal-ctags #+end_src .ctags #+begin_src fundamental --langdef=swift --langmap=swift:+.swift --kinddef-swift=v,variable,variables --kinddef-swift=f,function,functions --kinddef-swift=s,struct,structs --kinddef-swift=c,class,classes --kinddef-swift=p,protocol,protocols --kinddef-swift=e,enum,enums --kinddef-swift=t,typealias,typealiases --regex-swift=/(var|let)[ \t]+([^:=]+).*$/\2/v/ --regex-swift=/func[ \t]+([^\(\)]+)\([^\(\)]*\)/\1/f/ --regex-swift=/struct[ \t]+([^:\{]+).*$/\1/s/ --regex-swift=/class[ \t]+([^:\{]+).*$/\1/c/ --regex-swift=/protocol[ \t]+([^:\{]+).*$/\1/p/ --regex-swift=/enum[ \t]+([^:\{]+).*$/\1/e/ --regex-swift=/(typealias)[ \t]+([^:=]+).*$/\2/v/ #+end_src ** Exuberant ctags (older/buggy?) Install gnu global (ensure homebrew uses --with-exuberant-ctags flag). #+begin_src sh brew install global brew install ctags pip install pygments #+end_src .ctags #+begin_src fundamental --langdef=swift --langmap=swift:.swift --regex-swift=/[[:<:]]class[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/c,class/ --regex-swift=/[[:<:]]enum[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/e,enum/ --regex-swift=/[[:<:]]func[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/f,function/ --regex-swift=/[[:<:]]protocol[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/P,protocol/ --regex-swift=/[[:<:]]struct[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/s,struct/ --regex-swift=/[[:<:]]typealias[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/t,typealias/ #+end_src .globalrc #+begin_src fundamental default:\ :tc=pygments: ctags:\ :tc=exuberant-ctags: exuberant-ctags|plugin-example|setting to use Exuberant Ctags plug-in parser:\ :tc=common:\ :ctagscom=ctags:\ :ctagslib=$libdir/gtags/exuberant-ctags.la:\ :langmap=Swift\:.swift:\ :gtags_parser=Swift\:$ctagslib: pygments:\ :tc=pygments-parser: pygments-parser|Pygments plug-in parser:\ :langmap=Swift\:.swift:\ :gtags_parser=Swift\:$pygmentslib:\ :langmap=Common-Lisp\:.cl.lisp.el:\ :gtags_parser=Common-Lisp\:$pygmentslib:\ :langmap=Python\:.py.pyw.sc.tac.sage:\ :gtags_parser=Python\:$pygmentslib:\ :langmap=Ruby\:.rb.rbw.rake.gemspec.rbx.duby:\ :gtags_parser=Ruby\:$pygmentslib:\ :langmap=Objective-C++\:.mm.hh:\ :gtags_parser=Objective-C++\:$pygmentslib:\ :langmap=Objective-C\:.m.h:\ :gtags_parser=Objective-C\:$pygmentslib:\ :ctagscom=ctags:\ :pygmentslib=$libdir/gtags/pygments-parser.la:\ :tc=common: common:\ :skip=build/,HTML/,HTML.pub/,tags,TAGS,ID,y.tab.c,y.tab.h,gtags.files,cscope.files,cscope.out,cscope.po.out,cscope.in.out,SCCS/,RCS/,CVS/,CVSROOT/,{arch}/,autom4te.cache/,*.orig,*.rej,*.bak,*~,#*#,*.swp,*.tmp,*_flymake.*,*_flymake,*.o,*.a,*.so,*.lo,*.zip,*.gz,*.bz2,*.xz,*.lzh,*.Z,*.tgz,*.min.js,*min.css: #+end_src #+begin_src emacs-lisp (use-package counsel-gtags :ensure t :commands counsel-gtags-mode :bind (:map counsel-gtags-mode-map ("M-." . counsel-gtags-dwim) ("M-," . counsel-gtags-go-backward)) :hook ((swift-mode . counsel-gtags-mode) (swift-mode . ggtags-mode))) ;; Needs .ctags and .globalrc in $HOME. (use-package ggtags :ensure t :commands ggtags-mode) #+end_src Helpful references https://github.com/osdakira/dotfiles/blob/395640726d669674496a8035458840f0742e54a5/gtags.conf https://github.com/NicholasTD07/dotfiles/blob/e66eb05b408fbcb0d47994fc8a0a79bf438b9e03/.globalrc https://github.com/NicholasTD07/dotfiles/blob/master/.ctags https://github.com/sg2002/gtags.conf-tutorial/blob/master/gtags.conf https://aozsky.com/swift/swift_ide * [2019-05-29 Wed] mu4e as macOS mail composer :PROPERTIES: :CUSTOM_ID: mu4e-as-macos-mail-composer :END: Via [[https://www.reddit.com/r/emacs/comments/6lh2pp/using_emacs_as_default_mailer_on_macos][Using Emacs as Default Mailer on macOS]], a tiny script to handle mailto: links. From //Script Editor/, save following script as Application (MailOnEmacs.app). From Mail.app, /Preferences -> Default email reader/ and chosse MailOnEmacs.app. #+begin_src on open location myurl tell application "Emacs" to activate set text item delimiters to {":"} do shell script "/path/to/emacsclient --eval '(browse-url-mail \"" & myurl & "\")'" end open location #+end_src * [2019-05-26 Sun] New sudo user snippet :PROPERTIES: :CUSTOM_ID: new-sudo-user-snippet :END: I don't add linux sudoers frequently enough. Always looking it up. Keeping snippet. #+begin_src sh adduser -m -d /home/ passwd usermod -aG sudo #+end_src * [2019-05-24 Fri] Plotting ledger reports in org :PROPERTIES: :CUSTOM_ID: plotting-ledger-reports-in-org :END: ** My ledger file Save path to [[file:plotting-ledger-reports-in-org/my.ledger][my.ledger]] in /ledger-file/ block. #+begin_src org :exports src ,#+name: ledger-file ,#+begin_src emacs-lisp "my.ledger" ,#+end_src #+end_src ** gnuplot terminal (png or qt) Select gnuplot terminal. Using png to output images, but qt is handy too for interactive chart inspection. #+begin_src org :exports src Use png for inline or qt for interactive ,#+name: gnuplot-term ,#+begin_src emacs-lisp "png" ,#+end_src #+end_src ** Monthly Income and Expenses Generate income report. #+begin_src org :exports src ,#+name: income-data ,#+begin_src bash :results table :noweb yes ledger -f <<>> -j reg ^Income -M --collapse --plot-amount-format="%(format_date(date, \"%Y-%m-%d\")) %(abs(quantity(scrub(display_amount))))\n" ,#+end_src #+end_src Generate expenses report. #+begin_src org :exports src ,#+name: expenses-data ,#+begin_src sh :results table :noweb yes ledger -f <<>> -j reg ^Expenses -M --collapse ,#+end_src #+end_src Plot income vs expenses. #+begin_src gnuplot :noweb yes :var myterm=gnuplot-term income=income-data expenses=expenses-data :exports both :file monthly-income-and-expenses.png set terminal myterm size 3500,1500 set style data histogram set style histogram clustered gap 1 set style fill transparent solid 0.4 noborder set xtics nomirror scale 0 center set ytics add ('' 0) scale 0 set border 1 set grid ytics set title "Monthly Income and Expenses" set ylabel "Amount" plot income using 2:xticlabels(strftime('%b', strptime('%Y-%m-%d', strcol(1)))) title "Income" linecolor rgb "light-salmon", '' using 0:2:2 with labels left font "Courier,8" rotate by 15 offset -4,0.5 textcolor linestyle 0 notitle, expenses using 2 title "Expenses" linecolor rgb "light-green", '' using 0:2:2 with labels left font "Courier,8" rotate by 15 offset 0,0.5 textcolor linestyle 0 notitle #+end_src * [2019-05-21 Tue] Changing MAC address in org :PROPERTIES: :CUSTOM_ID: changing-mac-address-from-org-mode :END: Via Minko Gechev's [[https://twitter.com/mgechev/status/1130441471105093632?s=12][tweet]]. Saving in an org block, just because... #+begin_src sh :dir /sudo:: changeMAC() { local mac=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//') ifconfig en0 ether $mac ifconfig en0 down ifconfig en0 up echo "Your new physical address is $mac" } changeMAC #+end_src #+RESULTS: : Your new physical address is aa:36:ee:d2:ee:66 ps. Also see [[http://xenodium.com/execute-org-blocks-as-root/][Execute org blocks as root]]. * [2019-05-17 Fri] Charting bookmarks :PROPERTIES: :CUSTOM_ID: charting-bookmarks :END: - [[https://github.com/kroitor/asciichart][asciichart: Nice-looking lightweight console ASCII line charts ╭┈╯ for NodeJS and browsers with no dependencies]]. - [[https://github.com/guptarohit/asciigraph][asciigraph: Go package to make lightweight ASCII line graph]]. - [[https://github.com/mkaz/termgraph][Termgraph: a python command-line tool which draws basic graphs in the terminal]]. * [2019-05-11 Sat] Building swift-format :PROPERTIES: :CUSTOM_ID: building-swift-format :END: Trying out [[https://github.com/google/swift][Google's swift-format]]. Build with: #+begin_src sh git clone -b swift-5.2-branch https://github.com/apple/swift-format.git cd swift-format swift build #+end_src #+begin_src sh :results verbatim :exports both .build/x86_64-apple-macosx/debug/swift-format --help #+end_src #+RESULTS: #+begin_example OVERVIEW: Format or lint Swift source code. USAGE: swift-format [options] ... OPTIONS: --configuration The path to a JSON file containing the configuration of the linter/formatter. --in-place, -i Overwrite the current file when formatting ('format' mode only). --mode, -m The mode to run swift-format in. Either 'format', 'lint', or 'dump-configuration'. --recursive, -r Recursively run on '.swift' files in any provided directories. --version, -v Prints the version and exists --help Display available options POSITIONAL ARGUMENTS: filenames or paths One or more input filenames #+end_example UPDATE: Now uses swift-5.2-branch (for Xcode 11.4), according to [[https://github.com/apple/swift-format#matching-swift-format-to-your-swift-version][Matching swift-format to Your Swift Version]]. * [2019-05-06 Mon] Ledger query snippets :PROPERTIES: :CUSTOM_ID: ledger-query-snippets :END: ** Expenses paid in cash between two dates #+begin_src sh ledger -f my.ledger reg "^Expenses" and expr 'any(account=~/Assets:Cash:Wallet/)' -b 02/19 -e 04/09 #+end_src ** Bank account income between two dates #+begin_src sh ledger -f my.ledger reg "^Assets:Bank:Acme" and expr "amount > 0" -b 02/19 -e 04/09 #+end_src ** Formatting reg output #+begin_src sh ledger -f my.ledger reg "^Assets:Bank:Acme" --format="%(payee) %(amount)\n" #+end_src * [2019-05-04 Sat] Batch file renaming with counsel, find-dired, and wdired :PROPERTIES: :CUSTOM_ID: batch-renaming-with-counsel-find-dired-and-wdired :END: The first time I saw [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Wdired.html][wdired]] in action, it blew my mind. wdired makes [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html#Dired][dired]] (directory editor) buffers writeable, so you can edit them like any other Emacs buffer. You can subsequently use all your favorite file-editing tricks to rename files (amongst other things). You can see it in action at the end of [[http://emacsrocks.com/e16.html][Emacs Rocks episode 16]]. When combining [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired-and-Find.html][find-dired]] with wdired, one can easily find matching files and quickly batch rename them using something like [[https://github.com/magnars/multiple-cursors.el][multiple cursors]] or [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Keyboard-Macros.html][keyboard macros]]. I've been a fan of the /find-dired/ -> /dired-toggle-read-only/ -> /mc/mark-all-like-this/ workflow for quite some time, but I always wished I could adjust /find-dired/ queries a little quicker by getting immediate feedback. Completion frontends like [[https://github.com/abo-abo/swiper][ivy]] and [[https://github.com/emacs-helm/helm][helm]] are perfect for getting this kind of immediate feedback. Peeking into ivy's [[https://github.com/abo-abo/swiper/blob/master/counsel.el][counsel source]], I borrowed some ideas to glue counsel-style narrowing on a find command, which I can easily translate to a writeable dired buffer for all that joyful-mutiple-cursor-editing experience. #+ATTR_HTML: :width 50% :height 50% [[file:images/batch-renaming-with-counsel-find-dired-and-wdired/counsel-find.gif]] The code for /ar/counsel-find/ is a little rough but can be found at [[https://github.com/xenodium/dotsies/blob/master/emacs/ar/ar-counsel-find.el][here]]. * [2019-04-26 Fri] VPS bookmarks :PROPERTIES: :CUSTOM_ID: vps-bookmarks :END: - [[https://www.scaleway.com][Scaleway: Scalable Cloud Platform Designed for Developers]]. - [[https://www.vultr.com][Vultr]]. * [2019-04-22 Mon] Svelte bookmarks :PROPERTIES: :CUSTOM_ID: svelte-bookmarks :END: - [[https://svelte.dev/blog/svelte-3-rethinking-reactivity][Svelte 3: Rethinking reactivity]]. - [[https://svelte.dev/blog/write-less-code][Write less code (metric you're not paying attention to)]]. * [2019-04-16 Tue] Mark region, indent, restore location :PROPERTIES: :CUSTOM_ID: mark-region-indent-restore-location :END: When I'm not using an automatic code formatter (ie. clang-format, gofmt, etc.), I often find myself using Emacs region marking commands like /mark-defun/, /er/expand-region/, and /mark-whole-buffer/ prior to pressing , which is bound to /indent-for-tab-command/. This is all working as expected: the selection gets indented and the point is left in the current location. Say we have the following snippet we'd like to indent. [[file:images/mark-region-indent-restore-location/before.png]] Mark region with C-M-h (mark-defun) [[file:images/mark-region-indent-restore-location/selection.png]] Indent with (indent-for-tab-command) [[file:images/mark-region-indent-restore-location/basic-indent.png]] We're done. The selected function is now indented as expected. But... I always wished the point returned to the location prior to initiating the region-marking command, in this case /mark-defun/. In short, I wish the point had ended in the following location. [[file:images/mark-region-indent-restore-location/smart-indent.png]] I'm not aware of an existing package that helps with this, so here's a tiny minor mode (divert-mode) to help with restoring point location after indenting a region. The /diverted-events/ variable can be used to track specific region selecting commands and associate breadcrumb functions to replace the point location as needed. #+begin_src emacs-lisp ;;; diverted.el --- Identify temporary diversions and automatically ;;; move point back to original location. ;;; Commentary: ;; Automatically come back to a original location prior to diversion. ;;; Code: (require 'cl) (require 'seq) (defstruct diverted-event from ;; Initial function (eg. 'mark-defun) to ;; Follow-up function (eg. 'indent-for-tab-command) breadcrumb) (defvar diverted-events (list (make-diverted-event :from 'mark-defun :to 'indent-for-tab-command :breadcrumb (lambda () (diverted--pop-to-mark-command 2))) (make-diverted-event :from 'er/expand-region :to 'indent-for-tab-command :breadcrumb (lambda () (diverted--pop-to-mark-command 2))) (make-diverted-event :from 'mark-whole-buffer :to 'indent-for-tab-command :breadcrumb (lambda () (diverted--pop-to-mark-command 2)))) "Diversion events to look for.") (defun diverted--resolve (symbol) "Resolve SYMBOL to event." (seq-find (lambda (event) (equal symbol (diverted-event-from event))) diverted-events)) (defun diverted--pop-to-mark-command (n) "Invoke `pop-to-mark-command' N number of times." (dotimes (_ n) (pop-to-mark-command))) (defun diverted--advice-fun (orig-fun &rest r) "Get back to location prior to diversion using advice around `diverted-events' (ORIG-FUN and R)." (let ((recognized-event (diverted--resolve last-command))) (when recognized-event (funcall (diverted-event-breadcrumb recognized-event)) (message "Breadcrumbed prior to `%s'" (diverted-event-from recognized-event))))) (defun diverted-mode-enable () "Enable diverted-mode." (interactive) (diverted-mode-disable) (mapc (lambda (event) (advice-add (diverted-event-to event) :after 'diverted--advice-fun) (message "Looking for `%s' after `%s' diversions." (diverted-event-to event) (diverted-event-from event))) diverted-events) (message "diverted-mode enabled")) (defun diverted-mode-disable () "Disable diverted-mode." (interactive) (mapc (lambda (event) (advice-remove (diverted-event-to event) 'diverted--advice-fun) (message "Ignoring `%s' after `%s' diversions." (diverted-event-to event) (diverted-event-from event))) diverted-events) (message "diverted-mode disabled")) (define-minor-mode diverted-mode "Detect temporary diversions and restore point location." :init-value nil :lighter " diverted" :global t (if diverted-mode (diverted-mode-enable) (diverted-mode-disable))) (provide 'diverted) ;;; diverted.el ends here #+end_src UPDATE(2019-04-20): Source [[https://github.com/xenodium/dotsies/blob/master/emacs/ar/diverted.el][on github]]. * [2019-04-14 Sun] Wider web bookmarks :PROPERTIES: :CUSTOM_ID: wider-web-bookmarks :END: :MODIFIED: [2019-04-14 Sun] :END: - [[https://attic.city/][Attic: Search Hundreds of Small and Local Stores and Boutiques]]. - [[https://awesomelists.top/][Awesome Search]]. - [[https://indieseek.xyz/links/][Indieseek.xyz Directory]]. - [[https://millionshort.com/][Million Short - What haven't you found?]]. - [[https://pinboard.in/search/][Pinboard: social bookmarking for introverts]]. - [[https://lite.qwant.com/][Qwant Lite]]. - [[https://www.startpage.com][Startpage (claims most private seatch engine)]]. - [[http://ubu.com/][UbuWeb]]. - [[https://wiby.me/][wiby.me - the search engine for classic websites]]. - [[https://www.wikiart.org/][WikiArt.org - Visual Art Encyclopedia]]. * [2019-04-14 Sun] Compound interest calculations :PROPERTIES: :CUSTOM_ID: compound-interest-calculations :END: Saving [[https://twitter.com/tonytechwriter][Tony Bedford's]] python snippets for [[https://coffeeandcode.neocities.org/financial-calculations-1.html][calculating compound interest]]. Really just an excuse to fire up Emacs and play with org babel. #+begin_src python :results output :exports both t = 20 # years r = 0.07 # rate pv = 200000.00 # present value fv = pv * (1+r)**t # future value print("Pension of %.2f at %d%% will be worth %.2f in %d years" % (pv, 100 * r, fv, t)) #+end_src #+RESULTS: : Pension of 200000.00 at 7% will be worth 773936.89 in 20 years #+begin_src python :results output :exports both t = 20 # years r = 0.07 # rate pv = 200000.00 # present value n = 1 fv = pv * (1 + r/n)**(n*t) # future value print ("First formula calculates final value to: %.2f" % fv) fv = pv * (1 + r/n)**(n*1) # year 1 only print("Year %d: %.2f" % (1, fv)) for i in range (2, t+1): fv = fv * (1 + r/n)**(n*1) # Calculate one year at a time print("Year %d: %.2f" % (i, fv)) #+end_src #+RESULTS: #+begin_example First formula calculates final value to: 773936.89 Year 1: 214000.00 Year 2: 228980.00 Year 3: 245008.60 Year 4: 262159.20 Year 5: 280510.35 Year 6: 300146.07 Year 7: 321156.30 Year 8: 343637.24 Year 9: 367691.84 Year 10: 393430.27 Year 11: 420970.39 Year 12: 450438.32 Year 13: 481969.00 Year 14: 515706.83 Year 15: 551806.31 Year 16: 590432.75 Year 17: 631763.04 Year 18: 675986.46 Year 19: 723305.51 Year 20: 773936.89 #+end_example * [2019-04-11 Thu] Building mu/mu4e on macOS :PROPERTIES: :CUSTOM_ID: building-mumu4e-on-macos :END: I've now built Emacs's [[http://www.djcbsoftware.nl/code/mu/][mu/mu4e]] releases a handful of times on macOS. These are the steps, so I don't forget. ** 1.4 Updated steps for building [[http://www.djcbsoftware.nl/code/mu/][mu/mu4e]] 1.4: #+begin_src sh brew install gmime export CPPFLAGS="-I$(brew --prefix)/Cellar/gmime/3.2.3/include -I$(brew --prefix)/include" export LDFLAGS=-L$(brew --prefix)/Cellar/gmime/3.2.3/lib export PKG_CONFIG_PATH=$(brew --prefix)/Cellar/gmime/3.2.3/lib/pkgconfig:$(brew --prefix)/opt/libffi/lib/pkgconfig export EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs ./configure --prefix=$(~/local) make install #+end_src ** 1.2 Recently built Emacs's [[http://www.djcbsoftware.nl/code/mu/][mu/mu4e]] 1.2.0 from source on macOS. Steps: #+begin_src sh brew install gmime export CPPFLAGS=-I$(brew --prefix)/Cellar/gmime/3.2.3/include export LDFLAGS=-L$(brew --prefix)/Cellar/gmime/3.2.3/lib export PKG_CONFIG_PATH=$(brew --prefix)/Cellar/gmime/3.2.3/lib/pkgconfig:$(brew --prefix)/opt/libffi/lib/pkgconfig ./configure --prefix=$(~/local) --disable-dependency-tracking make install #+end_src UPDATE(2019-04-16): Another approach at Irreal's [[https://irreal.org/blog/?p=7976][Mu/mu4e 1.2 Available]]. * [2019-03-30 Sat] Reading spreadsheets with python/pandas :PROPERTIES: :CUSTOM_ID: reading-spreadsheets-with-pythonpandas :END: Via [[https://twitter.com/python_tip/status/1111349676106833920][Daily python tip]], a snippet to read xls files in python. This will come in handy. Saving for future. Get set up with: #+begin_src sh pip install pandas pip install xlrd #+end_src Read with: #+begin_src python :results output :exports both import pandas xlf = pandas.ExcelFile("sheet.xlsx") print xlf.sheet_names #+end_src #+RESULTS: : [u'my sheet'] * [2019-03-17 Sun] Inserting numbers with Emacs multiple cursors :PROPERTIES: :CUSTOM_ID: inserting-numbers-with-emacs-multiple-cursors :END: TIL that multiple cursor's /mc/insert-numbers/ enables you to quickly enter increasing numbers for each cursor. I have /mc/insert-numbers/ bound to # in /region-bindings-mode-map./ By default, sequence starts at 0, but invoking /mc/insert-numbers/ with prefix enables you to quickly change that. Came in handy when numbering an org table: [[file:images/inserting-numbers-with-emacs-multiple-cursors/mc-number.gif]] * [2019-03-17 Sun] Brazil travel bookmarks :PROPERTIES: :CUSTOM_ID: brazil-travel-bookmarks :END: - [[http://www.uxua.com/][UXUA Casa Hotel and Spa in Trancoso, Brazil]]. * [2019-03-17 Sun] Bath travel bookmarks :PROPERTIES: :CUSTOM_ID: bath-travel-bookmarks :END: - [[https://www.yelp.com/biz/beas-vintage-tea-rooms-bath][Beas Vintage Tea Rooms (Yelp)]]. * [2019-03-17 Sun] Half marathon training :PROPERTIES: :CUSTOM_ID: half-marathon-training :END: From https://assets.bupa.co.uk/~/media/images/healthmanagement/pdfs/half-marathon-beginner.pdf Starting from week 4: | Week | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | Sunday | |------+--------+--------------+---------------+----------+------------------------+----------+-----------------| | 4 | *Rest* | *40 mins easy* | *30 mins tempo* | *Rest* | *40 mins cross* | *Rest* | *(03/24) 60 mins* | | | | 6.7 km | 5.1 Km | | - | | - | | | | 41:51 m | 30:00 m | | | | | | | | 61.3 Kg | 60.8 Kg | | | | | |------+--------+--------------+---------------+----------+------------------------+----------+-----------------| | 5 | *Rest* | *40 mins easy* | *30 mins tempo* | *Rest* | *40 mins interval* | *Rest* | *(03/31) 11 Km* | | | | 11.9 Km | - | | 5.99 Km | | 11.0 Km | | | | 80:00 m | | | 40 m | | 60:08 m | |------+--------+--------------+---------------+----------+------------------------+----------+-----------------| | 6 | Rest | 40 mins easy | 30 mins tempo | Rest | 40 mins interval/cross | Rest | (04/07) 13 Km | | 7 | Rest | 40 mins easy | 30 mins tempo | Rest | 40 mins interval | Rest | (04/14) 60 mins | | 8 | Rest | 40 mins easy | 30 mins tempo | Rest | 50 mins interval/cross | Rest | (04/21) 16 Km | | 9 | Rest | 40 mins easy | 30 mins tempo | Rest | 50 mins interval | Rest | (04/28) 8 Km | | 10 | Rest | 40 mins easy | 30 mins tempo | Rest | 40 mins interval/cross | Rest | (05/05) 19 Km | | 11 | Rest | 40 mins easy | 30 mins tempo | Rest | 40 mins interval | Rest | (05/12) 10 Km | | 12 | Rest | 40 mins easy | 30 mins tempo | Rest | 50 mins easy | Rest | (05/19) Race | * [2019-03-16 Sat] No Emacs frame refocus on macOS :PROPERTIES: :CUSTOM_ID: no-emacs-frame-refocus-on-macos :END: This one's been bugging me for a while. On macOS, Emacs automatically focuses (raises) other frames when one is closed. #+ATTR_HTML: :width 50% :height 50% [[file:images/no-emacs-frame-refocus-on-macos/before.gif]] This has the unfortunate side-effect that I could be moved from one macOS desktop/space to another when closing an Emacs frame. Finally managed do something about it. Since I install Emacs on macOS via homebrew, a +[[https://github.com/xenodium/homebrew-emacs-plus/commit/79a8e98b222fa262746f6db620ddd1fdb151ece9][small patch on emacs-plus recipe]]+ [[https://github.com/d12frosted/homebrew-emacs-plus/pull/122/commits/71bf246930bfedb337bcc0e21587ccbbb917e5bf][small patch on emacs-plus recipe]] did the job. #+ATTR_HTML: :width 50% :height 50% [[file:images/no-emacs-frame-refocus-on-macos/after.gif]] UPDATE: Pull request [[https://github.com/d12frosted/homebrew-emacs-plus/pull/122][merged]] in d12frosted/emacs-plus. The +[[https://github.com/xenodium/homebrew-emacs-plus/commit/79a8e98b222fa262746f6db620ddd1fdb151ece9][patch]]+ [[https://github.com/d12frosted/homebrew-emacs-plus/pull/122/commits/71bf246930bfedb337bcc0e21587ccbbb917e5bf][patch]] has been merged into [[https://github.com/d12frosted/homebrew-emacs-plus][d12frosted/homebrew-emacs-plus]]. To use: #+begin_src sh brew tap d12frosted/emacs-plus brew install emacs-plus --without-spacemacs-icon --with-no-frame-refocus #+end_src Balance restored. * [2019-03-16 Sat] Checksums on linux/macOS :PROPERTIES: :CUSTOM_ID: checksums-on-linuxmacos :END: ** MD5 #+begin_src sh md5 file #+end_src ** SHA-1 #+begin_src sh shasum -a 1 file #+end_src ** SHA-256 #+begin_src sh shasum -a 256 file #+end_src * [2019-03-12 Tue] Language server protocol (LSP) bookmarks :PROPERTIES: :CUSTOM_ID: language-server-protocol-lsp-bookmarks :END: :MODIFIED: [2019-04-14 Sun] :END: - [[https://github.com/eclipse/eclipse.jdt.ls][Eclipse JDT Language Server]]. - [[https://github.com/emacs-lsp/lsp-java][Emacs Java IDE using Eclipse JDT Language Server]]. - [[https://github.com/vscode-langservers/vscode-html-languageserver-bin][vscode-html-languageserver extracted from VSCode]]. * [2019-02-24 Sun] Copy from desktop to mobile via QR code :PROPERTIES: :CUSTOM_ID: copy-from-desktop-to-mobile-via-qr-code :END: [[https://twitter.com/marcin_mbork][Marcin Borkowski]] has a nice [[http://mbork.pl/2019-02-24_Transferring_strings_to_a_phone_via_QR_codes][tip]] to quickly copy text or URLs between desktop and mobile using QR codes. Wrote a little elisp to do a similar thing using the clipboard via Emacs: #+begin_src emacs-lisp (defun ar/misc-clipboard-to-qr () "Convert text in clipboard to qrcode and display within Emacs." (interactive) (let ((temp-file (concat (temporary-file-directory) "qr-code"))) (if (eq 0 (shell-command (format "qrencode -s10 -o %s %s" temp-file (shell-quote-argument (current-kill 0))) "*qrencode*")) (switch-to-buffer (find-file-noselect temp-file t)) (error "Error: Could not create qrcode, check *qrencode* buffer")))) #+end_src #+ATTR_HTML: :width 75% :height 75% [[file:images/copy-from-desktop-to-mobile-via-qr-code/qrencode.gif]] ps. [[https://feeding.cloud.geek.nz/posts/encoding-wifi-access-point-passwords-qr-code/][Encoding your WiFi access point password into a QR code]] shows how to encode WiFi access point passwords: #+begin_src sh qrencode -o wifi.png "WIFI:T:WPA;S:;P:;;" #+end_src More comprehensively: #+begin_src sh SSID=SSID_GOES_HERE pwgen -s 63 > 00wifi.txt qrencode -o 00wifi.png "WIFI:T:WPA;S:${SSID};P:$(cat 00wifi.txt);;" #+end_src * [2019-02-19 Tue] Parsing dates in Go :PROPERTIES: :CUSTOM_ID: parsing-dates-in-go :END: Ensure the reference time ("Mon Jan 2 15:04:05 -0700 MST 2006") is used in layout string. For example: #+begin_src go :results verbatim :exports both package main import ( "fmt" "time" ) func main() { goodLayout := "January 2 2006" if t, err := time.Parse(goodLayout, "March 10 2019"); err != nil { fmt.Printf("%s\n", err) } else { fmt.Printf("%v\n", t) } badLayout := "January 2 2009" if t, err := time.Parse(badLayout, "March 10 2019"); err != nil { fmt.Printf("%s\n", err) } else { fmt.Printf("%v\n", t) } } #+end_src #+RESULTS: : 2019-03-10 00:00:00 +0000 UTC : parsing time "March 10 2019" as "January 2 2009": cannot parse "19" as "009" * [2019-02-13 Wed] Life in the UK bookmarks :PROPERTIES: :CUSTOM_ID: life-in-the-uk-bookmarks :END: :MODIFIED: [2019-02-13 Wed] :END: - [[https://textuploader.com/5yfk0]['LitUK': notes by a Redditor (TextUploader.com)]]. - [[https://lifeintheuktestweb.co.uk/][Life In The UK Test, Practice Tests 2017]]. * [2019-02-10 Sun] C language bookmarks :PROPERTIES: :CUSTOM_ID: c-language-bookmarks :END: - [[https://littlevgl.com/][LittlevGL - Open-source Embedded GUI Library]]. * [2019-02-10 Sun] Video editing bookmarks :PROPERTIES: :CUSTOM_ID: video-editing-bookmarks :END: :MODIFIED: [2020-12-31 Thu] :END: - [[https://bernd.dev/2020/04/adding-subtitles/][Adding subtitles to your videos the easy way - Bernd Verst]]. - [[https://lars.ingebrigtsen.no/2019/02/14/adventures-in-netflix/][Adventures in Netflix (screenshotting HDMI)]]. - [[https://blog.gregzaal.com/2014/05/30/camera-stabilisation-with-ffmpeg/][Camera Stabilisation with FFmpeg - Adaptive Samples]]. - [[https://www.blackmagicdesign.com/products/davinciresolve/][DaVinci Resolve 17 | Blackmagic Design]]. - [[https://www.digikam.org/news/2020-07-19-7.0.0_release_announcement/][digiKam]]. - [[https://dragonquest64.blogspot.com/2019/11/non-rectangular-video-cropping.html][Dragon Quest 64: Non-Rectangular Video Cropping]]. - [[https://superuser.com/questions/1270950/ffmpeg-how-to-achieve-a-circular-video-overlay][FFmpeg - How to achieve a circular video overlay..?]]. - [[https://github.com/mifi/lossless-cut][GitHub - mifi/lossless-cut: The swiss army knife of lossless video/audio editing]]. - [[https://github.com/moxuse/kusabi][GitHub - moxuse/Kusabi: Coding environment 3D graphics with PureScript.]]. - [[https://github.com/whyboris/Video-Hub-App][GitHub - whyboris/Video-Hub-App: Official repository for Video Hub App 2]]. - [[https://www.youtube.com/watch?v=tYytVzbPky8][HOW TO DATAMOSH: PART 1 - YouTube]]. - [[https://news.ycombinator.com/item?id=22775502][How to trim video clips instantly without reencoding | Hacker News]]. - [[http://www.linux-magazine.com/Issues/2018/206/Tutorials-FFmpeg][Inserting a Watermark with FFmpeg (Linux Magazine)]]. - [[https://news.ycombinator.com/item?id=16192813][Learn FFmpeg the hard way (Hacker News)]]. - [[https://news.ycombinator.com/item?id=21897293][Non-Rectangular Video Cropping with FFMpeg | Hacker News]]. - [[https://bernd.dev/2020/04/trim-videos-instantly/][Trim Videos Instantly - Bernd Verst]]. * [2019-02-10 Sun] Icons bookmarks :PROPERTIES: :CUSTOM_ID: icons-bookmarks :END: :MODIFIED: [2019-10-04 Fri] :END: - [[https://news.ycombinator.com/item?id=21039739][Absurd Design – Free Surrealist Illustrations and Vector Art (Hacker News)]]. - [[http://compute.vision/nouns/index.html][Find Similar Icons (using Noun Project)]]. - [[https://thenounproject.com/][Noun Project - Icons for Everything]]. - [[https://t.co/ttqvpky3Te][shape.so icons]]. - [[https://streamlineicons.com/][Streamline 3.0 – The World's Largest Icon Library]]. * [2019-01-27 Sun] Salt beef recipe :PROPERTIES: :CUSTOM_ID: salt-beef-recipe :END: [[https://www.theguardian.com/lifeandstyle/gallery/2010/nov/03/how-to-make-salt-beef][How to make salt beef]] (use 1.8kg brisket instead) and [[https://www.theguardian.com/lifeandstyle/gallery/2010/nov/03/how-to-brine-a-brisket][brining a brisket]] (celery and peppercorns) both from The Guardian were recommended by a friend. * [2019-01-27 Sun] Geneva travel bookmarks :PROPERTIES: :CUSTOM_ID: geneva-travel-bookmarks :END: - [[https://www.timeout.com/switzerland/restaurants-and-cafes/la-buvette-des-bains][La Buvette des Bains, Restaurants in Pâquis]]. * [2019-01-13 Sun] Swapping Emacs ivy collections/sources :PROPERTIES: :CUSTOM_ID: swapping-emacs-ivy-collectionssources :END: [[https://github.com/abo-abo/swiper][Ivy]] is great. I've been meaning to figure out a way to swap sources while running ivy. This would enable me to cycle through different sources using the existing search parameters. At first look, /'ivy-set-sources/ seemed like the right choice, but it's used during setup to agregate sources. Subsequent /'ivy-set-sources/ calls are ignored during an /'ivy-read/ session. There's an ivy [[https://github.com/abo-abo/swiper/issues/606][feature request]] over at github with a similar goal in mind. Although the feature is not yet supported, there's a handy suggestion to use /'ivy-quit-and-run/ to quit the current command and run a different one. With /'ivy-quit-and-run/ in mind, we can write our /'ar/ivy-read/ function to take a list of sources and add a little logic to cycle through them using a keybiding, in my case and . #+BEGIN_SRC emacs-lisp ;;; -*- lexical-binding: t; -*- (require 'cl) (cl-defstruct ar/ivy-source prompt collection action) (cl-defun ar/ivy-read (sources &key index initial-input) (let ((kmap (make-sparse-keymap)) (source)) (cl-assert (> (length sources) 0)) (when (null index) (setq index 0)) (setq source (nth index sources)) (define-key kmap (kbd "") (lambda () (interactive) (ivy-quit-and-run (ar/ivy-read sources :index (if (>= (1+ index) (length sources)) 0 (1+ index)) :initial-input ivy-text)))) (define-key kmap (kbd "") (lambda () (interactive) (ivy-quit-and-run (ar/ivy-read sources :index (if (< (1- index) 0) (1- (length sources)) (1- index)) :initial-input ivy-text)))) (ivy-read (ar/ivy-source-prompt source) (ar/ivy-source-collection source) :action (ar/ivy-source-action source) :initial-input initial-input :keymap kmap))) (defun ar/ivy-food-menu () (interactive) (ar/ivy-read (list (make-ar/ivy-source :prompt "Pizza: " :action (lambda (selection) (message "Selected pizza: %s" selection)) :collection (lambda (str pred v) (list "Bianca Neve - Mozzarella, Ricotta, Sausage, Extra Virgin Olive Oil, Basil" "Boscaiola - Mozzarella, Tomato Sauce, Sausage, Mushrooms, Extra Virgin Olive Oil, Basil" "Calzone - Ricotta, Ham, Mushrooms, Artichokes. Topped with Tomato Sauce and Extra Virgin Olive Oil." "Capricciosa - Mozzarella,Tomato Sauce, Prosciutto Cotto Ham, Mushrooms, Artichokes, Extra Virgin Olive Oil." "Carciofi - Mozzarella, Tomato Sauce, Artichokes, Extra Virgin Olive Oil, Basil." "Diavola - Mozzarella, Tomato Sauce, Spicy Salami, Extra Virgin Olive Oil, Basil." "Funghi - Mozzarella, Tomato Sauce, Mushrooms, Extra Virgin Olive Oil, Basil."))) (make-ar/ivy-source :prompt "Tacos: " :action (lambda (selection) (message "Selected taco: %s" selection)) :collection (lambda (str pred v) (list "Pork pibil - Slow cooked in citrus & spices, with pink pickled onions." "Grilled chicken & avocado - Ancho rub, guacamole & green tomatillo salsa." "Plantain - Sweet & spicy chipotle & crumbled feta." "Poblano pepper - Caramelised onions, corn & cashew nut mole." "Buttermilk chicken - Served crispy fried with habanero & white onion relish & spiced mayo." "Sustainable battered cod - mSC certified cod with shredded slaw, chipotle mayo & pickled cucumber." "Chargrilled steak - Avocado & chipotle salsas."))) (make-ar/ivy-source :prompt "Burgers: " :action (lambda (selection) (message "Selected burger: %s" selection)) :collection (lambda (str pred v) (list "The cheese - Aged beef patty with american cheese, gherkins, ketchup & mustard." "The yeah! - Aged beef patty with american cheese, gherkins, yeah! sauce & salad." "The yfc or hot yfc - Crispy chicken with lime or chipotle crema, lettuce, pickled onion & slaw." "The rancher - Grilled chicken with ranch dressing, bacon & salad." "The bubbah - Aged beef patty with smokey aubergine, pickled red cabbage, lettuce, roast toms, onions & cheddar." "The bulgogi - Sesame-spiced beef patty with miso mayo, pickled radish, onion, cucumber & spring onion." "The summer - Aged beef patty with sriracha mayo, lettuce, onion, toms, avo, cheddar & bacon.")))))) #+END_SRC #+ATTR_HTML: :width 75% :height 75% [[file:images/swapping-emacs-ivy-collectionssources/ivy-cycle-sources.gif]] ps. Menu data from [[https://starofkings.co.uk/food-and-drink/][Star of Kings]], [[https://www.wahaca.co.uk/menu/food/][Wahaca]], and [[https://pizzarino.us/menu][Pizzarino]]. * [2019-01-12 Sat] Podcast bookmarks :PROPERTIES: :CUSTOM_ID: podcast-bookmarks :END: :MODIFIED: [2019-01-12 Sat] :END: - [[https://destinationlinux.org/][Destination Linux. A conversational podcast by people who love running Linux.]]. - [[https://emacscast.org/][EmacsCast]]. - [[http://faif.us/][Free as in Freedom]]. - [[http://gnuworldorder.info/][Gnu World Order]]. - [[https://latenightlinux.com/][Late Night Linux]]. - [[https://librelounge.org/][Libre Lounge]]. - [[https://linuxlads.com/][Linux Lads Podcast]]. - [[https://www.thebinarytimes.net/][The Binary Times Podcast (Linux/free software/hardware/culture)]]. - [[http://ubuntupodcast.org/][Ubuntu Podcast]]. * [2019-01-12 Sat] Emacs on macOS Mojave :PROPERTIES: :CUSTOM_ID: emacs-on-macos-mojave :END: Had issues running Emacs on macOS Mojave (blank unresponsive screen). Bleeding edge emacs-plus did the job: #+BEGIN_SRC sh brew tap d12frosted/emacs-plus brew install emacs-plus --without-spacemacs-icon --HEAD #+END_SRC #+BEGIN_SRC sh :results verbatim :exports both brew info emacs-plus #+END_SRC #+RESULTS: #+begin_example d12frosted/emacs-plus/emacs-plus: stable 26.1, devel 26.1-rc1, HEAD GNU Emacs text editor https://www.gnu.org/software/emacs/ /Users/some-user/homebrew/Cellar/emacs-plus/HEAD-8fe21b0 (3,985 files, 123.0MB) * Built from source on 2019-01-12 at 09:26:09 with: --without-spacemacs-icon From: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/Formula/emacs-plus.rb ==> Dependencies Build: pkg-config Recommended: little-cms2, gnutls, librsvg, imagemagick@6 Optional: dbus, mailutils ==> Requirements Optional: x11 ==> Options --with-ctags Don't remove the ctags executable that Emacs provides --with-dbus Build with dbus support --with-emacs-icons-project-EmacsIcon1 Using Emacs icon project EmacsIcon1 --with-emacs-icons-project-EmacsIcon2 Using Emacs icon project EmacsIcon2 --with-emacs-icons-project-EmacsIcon3 Using Emacs icon project EmacsIcon3 --with-emacs-icons-project-EmacsIcon4 Using Emacs icon project EmacsIcon4 --with-emacs-icons-project-EmacsIcon5 Using Emacs icon project EmacsIcon5 --with-emacs-icons-project-EmacsIcon6 Using Emacs icon project EmacsIcon6 --with-emacs-icons-project-EmacsIcon7 Using Emacs icon project EmacsIcon7 --with-emacs-icons-project-EmacsIcon8 Using Emacs icon project EmacsIcon8 --with-emacs-icons-project-EmacsIcon9 Using Emacs icon project EmacsIcon9 --with-emacs-icons-project-emacs-card-blue-deep Using Emacs icon project emacs-card-blue-deep --with-emacs-icons-project-emacs-card-british-racing-green Using Emacs icon project emacs-card-british-racing-green --with-emacs-icons-project-emacs-card-carmine Using Emacs icon project emacs-card-carmine --with-emacs-icons-project-emacs-card-green Using Emacs icon project emacs-card-green --with-mailutils Build with mailutils support --with-modern-icon Using a modern style Emacs icon by @tpanum --with-no-titlebar Experimental: build without titlebar --with-pdumper Experimental: build from pdumper branch and with increasedremembered_data size (--HEAD only) --with-x11 Experimental: build with x11 support --with-xwidgets Experimental: build with xwidgets support (--HEAD only) --without-cocoa Build a non-Cocoa version of Emacs --without-gnutls Build without gnutls support --without-imagemagick@6 Build without imagemagick@6 support --without-librsvg Build without librsvg support --without-libxml2 Build without libxml2 support --without-little-cms2 Build without little-cms2 support --without-modules Build without dynamic modules support --without-multicolor-fonts Build without a patch that enables multicolor font support --without-spacemacs-icon Build without Spacemacs icon by Nasser Alshammari --devel Install development version 26.1-rc1 --HEAD Install HEAD version ==> Caveats Emacs.app was installed to: /Users/some-user/homebrew/Cellar/emacs-plus/26.1 To link the application to default Homebrew App location: brew linkapps or: ln -s /Users/some-user/homebrew/Cellar/emacs-plus/26.1/Emacs.app /Applications --natural-title-bar option was removed from this formula, in order to duplicate its effect add following line to your init.el file (add-to-list 'default-frame-alist '(ns-transparent-titlebar . t)) (add-to-list 'default-frame-alist '(ns-appearance . dark)) or: (add-to-list 'default-frame-alist '(ns-transparent-titlebar . t)) (add-to-list 'default-frame-alist '(ns-appearance . light)) If you are using macOS Mojave, please note that most of the experimental options are forbidden on Mojave. This is temporary decision. To have launchd start d12frosted/emacs-plus/emacs-plus now and restart at login: brew services start d12frosted/emacs-plus/emacs-plus Or, if you don't want/need a background service you can just run: emacs #+end_example * [2019-01-06 Sun] Trying out Emacs pdf tools :PROPERTIES: :CUSTOM_ID: trying-out-emacs-pdf-tools :END: Late to the party, giving [[https://github.com/politza/pdf-tools][pdf-tools]] a try. The [[https://github.com/politza/pdf-tools#compiling-on-os-x][macOS install instructions]] have a prerequisite: #+BEGIN_SRC sh brew install poppler automake #+END_SRC Installed with: #+BEGIN_SRC emacs-lisp (use-package pdf-tools :ensure t :mode ("\\.pdf\\'" . pdf-view-mode) :config (pdf-tools-install) (setq-default pdf-view-display-size 'fit-page) (setq pdf-annot-activate-created-annotations t)) #+END_SRC #+ATTR_HTML: :width 75% :height 75% [[file:images/trying-out-emacs-pdf-tools/pdf-tools.png]] ps. (pdf-tools-install) may not find libffi on macOS. Try: #+begin_src emacs-lisp (setenv "PKG_CONFIG_PATH" (f-join (file-name-as-directory (nth 0 (split-string (shell-command-to-string "brew --prefix")))) "Cellar" "libffi" "3.2.1" "lib" "pkgconfig")) #+end_src * [2018-12-27 Thu] ASCII art generator bookmarks :PROPERTIES: :CUSTOM_ID: ascii-art-generator-bookmarks :END: - [[http://antglove.com/erger/][𝓔𝓻𝓰𝓮𝓻𝓪𝓽𝓸𝓻/Ergerator (ascii generator)]]. * [2018-12-26 Wed] Osaka travel bookmarks :PROPERTIES: :CUSTOM_ID: osaka-travel-bookmarks :END: - [[https://www.tripadvisor.com/Attraction_Review-g298566-d1195795-Reviews-Tsutenkaku-Osaka_Osaka_Prefecture_Kinki.html][Tsutenkaku (Osaka) - 2018 All You Need to Know BEFORE You Go (with Photos) - TripAdvisor]]. * [2018-12-25 Tue] Using OCR to create searchable pdfs from images :PROPERTIES: :CUSTOM_ID: using-ocr-to-create-searchable-pdfs-from-images :END: Used my phone to take a handful of photos of an article from a magazine. Wanted to convert the images to a searchable pdf on macOS. This was straightforward, having [[http://xenodium.com/trying-out-tesseract][already installed tesseract]]. #+BEGIN_SRC sh for i in IMG_3*.jpg; do echo $i; tesseract $i $(basename $i .tif) pdf; done #+END_SRC Should now have a handful of OCR'd pdfs: #+BEGIN_SRC sh :results verbatim :exports both ls *.jpg.pdf #+END_SRC #+RESULTS: : IMG_3104.jpg.pdf : IMG_3105.jpg.pdf : IMG_3106.jpg.pdf : IMG_3107.jpg.pdf Finally, join all pdfs into one. Turns out macOS has a handy python script already installed. We can use it as: #+BEGIN_SRC sh /usr/bin/python "/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py" -o joined.pdf IMG_*pdf #+END_SRC ps. [[https://pdfgrep.org][pdfgrep]] is great for searching pdfs. ** Useful references - [[https://ryanfb.github.io/etc/2014/11/13/command_line_ocr_on_mac_os_x.html][Ryan Baumann's: Command-Line OCR with Tesseract on Mac OS X]]. * [2018-12-25 Tue] Audiobook providers bookmarks :PROPERTIES: :CUSTOM_ID: audiobook-providers-bookmarks :END: :MODIFIED: [2020-01-26 Sun] :END: - [[http://www.openculture.com/freeaudiobooks][1,000 Free Audio Books: Download Great Books for Free | Open Culture]]. - [[http://bbcsfx.acropolis.org.uk/][BBC Sound Effects Archive Resource • Research & Education Space]]. - [[https://libro.fm/][Libro.fm (Libro.fm, Your Independent Bookstore for Digital Audiobooks)]]. - [[https://www.thegreatcourses.co.uk/][Online Courses & Lectures for Home Study and Lifelong Learning]]. - [[http://www.openculture.com/][The best free cultural and educational media on the web (Open Culture)]]. * [2018-12-25 Tue] Cookbook bookmarks :PROPERTIES: :CUSTOM_ID: cookbook-bookmarks :END: :MODIFIED: [2018-12-25 Tue] :END: - [[https://www.nancysingletonhachisu.com/the-attic-loft/][Japan: The Cookbook (Nancy Singleton Hachisu)]]. - [[https://www.nancysingletonhachisu.com/the-woodhouse/][Japanese Farm Food (Nancy Singleton Hachisu)]]. - [[https://www.nancysingletonhachisu.com/the-country-annex/][Preserving the Japanese Way (Nancy Singleton Hachisu)]]. * [2018-12-25 Tue] Emailing pdfs to kindle from mu4e :PROPERTIES: :CUSTOM_ID: emailing-pdfs-to-kindle-from-mu4e :END: Wanted to send a pdf to my kindle for some holiday reading. You can easily do this by emailing the pdf to your kindle-bound email address. Now, I typically attach files when composing mu4e emails by using /mml-attach-file/, which attaches the file using /<#part>...<#/part>/. However, the Amazon service did not find the attached pdf, so no pdf was added to my Kindle. Fortunately, I found a handy [[https://www.reddit.com/r/emacs/comments/97abs7/anyone_uses_mu4e_to_send_mobi_files_to_kindle][Reddit thread, leding me to a working solution]]. Wrapping the part using /<#multipart type=mixed>...<#/multipart>/ did the job, using /mml-insert-multipart/, followed by /mml-attach-file/. Resulting attachment should look something like: #+BEGIN_EXAMPLE <#multipart type=mixed> <#part type="application/pdf" filename="/path/to/file.pdf" disposition=attachment> <#/part> <#/multipart> #+END_EXAMPLE I should add a convenience elisp function for this, but that's for another time... * [2018-12-21 Fri] org tip: convert csv to table :PROPERTIES: :CUSTOM_ID: org-tip-convert-csv-to-table :END: Needed to import some csv data to an org table. Turns out org's got you covered out of the box with /M-x org-table-create-or-convert-from-region/ bound to /C-c |/. #+ATTR_HTML: :width 75% :height 75% [[file:images/org-tip-convert-csv-to-table/csv-to-org-table.gif]] * [2018-12-20 Thu] Sponsoring platform bookmarks :PROPERTIES: :CUSTOM_ID: sponsoring-platform-bookmarks :END: :MODIFIED: [2018-12-25 Tue] :END: - [[https://www.patreon.com/][Best way for artists and creators to get sustainable income and connect with fans (Patreon)]]. - [[https://www.buymeacoffee.com/][Buy Me A Coffee — A free, fast and beautiful way for creators to monetise their content]]. - [[https://tallyco.in/][Tallycoin is a Bitcoin fundraising platform and a Patreon alternative.]]. * [2018-12-20 Thu] Artistic/creative bookmarks :PROPERTIES: :CUSTOM_ID: artisticcreative-bookmarks :END: :MODIFIED: [2020-09-22 Tue] :END: - [[https://www.deviantart.com/boxtail/gallery/][BoxTail fractals (DeviantArt Gallery)]]. - [[https://en.wikipedia.org/wiki/Fermat%27s_spiral][Fermat's spiral - Wikipedia]]. - [[https://lostartpress.com/][Lost Art Press (woodworking books)]]. - [[https://www.tomsachs.org][Tom Sachs (knolling exhibits)]]. * [2018-12-20 Thu] Marketing bookmarks :PROPERTIES: :CUSTOM_ID: marketing-bookmarks :END: :MODIFIED: [2020-05-25 Mon] :END: - [[https://news.ycombinator.com/item?id=23289185][Product Marketing for Engineers | Hacker News]]. - [[https://www.launchaco.com/][Startup Website Builder - Launchaco]]. * [2018-12-19 Wed] Bluetooth low energy (BLE) bookmarks :PROPERTIES: :CUSTOM_ID: bluetooth-low-energy-ble-bookmarks :END: :MODIFIED: [2020-05-09 Sat] :END: - [[http://www.frederikseiffert.de/blueutil/][blueutil » Command-Line Control of Bluetooth on the Mac]]. - [[https://news.ycombinator.com/item?id=18704182][The Practical Guide to Hacking Bluetooth Low Energy (Hacker News)]]. - [[https://blog.attify.com/the-practical-guide-to-hacking-bluetooth-low-energy/][The Practical Guide to Hacking Bluetooth Low Energy]]. * [2018-12-18 Tue] Fun project bookmarks :PROPERTIES: :CUSTOM_ID: fun-project-bookmarks :END: - [[https://www.designboom.com/art/echo-yang-programs-everyday-obsolete-machines-to-create-autonomous-art-02-28-2014/?mc_cid=31214c131d&mc_eid=add1859a90][echo yang programs everyday obsolete machines to create autonomous art (designboom)]]. * [2018-12-14 Fri] Snowboarding bookmarks :PROPERTIES: :CUSTOM_ID: snowboarding-bookmarks :END: - [[https://news.ycombinator.com/item?id=18680617][Snowboarding for Geeks (Hacker News)]]. * [2018-12-11 Tue] Scam bookmarks :PROPERTIES: :CUSTOM_ID: scam-bookmarks :END: :MODIFIED: [2018-12-11 Tue] :END: - [[https://www.419eater.com/][419 Eater - The largest scambaiting community on the planet!]]. - [[https://news.ycombinator.com/item?id=18577734][The little black book of scams (2016) (Hacker News)]]. - [[https://www.accc.gov.au/publications/the-little-black-book-of-scams][The little black book of scams (ACCC)]]. * [2018-12-11 Tue] Passive income bookmarks :PROPERTIES: :CUSTOM_ID: passive-income-bookmarks :END: :MODIFIED: [2019-10-13 Sun] :END: - [[https://www.redbubble.com][Awesome products designed by independent artists (Redbubble)]]. - [[https://kit.com/pjrvs/gear-for-recording-videos-and-doing-interviews][Kit (Paul Jarvi's recording gear)]]. - [[https://www.reddit.com/r/AmazonMerch/][Merch By Amazon Discussion (Reddit)]]. - [[https://teespring.com/][Teespring]]. - [[https://thesavingninja.com/what-is-merch-by-amazon/][What is Merch By Amazon?]]. * [2018-12-08 Sat] DWIM ivy quit :PROPERTIES: :CUSTOM_ID: dwim-ivy-quit :END: "Do-what-I-mean" (DWIM) functions enable us to introduce new Emacs powers to existing workflows without incurring the typical cost of remembering multiple related functions or introducing yet another key binding. DWIM functions invoke other functions, based on current context. I wanted a small tweak in Ivy's /`minibuffer-keyboard-quit'/ invocation, commonly invoked via /C-g/ key binding: 1. If we have text selected in minibuffer, deselect it. 2. If we have any text in minibuffer, clear it. 3. If no text in minibuffer, quit. Added /`ar/ivy-keyboard-quit-dwim'/ for this purpose. Binding it to C-g in /ivy-minibuffer-map/: #+BEGIN_SRC emacs-lisp (use-package ivy :ensure t :bind (:map ivy-minibuffer-map ("C-g" . ar/ivy-keyboard-quit-dwim)) :config (defun ar/ivy-keyboard-quit-dwim () "If region active, deactivate. If there's content, clear the minibuffer. Otherwise quit." (interactive) (cond ((and delete-selection-mode (region-active-p)) (setq deactivate-mark t)) ((> (length ivy-text) 0) (delete-minibuffer-contents)) (t (minibuffer-keyboard-quit))))) #+END_SRC #+ATTR_HTML: :width 75% :height 75% [[file:images/dwim-ivy-quit/ivy-keybqoard-quit-dwim.gif]] * [2018-12-05 Wed] Diffing directories content size :PROPERTIES: :CUSTOM_ID: diffing-directories-content-size :END: Needed to diff two directories, but only interested in file size changes. diff, find, sort, and stat seem to do the job: #+BEGIN_SRC sh :results verbatim :exports both diff <(find dir1 -type f -exec stat -f '%N %z' '{}' \; | sort) <(find dir2 -type f -exec stat -f '%N %z' '{}' \; | sort) #+END_SRC #+RESULTS: #+begin_example 1,3c1,2 < dir1/one.txt 14 < dir1/subdir/file.txt 5 < dir1/three.txt 7 --- > dir2/one.txt 19 > dir2/two.txt 0 #+end_example /Note: Using diff, find, sort, and stat on macOS./ ** Update 1 I've since learned about mtree (thanks [[https://twitter.com/romanzolotarev/status/1070249301815771137][Roman]]!). A nice utility to add to the toolbox. #+BEGIN_SRC sh mtree -p emacs-25.1 -c -k size -d #+END_SRC #+RESULTS: #+begin_example # user: me # machine: my-machine # tree: /path/to/emacs-25.1 # date: Wed Dec 5 22:21:07 2018 # . /set type=dir . size=1152 # ./admin admin size=960 # ./admin/charsets charsets size=544 # ./admin/charsets/glibc glibc size=3392 # ./admin/charsets/glibc .. # ./admin/charsets/mapfiles mapfiles size=640 # ./admin/charsets/mapfiles .. #+end_example ** Update 2 I've added Emacs ediff to the mix: #+BEGIN_SRC emacs-lisp (require 'f) (defun ar/ediff-dir-content-size () "Diff all subdirectories (sizes only) in two directories." (interactive) (let* ((dir1-path (read-directory-name "Dir 1: ")) (dir2-path (read-directory-name "Dir 2: ")) (buf1 (get-buffer-create (format "*Dir 1 (%s)*" (f-base dir1-path)))) (buf2 (get-buffer-create (format "*Dir 2 (%s)*" (f-base dir2-path))))) (with-current-buffer buf1 (erase-buffer)) (with-current-buffer buf2 (erase-buffer)) (shell-command (format "cd %s; find . -type d | sort | du -h" dir1-path) buf1) (shell-command (format "cd %s; find . -type d | sort | du -h" dir2-path) buf2) (ediff-buffers buf1 buf2))) #+END_SRC #+ATTR_HTML: :width 75% :height 75% [[file:images/diffing-directories-content-size/ediff-dir-content-size.png]] * [2018-12-02 Sun] Swift nil-coalescing operator :PROPERTIES: :CUSTOM_ID: swift-nil-coalescing-operator :END: [[https://twitter.com/twostraws][Paul Hudson]], over at [[https://www.hackingwithswift.com/][Hacking with Swift]], has written [[https://www.hackingwithswift.com/articles/136/the-complete-guide-to-optionals-in-swift][The Complete Guide to Optionals in Swift]]. One of the many highlights is the [[https://docs.swift.org/swift-book/LanguageGuide/BasicOperators.html#ID72][nil-coalescing operator]]. If you're a fan of the [[https://en.wikipedia.org/wiki/Ternary_operation][C-like syntax in ternary operations]], you'd enjoy chaining with Swift's nil-coalescing operator: #+BEGIN_SRC swift let players = [ "goose": "run!" ] let move = players["duck1"] ?? players["duck2"] ?? players["duck3"] ?? players["goose"] print("\(String(describing: move))") #+END_SRC #+RESULTS: : Optional("run!") ps. Swift snippet run on Emacs [[https://orgmode.org/worg/org-contrib/babel/intro.html][org babel's]] [[https://github.com/zweifisch/ob-swift][ob-swift]]. See [[#multiline-swift-strings][Multiline Swift strings]] for details. * [2018-12-01 Sat] Ocado vs Asda (org table) :PROPERTIES: :CUSTOM_ID: ocado-vs-asda-org-table :END: Someone handed me an [[https://www.ocado.com][Ocado]] shopping voucher for 30% off. Sounded promising, even for a one-off. With my [[https://www.amazon.co.uk/Transforming-Relationship-Achieving-Financial-Independence/dp/0143115766/][Money or Your Life]] hat on, I took a closer look for potential savings. Results were disappointing, when compared to alternatives like Asda. Here's a table comparing Ocado (30% off) and Asda (no discount): |-------------------------------------------------------------+--------+--------| | | Ocado | Asda | |-------------------------------------------------------------+--------+--------| | [[https://www.ocado.com/webshop/product/Coconut-Merchant-Organic-Raw-Extra-Virgin-Coconut-Oil/372144011][Coconut Merchant Organic Raw Extra Virgin Coconut Oil 500ml]] | 6.74 | | | [[https://groceries.asda.com/product/oils/ktc-coconut-hair-oil/910000033621][KTC 100% pure coconut oil]] | | 2.00 | | [[https://www.ocado.com/webshop/product/Waitrose-Love-Life-Popcorn-Maize/25130011][Waitrose Love Life Popcorn Maize 510g]] | 1.50 | | | [[https://groceries.asda.com/promotion/2-for-pound-1.50/ls89129][Cypressa Popping Corn 2x500g = 1000g]] | | 1.50 | | [[https://www.ocado.com/webshop/product/Whitworths-Ground-Almonds/275684011][Whitworths Ground Almonds]] | 2.00 | | | [[https://groceries.asda.com/product/baking-nuts-seeds-fruit/whitworths-ground-almonds/910000797981][Whitworths Ground Almonds]] | | 1.60 | |-------------------------------------------------------------+--------+--------| | Total | | £ 5.10 | |-------------------------------------------------------------+--------+--------| | -30% | £ 7.17 | | |-------------------------------------------------------------+--------+--------| #+TBLFM: @8$3=vsum(@2$3..@7$3);£ %.2f::@9$2=vsum(@2$2..@7$2) * 0.7;£ %.2f On the upside, Ocado has plenty of items I cannot find at Asda. May be a good opportunity to get these items at a discount. ** Emacs org tables Small tables are the perfect use-case for Emacs [[https://orgmode.org/manual/Tables.html][org-mode tables]]. Been a while since I used one, so great timing for a little refresh. Here's the org source for the table above (prior to exporting to HTML): #+BEGIN_SRC org :exports src |-------------------------------------------------------------+--------+--------| | | Ocado | Asda | |-------------------------------------------------------------+--------+--------| | [[https://www.ocado.com/webshop/product/Coconut-Merchant-Organic-Raw-Extra-Virgin-Coconut-Oil/372144011][Coconut Merchant Organic Raw Extra Virgin Coconut Oil 500ml]] | 6.74 | | | [[https://groceries.asda.com/product/oils/ktc-coconut-hair-oil/910000033621][KTC 100% pure coconut oil]] | | 2.00 | | [[https://www.ocado.com/webshop/product/Waitrose-Love-Life-Popcorn-Maize/25130011][Waitrose Love Life Popcorn Maize 510g]] | 1.50 | | | [[https://groceries.asda.com/promotion/2-for-pound-1.50/ls89129][Cypressa Popping Corn 2x500g = 1000g]] | | 1.50 | | [[https://www.ocado.com/webshop/product/Whitworths-Ground-Almonds/275684011][Whitworths Ground Almonds]] | 2.00 | | | [[https://groceries.asda.com/product/baking-nuts-seeds-fruit/whitworths-ground-almonds/910000797981][Whitworths Ground Almonds]] | | 1.60 | |-------------------------------------------------------------+--------+--------| | Total | | £ 5.10 | |-------------------------------------------------------------+--------+--------| | -30% | £ 7.17 | | |-------------------------------------------------------------+--------+--------| ,#+TBLFM: @8$3=vsum(@2$3..@7$3);£ %.2f::@9$2=vsum(@2$2..@7$2) * 0.7;£ %.2f #+END_SRC * [2018-11-24 Sat] Execute org blocks as root :PROPERTIES: :CUSTOM_ID: execute-org-blocks-as-root :END: Been saving admin code snippets in my own [[https://orgmode.org/manual/Working-with-source-code.html][org source blocks]], some requiring root access. Handy for keeping tiny self-documented scripts to easily bootstrap other machines. TIL org source block's /:dir/ argument can be used to run block as root by using tramp syntax: /:dir /sudo::/ #+BEGIN_SRC org :exports src As user: ,#+BEGIN_SRC sh whoami ,#+END_SRC ,#+RESULTS: : user As root: ,#+BEGIN_SRC sh :dir /sudo:: whoami ,#+END_SRC ,#+RESULTS: : root #+END_SRC * [2018-11-23 Fri] Inline Swift computed properties :PROPERTIES: :CUSTOM_ID: inline-swift-computed-properties :END: Via [[https://twitter.com/objcio][objc.io]] and [[https://twitter.com/mxcl][Max Howell's]] [[https://twitter.com/mxcl/status/1065802821700857856][retweet]], TIL about Swift's inline computed properties. Another one to try on Org [[https://orgmode.org/worg/org-contrib/babel/intro.html][Babel]]. ‏ #+BEGIN_SRC swift func greetWorld() { var message = "hello" var betterMessage: String { return "\(message) world" } print(betterMessage) } greetWorld() #+END_SRC #+RESULTS: : hello world * [2018-11-23 Fri] Multiline Swift strings :PROPERTIES: :CUSTOM_ID: multiline-swift-strings :END: [[https://twitter.com/twostraws][Paul Hudson's]] [[https://twitter.com/twostraws][tweet]] introduced me to Swift's multiline string indentation control using closing quotes. Neat! Being an org-mode fan, I thought I'd give Swift multiline strings a try using Org [[https://orgmode.org/worg/org-contrib/babel/intro.html][Babel's]] [[https://github.com/zweifisch/ob-swift][ob-swift]]. I get to verify it and document at the same time. Win. Swift org mode source blocks (ie. BEGIN_SRC/END_SRC) can be added as follows: #+BEGIN_SRC org :exports src ,#+BEGIN_SRC swift :exports both print(""" Hello World """) print(""" Hello World """) ,#+END_SRC ,#+RESULTS: : Hello World : Hello World #+END_SRC By pressing /C-c C-c/ anywhere in the code block, the snippet is executed and its output captured in the /RESULT/ block. Super handy for quickly trying out snippets and keeping as future reference. As a bonus, the above blocks can be exported to HTML ([[https://orgmode.org/manual/Exporting.html][amongst other formats]]). With some [[https://github.com/xenodium/dotsies/search?q=org-html-head-extra&unscoped_q=org-html-head-extra][styling]], it looks as follows: #+BEGIN_SRC swift :exports both print(""" Hello World """) print(""" Hello World """) #+END_SRC #+RESULTS: : Hello World : Hello World * [2018-11-17 Sat] Quickly swapping elfeed filters :PROPERTIES: :CUSTOM_ID: quickly-swapping-elfeed-filters :END: I seem to be more efficient in getting through rss feeds by individually browsing through related content. That is, I can get through all Emacs entries a lot faster if I look at Emacs content exclusively, instead of mixing with say BBC news. [[https://github.com/skeeto/elfeed][Elfeed]] filters are great for filtering related content. I wanted a way to easily switch through my typical categories of related content by quickly changing elfeed filters using a completion framework. Emacs's [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Minibuffer-Completion.html][completing-read]] plays nicely with your favorite completing framework (mine is [[https://github.com/abo-abo/swiper][ivy]]). With a couple of functions, we can get Emacs to ask us for the filtering category using human-readable options and quickly presenting related content. Binding the new functionality to is working well for me. #+BEGIN_SRC emacs-lisp (use-package elfeed :ensure t :commands elfeed :bind (:map elfeed-search-mode-map ("" . ar/elfeed-completing-filter)) :config (defun ar/elfeed-filter-results-count (search-filter) "Count results for SEARCH-FILTER." (let* ((filter (elfeed-search-parse-filter search-filter)) (head (list nil)) (tail head) (count 0)) (let ((lexical-binding t) (func (byte-compile (elfeed-search-compile-filter filter)))) (with-elfeed-db-visit (entry feed) (when (funcall func entry feed count) (setf (cdr tail) (list entry) tail (cdr tail) count (1+ count))))) count)) (defun ar/elfeed-completing-filter () "Completing filter." (interactive) (let ((categories (-filter (lambda (item) (> (ar/elfeed-filter-results-count (cdr item)) 0)) '(("All" . "@6-months-ago +unread") ("BBC" . "@6-months-ago +unread +bbc") ("Dev" . "@6-months-ago +unread +dev") ("Emacs" . "@6-months-ago +unread +emacs") ("Health" . "@6-months-ago +unread +health") ("Hacker News" . "@6-months-ago +unread +hackernews") ("iOS" . "@6-months-ago +unread +ios") ("Money" . "@6-months-ago +unread +money"))))) (if (> (length categories) 0) (progn (ar/elfeed-view-filtered (cdr (assoc (completing-read "Categories: " categories) categories))) (goto-char (window-start))) (message "All caught up \\o/"))))) #+END_SRC #+ATTR_HTML: :width 75% :height 75% [[file:images/quickly-swapping-elfeed-filters/completing-elfeed.gif]] We don't actually need two functions, but /ar/elfeed-filter-results-count/ enables us to list only those feeds that actually have new content. The list will shrink as we get through our content. When no content is left, we get a little celebratory message. #+ATTR_HTML: :width 75% :height 75% [[file:images/quickly-swapping-elfeed-filters/no-left.png]] * [2018-11-14 Wed] Converting docx to pdf on macOS :PROPERTIES: :CUSTOM_ID: converting-docx-to-pdf-on-macos :END: Wanted to convert a docx document to pdf on macOS. Pandoc to the rescue, but first needed pdflatex installed: #+BEGIN_SRC sh :results verbatim :exports both pandoc -t latex some.docx -o some.pdf #+END_SRC #+RESULTS: : pdflatex not found. Please select a different --pdf-engine or install pdflatex Installed pdflatex on macOS with: #+BEGIN_SRC sh brew install mactex #+END_SRC Can also use HTML5. Install wkhtmltopdf with: #+BEGIN_SRC sh brew install Caskroom/cask/wkhtmltopdf #+END_SRC Convert with: #+BEGIN_SRC sh pandoc -t html5 some.docx -o some.pdf #+END_SRC * [2018-11-13 Tue] Faster elfeed browsing with paging :PROPERTIES: :CUSTOM_ID: faster-elfeed-browsing-with-paging :END: Following up from [[http://xenodium.com/#faster-junk-mail-deletion-with-mu4e][faster junk mail deletion with mu4e]], elfeed is another candidate for enabling actions on pages. In this case, marking rss entries as read, page by Page. If on [[https://github.com/jwiegley/use-package][use-package]], the function can defined and bound to the "v" key using: #+BEGIN_SRC emacs-lisp (use-package elfeed :ensure t :bind (:map elfeed-search-mode-map ("v" . ar/elfeed-mark-visible-as-read)) :config (defun ar/elfeed-mark-visible-as-read () (interactive) (require 'window-end-visible) (set-mark (window-start)) (goto-char (window-end-visible)) (activate-mark) (elfeed-search-untag-all-unread) (elfeed-search-update--force) (deactivate-mark) (goto-char (window-start)))) #+END_SRC #+ATTR_HTML: :width 75% :height 75% [[file:images/faster-elfeed-browsing-with-paging/elfeed-read-by-page.gif]] * [2018-11-10 Sat] Faster junk mail deletion with mu4e :PROPERTIES: :CUSTOM_ID: faster-junk-mail-deletion-with-mu4e :END: It's been roughly 5 months since [[http://xenodium.com/#trying-out-mu4e-and-offlineimap][my mu4e email migration]]. Happy with my choice. [[http://www.djcbsoftware.nl/code/mu/mu4e.html][Mu4e]] is awesome. I now have 4 email accounts managed by mu4e, and unfortunately receiving lots of junk mail. I regularly peek at junk folders for false positives and delete junk email permanently. I've been wanting a quick way to glance at junk mail and easily delete page by page. Deleting emails page by page is not supported in mu4e by default. /Fortunately, this is Emacs and we can change that™./ There's a handy package by Roland Walker called [[http://github.com/rolandwalker/window-end-visible][window-end-visible]]. We can use it to select mu4e emails by page and subsequently glue it all together to enable deleting emails by page. #+BEGIN_SRC emacs-lisp (require 'mu4e) (require 'window-end-visible) (defun ar/mu4e-delete-page () (interactive) (set-mark (window-start)) (goto-char (window-end-visible)) (activate-mark) (mu4e-headers-mark-for-trash) (mu4e-mark-execute-all t) (deactivate-mark) (goto-char (window-start))) #+END_SRC I'm a [[https://github.com/jwiegley/use-package][use-package]] fan, so I use it to bind the "v" key to delete /visible emails (by page/). #+BEGIN_SRC emacs-lisp (use-package mu4e :bind (:map mu4e-headers-mode-map ("v" . ar/mu4e-delete-page)) #+END_SRC #+ATTR_HTML: :width 75% :height 75% [[file:images/faster-junk-mail-deletion-with-mu4e/delete-junk.gif]] * [2018-11-06 Tue] Working with vultr's ipv6-only instances :PROPERTIES: :CUSTOM_ID: working-with-vultrs-ipv6-only-instances :END: Having recently read [[https://www.amazon.co.uk/Transforming-Relationship-Achieving-Financial-Independence/dp/0143115766/][Your Money or Your Life]], I've been cutting down on personal expenses wherever possible. Specially recurring expenses which include monthly charges from VPS hosting. Let's reduce those charges... My VPS needs are fairly small (mostly hobby and tinkering). [[https://www.vultr.com/?ref=7579034][Vultr]]† has a plan for $2.50/month (not seen anything cheaper). The caveat for the price, you get ipv6 access only (ie. 0000:1111:2222:3333:4444:5555:6666:7777:8888). So far so good, but my ISP doesn't yet support ipv6: #+BEGIN_SRC sh $ ping6 0000:1111:2222:3333:4444:5555:6666:7777:8888 $ ping6: UDP connect: No route to host #+END_SRC Fortunately, we can still work with ipv6 by using a tunnel (TIL about [[https://tunnelbroker.net][Hurricane Electric's tunnel broker]]). After signing up and creating a tunnel, they conveniently show you "Example Configurations" from the "Tunnel Details" menu. In my case, macOS: #+BEGIN_SRC sh ifconfig gif0 create ifconfig gif0 tunnel ifconfig gif0 inet6 prefixlen 128 route -n add -inet6 default #+END_SRC Note: If behind router, use the DHCP internal IP. After configuring with ifconfig, all is good. Yay! #+BEGIN_SRC sh $ ping6 0000:1111:2222:3333:4444:5555:6666:7777:8888 PING6(56=40+8+8 bytes) 2001:111:22:aaa::2 --> 0000:1111:2222:3333:4444:5555:6666:7777:8888 16 bytes from 0000:1111:2222:3333:4444:5555:6666:7777:8888, icmp_seq=0 hlim=52 time=270.019 ms 16 bytes from 0000:1111:2222:3333:4444:5555:6666:7777:8888, icmp_seq=1 hlim=52 time=290.834 ms 16 bytes from 0000:1111:2222:3333:4444:5555:6666:7777:8888, icmp_seq=2 hlim=52 time=311.960 ms 16 bytes from 0000:1111:2222:3333:4444:5555:6666:7777:8888, icmp_seq=3 hlim=52 time=330.902 ms #+END_SRC I'm an ipv6 noob. I mostly need ssh access. My typical usages need small tweaks. For ssh: #+BEGIN_SRC sh ssh -6 username@0000:1111:2222:3333:4444:5555:6666:7777:8888 #+END_SRC For scp: #+BEGIN_SRC sh scp -6 file.txt username@\[0000:1111:2222:3333:4444:5555:6666:7777:8888\]:/remote/dir/ #+END_SRC † I get $10 credit if you use this affiliate link. Thank you. * [2018-11-04 Sun] Shaving bookmarks :PROPERTIES: :CUSTOM_ID: shaving-bookmarks :END: - [[https://www.independent.co.uk/extras/indybest/fashion-beauty/mens-grooming/best-safety-razors-for-beginners-sensitive-skin-10111508.html][8 best safety razors (The Independent)]]. * [2018-11-04 Sun] Buy it for life bookmarks :PROPERTIES: :CUSTOM_ID: buy-it-for-life-bookmarks :END: - [[https://www.fjallraven.com][Fjällräven jackets]]. - [[https://www.etsy.com/uk/market/gillette_slim][Gillette slim (Etsy)]]. * [2018-10-29 Mon] Rust bookmarks :PROPERTIES: :CUSTOM_ID: rust-bookmarks :END: :MODIFIED: [2021-07-11 Sun] :END: - [[https://robert.kra.hn/posts/2021-02-07_rust-with-emacs/][Configuring Emacs for Rust development | Robert Krahn]]. - [[https://www.snoyman.com/blog/2018/10/introducing-rust-crash-course][Introducing the Rust crash course]]. - [[https://news.ycombinator.com/item][Rust Language Cheat Sheet (cheats.rs) ]]. * [2018-10-28 Sun] Fonts bookmarks :PROPERTIES: :CUSTOM_ID: fonts-bookmarks :END: :MODIFIED: [2019-10-20 Sun] :END: - [[https://www.getthefont.com/][Get the Font]]. - [[https://github.com/rsms/inter][GitHub - rsms/inter: The Inter UI font family]]. - [[https://input.fontbureau.com/][Input: Fonts for Code]]. - [[https://app.programmingfonts.org/][Programming Fonts - Test Drive]]. - [[https://www.kutilek.de/sudo-font/][Sudo Coding Font | Jens Kutílek]]. - [[https://github.com/IBM/plex][The package of IBM’s typeface, IBM Plex (font)]]. * [2018-10-17 Wed] imenu on Emacs eshell :PROPERTIES: :CUSTOM_ID: imenu-on-emacs-eshell :END: [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Imenu.html][imenu]] navigation is one of those Emacs gems I didn't discover until much later on. It does what you'd expect in all types of modes. In rare instances, I've found specific modes missing imenu support. Fortunately, this is Emacs and you can fix that. [[https://www.gnu.org/software/emacs/manual/html_mono/eshell.html][Eshell]] has a handy feature to jump back and forth over previous prompts using /M-x eshell-previous-prompt (C-c C-p)/ and /M-x eshell-next-prompt (C-c C-n)/. Upon learning about these two functions, my immediate reaction was to try imenu. Surprisingly, it didn't "just work\n", but a tiny bit of elisp brought balance back to the Emacs universe. In an eshell mode hook function, one can set the [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Imenu.html#index-imenu_002dgeneric_002dexpression-2058][imenu-generic-expression]] to help it find your favorite prompt: #+BEGIN_SRC emacs-lisp (setq-local imenu-generic-expression '(("Prompt" " $ \\(.*\\)" 1))) #+END_SRC Ah it's the little things... #+ATTR_HTML: :width 75% :height 75% [[file:images/imenu-on-emacs-eshell/eshell-imenu.gif]] ps. If wondering why my imenu experience looks a little different, that's because I'm using Abo Abo's wonderful [[https://github.com/abo-abo/swiper][counsel]] and /M-x counsel-semantic-or-imenu/. * [2018-10-14 Sun] Encrypted disk image on macOS :PROPERTIES: :CUSTOM_ID: encrypted-disk-image-on-macos :END: #+ATTR_HTML: :width 75% :height 75% [[file:images/encrypted-image-on-macos/1.png]] #+ATTR_HTML: :width 75% :height 75% [[file:images/encrypted-image-on-macos/2.png]] * [2018-10-13 Sat] Sheffield travel bookmarks :PROPERTIES: :CUSTOM_ID: sheffield-travel-bookmarks :END: :MODIFIED: [2018-10-13 Sat] :END: - [[http://streetfoodchef.co.uk/][Street Food Chef]]. - [[http://www.sakushi.co.uk/][Sakushi -Sushi, noodle and Japanese food restaurant in Sheffield]]. * [2018-10-13 Sat] Headsphones bookmarks :PROPERTIES: :CUSTOM_ID: headsphones-bookmarks :END: :MODIFIED: [2018-12-09 Sun] :END: - [[https://www.steventammen.com/posts/bose-qc35ii-headphones/][Bose QuietComfort 35 II Headphones (StevenTammen.com)]]. - [[https://www.rtings.com/headphones/tests/isolation/noise-isolation-cancellation-passive-active][Noise Isolation/Cancellation of Headphones (RTINGS.com)]]. - [[https://www.rtings.com/headphones/reviews/sony/wh-1000xm3][Sony WH-1000XM3 Review - RTINGS.com]]. * [2018-10-05 Fri] macOS app bookmarks :PROPERTIES: :CUSTOM_ID: macos-app-bookmarks :END: :MODIFIED: [2020-12-13 Sun] :END: - [[http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html][Customizing the Cocoa Text System]]. - [[https://dmgbuild.readthedocs.io/en/latest/][dmgbuild - A command line tool to build .dmg files]]. - [[https://github.com/GetStream/Winds/blob/master/README.md][GetStream/Winds: macOS rss reader]]. - [[https://github.com/herrbischoff/awesome-macos-command-line#itunes][GitHub - herrbischoff/awesome-macos-command-line]]. - [[https://github.com/koekeishiya/yabai][GitHub - koekeishiya/yabai: A tiling window manager for macOS based on binary]]. - [[https://github.com/TermiT/Flycut][GitHub - TermiT/Flycut: Clean and simple clipboard manager for developers]]. - [[https://news.ycombinator.com/item?id=21794858][Hidden Bar: macOS utility to hide unused menu bar icons, written in Swift]]. - [[https://www.obdev.at/products/launchbar/index.html][LaunchBar 6 (can I implement flows in Emacs)?]]. - [[https://news.ycombinator.com/item?id=21179713][List of open source applications for macOS (Hacker News)]]. - [[https://macopenweb.com/][Mac Open Web, by Brian Warren]]. - [[https://eclecticlight.co/mac-troubleshooting-summary/][Mac Troubleshooting Summary – The Eclectic Light Company]]. - [[https://github.com/kam800/MachObfuscator/blob/master/README.md][MachObfuscator/README.md at master · kam800/MachObfuscator · GitHub]]. - [[https://papers.put.as/macosx/macosx/][macOS · Papers, Slides and Thesis Archive]]. - [[https://www.gonsie.com/blorg/ipad-setup.html][My iPad Setup]]. - [[https://github.com/nikitavoloboev/my-mac-os][My wonderful world of macOS]]. - [[https://github.com/nikitavoloboev/my-mac-os][my-mac-os: My wonderful world of macOS]]. - [[https://thesweetsetup.com/netnewswire-5-0-relaunches-as-an-open-source-rss-reader-for-the-mac/][NetNewsWire 5.0 Relaunches as an Open-Source RSS Reader for the Mac – The Sweet Setup]]. - [[https://smilesoftware.com/pdfpen/?][PDF Editor - PDFpen - Edit PDF Files (Smile Software)]]. - [[http://solutions.weblite.ca/pdfocrx/][PDF OCR X - Mac & Windows OCR Software to convert PDFs and Images to Text]]. - [[https://apps.apple.com/us/app/rested-simple-http-requests/id421879749][‎RESTed - Simple HTTP Requests on the Mac App Store]]. * [2018-09-30 Sun] Gaming bookmarks :PROPERTIES: :CUSTOM_ID: gaming-bookmarks :END: :MODIFIED: [2021-07-11 Sun] :END: - [[http://openemu.org/][OpenEmu - Multiple Video Game System for owned ROMs]]. - [[https://twitter.com/SethAbramson/status/1412177674596986881][The Top 100 Android Video Games]]. * [2018-09-29 Sat] Lua bookmarks :PROPERTIES: :CUSTOM_ID: lua-bookmarks :END: :MODIFIED: [2020-12-26 Sat] :END: - [[https://github.com/sumneko/lua-language-server/wiki/Build-and-Run-(Standalone)][Build and Run (Standalone) · sumneko/lua-language-server Wiki · GitHub]]. - [[https://sepisoad.com/blog/how%20to%20lua%20and%20c%20-%20a%20short%20novel.html][how to lua and c - a short novel]]. - [[https://luadigest.immortalin.com/][Lua Digest]]. - [[https://news.ycombinator.com/item?id=17969795][Lua tables (Hacker News)]]. * [2018-09-29 Sat] Skin product bookmarks :PROPERTIES: :CUSTOM_ID: skin-product-bookmarks :END: :MODIFIED: [2018-09-29 Sat] :END: - [[https://www.rebootedmom.com/diy-deodorant-bars/][DIY Deodorant Bars - Rebooted Mom]]. - [[https://blog.freepeople.com/2015/03/allnatural-deodorant-bars/][How to Make Your Own All-Natural Deodorant Bars]]. - [[http://sarahfrascamakeup.blogspot.com/2011/04/good-bad-and-ugly-lush-cosmetics.html][Sarah Frasca Makeup: The good, the bad and the ugly: Lush Cosmetics]]. - [[https://www.ewg.org/skindeep/][Skin Deep® Cosmetics Database (EWG)]]. * [2018-09-29 Sat] Sustainability bookmarks :PROPERTIES: :CUSTOM_ID: sustainability-bookmarks :END: - [[https://factory45.co/][Source Fabric. Find a Manufacturer. Raise Money to Fund Production. (Factory45)]]. * [2018-09-29 Sat] Investment platform bookmarks :PROPERTIES: :CUSTOM_ID: investment-platform-bookmarks :END: :MODIFIED: [2021-07-11 Sun] :END: - [[https://www.portfoliovisualizer.com/backtest-portfolio][Backtest Portfolio Asset Allocation]]. - [[https://bravos.co/][Bravos]]. - [[http://www.cmlviz.com/][CMLviz.com - BETA]]. - [[https://www.degiro.eu/][DEGIRO - Online Stock Trading - Stockbroking (cheaper?)]]. - [[https://iextrading.com/developer/][Free Stock API for Realtime and Historical Data (IEX)]]. - [[https://freetrade.io/][Freetrade - Free Stock Investing]]. - [[https://www.halifax.co.uk/sharedealing/][Halifax UK | Buying and selling (Sharedealing)]]. - [[https://www.hl.co.uk/][Hargreaves Lansdown (ISAs, pensions, funds and shares)]]. - [[https://twitter.com/kanhaic/status/1411302254884261893][How I have automated my #algotrading and spend less than ₹10]]. - [[https://www.iweb-sharedealing.co.uk/share-dealing-home.asp][IWeb Share Dealing (cheaper?)]]. - [[https://www.fundingcircle.com/uk/investors/][Lend to UK Businesses | Investment (Funding Circle)]]. - [[https://www.ratesetter.com/][RateSetter Peer To Peer Lender (P2P Investing and Borrowing)]]. - [[https://www.stockportfolioorganizer.com/][Stock Portfolio Management Software (Stock Portfolio Organizer)]]. - [[https://stockdaddy.io/][StockDaddy - Free, real-time, easy to use stock portfolio tracker]]. - [[https://stocklight.com/][StockLight - Australia's premier investing app]]. - [[https://wallmine.com/stocks-and-cryptocurrency-portfolio-tracker][Stocks and cryptocurrency portfolio tracker (wallmine)]]. * [2018-09-28 Fri] Minimalist bookmarks :PROPERTIES: :CUSTOM_ID: minimalist-bookmarks :END: :MODIFIED: [2019-05-10 Fri] :END: - [[https://mnmll.ist][mnmll.ist: listing all things minimalist]]. - [[https://www.raisingsimple.com][Raising Simple | Streamline your home. Simplify family life (minimalism)]]. * [2018-09-23 Sun] Recover from Time Machine's "backup already in use" :PROPERTIES: :CUSTOM_ID: recover-from-time-machines-backup-already-in-use :END: Started seeing "backup already in use" error from my daily Time Machine backups, against my Synology. Disabling and re-enabling AFP did the job (via Synology -> Control Panel -> Files Services -> Enable AFP service). #+ATTR_HTML: :width 75% :height 75% [[file:images/recover-from-time-machines-backup-already-in-use/re-enable_afp_service.png]] * [2018-09-03 Mon] CMake bookmarks :PROPERTIES: :CUSTOM_ID: cmake-bookmarks :END: :MODIFIED: [2018-09-03 Mon] :END: - [[https://news.ycombinator.com/item?id=17897685][An Introduction to Modern CMake (Hacker News)]]. - [[https://cliutils.gitlab.io/modern-cmake/][An Introduction to Modern CMake]]. - [[https://steveire.wordpress.com/2017/11/05/embracing-modern-cmake/][Embracing Modern CMake (Steveire's Blog)]]. * [2018-08-28 Tue] GTD/Get things done bookmarks :PROPERTIES: :CUSTOM_ID: gtdget-things-done-bookmarks :END: :MODIFIED: [2019-05-18 Sat] :END: - [[https://jamesstuber.com/plan-your-day/][Daily Time Management with Todoist and Google Calendar | JamesStuber.com]]. - [[https://klinger.io/post/71640845938/dont-drown-in-email-how-to-use-gmail-more][Don’t drown in email! How to use Gmail more efficiently. - Startup Lessons Learned]]. - [[https://praxis.fortelabs.co/gtd-x-pkm-8ff720ef6939/][Getting Things Done + Personal Knowledge Management - Praxis]]. - [[https://emacs.cafe/emacs/orgmode/gtd/2017/06/30/orgmode-gtd.html][Orgmode for GTD/Get things done]]. * [2018-08-28 Tue] Pandoc bookmarks :PROPERTIES: :CUSTOM_ID: pandoc-bookmarks :END: :MODIFIED: [2018-11-17 Sat] :END: - [[http://www.gabrielgambetta.com/tgl_open_source.html][How I wrote and published my novel using only open source tools]]. - [[https://news.ycombinator.com/item?id=17855104][Pandoc (Hacker News)]]. - [[https://pandoc.org/demos.html][Pandoc - Demos]]. * [2018-08-27 Mon] Mauritius travel bookmarks :PROPERTIES: :CUSTOM_ID: mauritius-travel-bookmarks :END: :MODIFIED: [2020-03-11 Wed] :END: - [[https://www.nomadasaurus.com/things-to-do-in-mauritius/][20 Amazing Things to Do in Mauritius (2020 Guide)]]. - [[https://1886corsontea.com][Corson vanilla tea]]. - [[https://www.tripadvisor.co.uk/Attraction_Review-g293816-d477276-Reviews-Ile_aux_Cerfs-Mauritius.html#photos;aggregationId=101&albumid=101&filter=7&ff=447514694][Ile aux Cerfs (Mauritius) - Jonathan/Vanessa excursions]]. - [[https://en.wikipedia.org/wiki/Le_Morne_Brabant][Le Morne Brabant (Wikipedia)]]. - [[https://mauritiusattractions.com/mauritius-beaches-i-80.html][Mauritius Beaches - the Best Beaches in Mauritius - Mauritius Attractions]]. - [[https://www.bugbog.com/beaches/beach_pictures_mauritius/][Mauritius beaches: pictures, information, resorts, sights]]. - [[https://www.bugbog.com/beaches/beach_pictures_mauritius/mauritius_sights/#ganga][Mauritius sights, large pictures, best things to see and do]]. - [[https://www.maurinet.com/tourist_information/public_beaches][Public Beaches :: Mauritius Island Online]]. - [[https://mel365.com/best-beaches-in-mauritius/][The 12 best beaches in Mauritius 2020 {with map and photos}]]. - [[https://theculturetrip.com/africa/mauritius/articles/the-best-markets-in-mauritius/][The Best Markets in Mauritius]]. - [[https://theculturetrip.com/africa/mauritius/articles/the-best-spots-to-eat-roti-in-port-louis-mauritius/][The Best Spots to Eat Roti in Port Louis, Mauritius]]. - [[https://theculturetrip.com/africa/mauritius/articles/the-essential-guide-to-port-louis-central-market-in-mauritius/][The Essential Guide to Port Louis' Central Market in Mauritius]]. * [2018-08-27 Mon] Scala bookmarks :PROPERTIES: :CUSTOM_ID: scala-bookmarks :END: - [[https://leanpub.com/fpmortals/read][Functional Programming for Mortals (Leanpub)]]. * [2018-08-22 Wed] Actionable URLs in Emacs buffers :PROPERTIES: :CUSTOM_ID: actionable-urls-in-emacs-buffers :END: Should have enabled actionable URLs in my Emacs buffers long ago. Can now click or press return to follow links. It's great on eshell, compilation buffers, async shell commands, code, etc. #+BEGIN_SRC emacs-lisp (use-package goto-addr :hook ((compilation-mode . goto-address-mode) (prog-mode . goto-address-prog-mode) (eshell-mode . goto-address-mode) (shell-mode . goto-address-mode)) :bind (:map goto-address-highlight-keymap ("" . goto-address-at-point) ("M-" . newline)) :commands (goto-address-prog-mode goto-address-mode)) #+END_SRC #+ATTR_HTML: :width 75% :height 75% [[file:images/actionable-urls-in-emacs-buffers/goto-address.png]] * [2018-08-22 Wed] Bazel bookmarks :PROPERTIES: :CUSTOM_ID: bazel-bookmarks :END: :MODIFIED: [2020-11-15 Sun] :END: - [[https://github.com/vincent-picaud/Bazel_with_GTest][Bazel_with_GTest: C++ project skeleton with Bazel & GTest]]. - [[https://tulipemoutarde.be/posts/bazel-for-mobile-apps-part-2/][Build mobile apps with Bazel. Part 2: iOS]]. - [[https://github.com/bazelbuild/rules_docker][GitHub - bazelbuild/rules_docker: Rules for building and handling Docker images with Bazel]]. - [[https://github.com/jin/awesome-bazel][GitHub - jin/awesome-bazel: A curated list of Bazel rules, tooling and resources]]. - [[https://jakemccrary.com/blog/2020/06/28/using-bazel-to-help-fix-flaky-tests/][Using Bazel to help fix flaky tests - Jake McCrary]]. * [2018-08-18 Sat] Palestine travel bookmarks :PROPERTIES: :CUSTOM_ID: palestine-travel-bookmarks :END: - [[https://www.tripadvisor.co.uk/Restaurant_Review-g667136-d7360437-Reviews-Rukab_s_Ice_Cream-Ramallah_Binyamin_Region_West_Bank.html][Rukab's Ice Cream, Ramallah (Trip advisor)]]. * [2018-08-18 Sat] Enabling Control-Meta(⌘)-D on macOS :PROPERTIES: :CUSTOM_ID: enabling-control-meta-d-on-macos :END: I use command (⌘) as my Emacs Meta key. Recently discovered C-M-d is not available to Emacs for binding keys on macOS. Stack Exchange had the [[https://apple.stackexchange.com/questions/22785/how-do-i-disable-the-command-control-d-word-definition-keyboard-shortcut-in-os-x][workaround]]: #+BEGIN_SRC sh defaults write com.apple.symbolichotkeys AppleSymbolicHotKeys -dict-add 70 'enabled' #+END_SRC * [2018-08-13 Mon] Recycling bookmarks :PROPERTIES: :CUSTOM_ID: recycling-bookmarks :END: :MODIFIED: [2018-08-13 Mon] :END: - [[https://myplasticfreelife.com/][My Plastic-free Life]]. * [2018-08-12 Sun] Comoro islands travel bookmarks :PROPERTIES: :CUSTOM_ID: comoro-islands-travel-bookmarks :END: - [[https://www.quora.com/What-are-some-of-the-exotic-tourist-destinations-which-are-not-commonly-known/answer/Patrick-Crosset][Visiting The Comoros Islands (Quota)]]. * [2018-08-12 Sun] France travel bookmarks :PROPERTIES: :CUSTOM_ID: france-travel-bookmarks :END: :MODIFIED: [2023-06-09 Fri] :END: - [[https://www.lonelyplanet.com/articles/france-top-food-experiences][France's 10 top food experiences - Lonely Planet]]. - [[https://thefrenchtouch.quora.com/GR-20-Best-Mountain-Hiking-in-France][GR 20 : Best Mountain Hiking in France - The French Touch - Quora]]. - [[https://twitter.com/malk_zameth/status/1278288570021826563][Hmmm I want to take some August vacation time in a city I can go by train from paris and is nice to visit calm and not too expensive ]]. * [2018-08-12 Sun] Corsica travel bookmarks :PROPERTIES: :CUSTOM_ID: corsica-travel-bookmarks :END: - [[https://thefrenchtouch.quora.com/National-Geographic-Corsica-is-The-Best-Place-in-the-World-to-go-in-2015][National Geographic : Corsica is The Best Place... - The French Touch - Quora]]. * [2018-08-12 Sun] Mozambique travel bookmarks :PROPERTIES: :CUSTOM_ID: mozambique-travel-bookmarks :END: - [[https://africa.quora.com/Mozambiques-beaches][Mozambique's beaches - Africa is Back - Quora]]. * [2018-08-12 Sun] M-r history search in git-commit-mode :PROPERTIES: :CUSTOM_ID: m-r-history-search-in-git-commit-mode :END: I've grown accustomed to M-r bindings to search Emacs history. Been wanting similar functionality to search commit message history. Turns out /log-edit-comment-ring/ has some of my local commit message history. Feeding it to /completing-read/ gives me an easily searchable history when using a completing framework like ivy or helm: #+BEGIN_SRC emacs-lisp (defun ar/git-commit-search-message-history () "Search and insert commit message from history." (interactive) (insert (completing-read "History: " ;; Remove unnecessary newlines from beginning and end. (mapcar (lambda (text) (string-trim text)) (ring-elements log-edit-comment-ring))))) #+END_SRC Now we bind it to /M-r/ and we're good to go: #+BEGIN_SRC emacs-lisp (bind-key "M-r" #'ar/git-commit-search-message-history git-commit-mode-map) #+END_SRC May also want to persist /log-edit-comment-ring/ across Emacs sessions by adding /log-edit-comment-ring/ to savehist variables. Also ensure /savehist-mode/ is enabled: #+BEGIN_SRC emacs-lisp (add-to-list 'savehist-additional-variables log-edit-comment-ring) (savehist-mode +1) #+END_SRC #+ATTR_HTML: :width 75% :height 75% [[file:images/m-r-history-search-in-git-commit-mode/m-r-commit-history.png]] * [2018-08-09 Thu] Morning smoothie :PROPERTIES: :CUSTOM_ID: morning-smoothie :END: Big fan of my morning power smoothie. Best deals I've found so far: - Almonds (BuyWholeFoodsOnline.co.uk, [[https://www.amazon.co.uk/gp/product/B004XJ72HI][£1.06/100g @ Amazon]]). - Banana. - Blueberries. - Chia seeds ([[https://www.realfoodsource.com/product/whole-natural-dark-chia-seeds/][£4.99/Kg @ Real Food Source]]). - Cocoa powder (Active foods, [[https://www.bulkpowders.co.uk/organic-cacao-powder.html][£ 1.7/100g @ Bulk Powders]]). - Coconut water (Innocent, [[https://www.tesco.com/groceries/en-GB/products/288178112][£0.37/100ml @ Tesco]]). - Crunchy peanut butter ([[https://www.realfoodsource.com/product/peanut-butter/][£ 4.99/Kg @ Real Food Source]]). - Matcha powder (Active [[https://www.bulkpowders.co.uk/matcha-green-tea-powder.html][£6.8/100g @ Bulk Powders]]). - Strawberries. ps. I have no affiliation to either retailer. Prices may change. * [2018-08-08 Wed] Installing ludget (ledger visualization :PROPERTIES: :CUSTOM_ID: installing-ludget-ledger-visualization :END: Needed python3: #+BEGIN_SRC sh brew install python3 #+END_SRC Use pip3 to install ludget: #+BEGIN_SRC sh pip3 install ludget #+END_SRC * [2018-08-08 Wed] Ledger bookmarks :PROPERTIES: :CUSTOM_ID: ledger-bookmarks :END: :MODIFIED: [2021-09-30 Thu] :END: - [[https://github.com/adept/full-fledged-hledger]["Full-fledged Hledger" Tutorial (interesting approach with great traceability and regeneration)]]. - [[https://github.com/adept/full-fledged-hledger/wiki]["Full-fledged Hledger" Tutorial]]. - [[https://www.khanacademy.org/economics-finance-domain/core-finance/accounting-and-financial-stateme][Accounting and financial statements (Khan Academy)]]. - [[https://cvillefoss.blog/2019/02/12/accounting-in-plain-text-part-1/][Accounting in Plain Text, Part 1 – cvilleFOSS]]. - [[http://matthiaskauer.com/2015/08/command-line-accounting-a-look-at-the-various-ledger-ports/][Command Line Accounting - A look at the various ledger ports (mkauer)]]. - [[https://www.reddit.com/r/emacs/comments/46hs9q/conquering_your_finances_with_emacs_and_ledger/][Conquering Your Finances with Emacs and Ledger : emacs]]. - [[https://github.com/awalker4/ledgerTalk2016][Conquering your finances with Emacs and Ledger]]. - [[https://github.com/ledger/ledger/wiki/CSV-Import][Convert a CSV file (comma separated values) from your bank into ledger format]]. - [[https://frdmtoplay.com/envelope-budgeting-with-ledger/][Envelope Budgeting with ledger]]. - [[https://github.com/simonmichael/hledger/tree/master/examples/csv][Examples of recent and older CSV rules files for ledger]]. - [[https://github.com/adept/full-fledged-hledger][full-fledged-hledger: Tutorial on Hledger setup]]. - [[https://github.com/barrucadu/finances][GitHub - barrucadu/finances: A small tool to visualise my hledger journal.]]. - [[https://github.com/Clever/csvlint][GitHub - Clever/csvlint: library and command line tool that validates a CSV file]]. - [[https://www.reddit.com/r/Bitcoin/comments/155gw5/heres_how_you_use_ledger_to_account_for_bitcoin/][Here's how you use ledger to account for Bitcoin transactions]]. - [[https://pauley.org.za/hledger-flow/][Hledger Flow: Step-By-Step]]. - [[https://www.reddit.com/r/plaintextaccounting/comments/8b10o0/importing_trans=actions_from_bank/][Importing transactions from bank. : plaintextaccounting (Reddit)]]. - [[https://patrickskiba.com/ledger-cli/2019/12/07/introduction-to-ledger-cli.html][Introduction to ledger and text-based accounting | Patrick Skiba]]. - [[https://sirodoht.com/blog/introduction-to-plain-text-accounting/][Introduction to plain text accounting (sirodoht blog)]]. - [[https://devhints.io/ledger][Ledger CLI cheatsheet]]. - [[https://devhints.io/ledger-csv][Ledger CSV format cheatsheet]]. - [[https://devhints.io/ledger-examples][Ledger examples cheatsheet]]. - [[https://devhints.io/ledger-periods][Ledger periods cheatsheet]]. - [[https://felixcrux.com/blog/ledger-practices][Ledger Practices - Felix Crux]]. - [[https://devhints.io/ledger-query][Ledger queries cheatsheet]]. - [[https://github.com/sheehamj13/ledger-reports][Ledger Report Scripts (tested on macOS Mojave)]]. - [[https://news.ycombinator.com/item?id=7707262][Ledger, a powerful CLI accounting tool (Hacker News)]]. - [[https://www.reddit.com/r/emacs/comments/6a3oxv/ledgerledgermode_tips_and_tricks/][ledger/ledger-mode tips and tricks? (Reddit)]]. - [[https://www.ledger-cli.org/3.0/doc/ledger3.html#The-convert-command][Ledger: Command-Line Accounting (convert csv command)]]. - [[https://www.ledger-cli.org/3.0/doc/ledger3.html][Ledger: Command-Line Accounting (documentation)]]. - [[https://gitlab.com/rjurga/ludget][ludget: ledger-cli data visualization]]. - [[https://memo.barrucadu.co.uk/personal-finance.html][Memo's personal Finance post on plain-text accounting]]. - [[https://plaintextaccounting.org/#comparisons][Plain Text Accounting, a guide to Ledger and friends - plaintextaccounting.org (comparisons)]]. - [[https://plaintextaccounting.org/#data-importconversion][Plain Text Accounting, a guide to Ledger and friends - plaintextaccounting.org (import)]]. - [[https://www.petekeen.net/keeping-finances-with-ledger][Program your Finances: Command-line Accounting (Pete Keen)]]. - [[https://www.sundialdreams.com/report-scripts-for-ledger-cli-with-gnuplot/][Report Scripts for Ledger CLI with Gnuplot (日光漫想)]]. - [[https://news.ycombinator.com/item?id=17845565][Show HN: Ledger-analytics – Analytics for ledger-cli (Hacker News)]]. - [[https://github.com/rememberYou/.emacs.d/blob/a095e0e3e88cd64e6ef5e8062d3215d67ad9e285/config.org#ledger][Terencio's Ledger Emacs config]]. - [[https://plaintextproject.online][The Plain Text Project]]. - [[https://www.reddit.com/r/emacs/comments/8x4xtt/tip_how_i_use_ledger_to_track_my_money][TIP: How I use ledger to track my money : emacs]]. - [[http://rantsideasstuff.com/posts/2018/07/01-tracking-investments-in-lots-with-hledger/][Tracking Investments in Lots with Hledger]]. - [[https://www.reddit.com/r/plaintextaccounting/comments/bhxdew/unrealized_gains/][Unrealized gains : plaintextaccounting]]. - [[https://emacs.cafe/ledger/emacs/ynab/budgeting/2018/06/12/elbank-ynab.html][Using Ledger for YNAB-like envelope budgeting]]. - [[https://memo.barrucadu.co.uk/hledger-influxdb-grafana.html][Visualise your finances with hledger, InfluxDB, and Grafana]]. - [[https://www.mint.com/mint-categories][Ways to Categorize Your Spending (Mint)]]. - [[https://github.com/ledger/ledger/wiki/Who's-using-ledger%3F][Who's using ledger? · ledger/ledger Wiki]]. * [2018-08-07 Tue] Tip: Convert .texi to .info :PROPERTIES: :CUSTOM_ID: tip-convert-texi-to-info :END: Convert with: #+BEGIN_SRC sh makeinfo doc.texi #+END_SRC View with: Open in Emacs and render as info with: #+BEGIN_SRC emacs-lisp (defun ar/format-info-mode () (interactive) (let ((file-name (buffer-file-name))) (kill-buffer (current-buffer)) (info file-name))) #+END_SRC * [2018-07-25 Wed] Marking 20k emails as read :PROPERTIES: :CUSTOM_ID: marking-20k-emails-as-read :End: [[http://isync.sourceforge.net/][Mbsync]] and [[https://www.djcbsoftware.nl/code/mu/mu4e.html][mu4e]] are great for syncing and handling IMAP email. I've now migrated 4 email addresses, including an old Yahoo account. I wanted to mark all my Yahoo unread emails as read. Yahoo's webmail enables marking 500 emails at a time, making the process a little tedious. [[https://groups.google.com/forum/#!forum/mu-discuss][Mu-discuss]] has a handy [[https://groups.google.com/d/msg/mu-discuss/zaA394sH1Ow/QSVPXS22BQAJ][thread]], highlighting that moving/renaming synced messages (in your local file system) would do the job. This worked well for me. Let's do just that... *WARNING:* Copy a small sample of your mails to a separate directory and run some trials until you feel comfortable. Find your mail directory. #+BEGIN_SRC sh cd path/to/mail #+END_SRC Peek at the messages you'd like to mark unread: #+BEGIN_SRC sh ls -1 new/ #+END_SRC #+RESULTS: 1529958027.57518_11.mbp,U=8415:2, 1531346210.38822_3.mbp,U=8741:2, 1532464801.21057_1.mbp,U=9028:2, 1532464801.21057_2.mbp,U=9029:2, Rename message files by appending "S" to their filename and moving from new/ to cur/ directory. #+BEGIN_SRC sh for FILE in new/*; do mv "${FILE}" cur/$(basename "${FILE}")S; done; #+END_SRC We can verify the move. #+BEGIN_SRC sh ls -1 cur/ #+END_SRC #+RESULTS: 1529958027.57518_11.mbp,U=8415:2,S 1531346210.38822_3.mbp,U=8741:2,S 1532464801.21057_1.mbp,U=9028:2,S 1532464801.21057_2.mbp,U=9029:2,S Let's sync the local changes. #+BEGIN_SRC sh mbsync -Va #+END_SRC ...and we're done ;) * [2018-07-24 Tue] Show iOS simulator touches :PROPERTIES: :CUSTOM_ID: show-ios-simulator-touches :END: TIL from [[https://twitter.com/liamnichols_/status/1018812142693253120?s=12][this tweet]], that you can enable showing touches on iOS simulator. This is handy for making nicer screencasts. #+BEGIN_SRC sh defaults write http://com.apple .iphonesimulator ShowSingleTouches 1 #+END_SRC * [2018-07-15 Sun] Amsterdam travel bookmarks :PROPERTIES: :CUSTOM_ID: amsterdam-travel-bookmarks :END: - [[https://belowthesurface.amsterdam/en/][Below the Surface: The archaeological finds of the North / Southline in Amsterdam]]. * [2018-07-14 Sat] Hardware bookmarks :PROPERTIES: :CUSTOM_ID: hardware-bookmarks :END: :MODIFIED: [2020-05-23 Sat] :END: - [[https://www.romanzolotarev.com/setup.html][Roman Zolotarev's OpenBSD on my fanless desktop computer (really sweet setup)]]. - [[https://michael.stapelberg.ch/posts/2020-05-23-desk-setup/][stapelberg uses this: my 2020 desk setup]]. * [2018-07-11 Wed] fitbit API, org babel, and gnuplot :PROPERTIES: :CUSTOM_ID: fitbit-api-org-babel-and-gnuplot :END: Retook running recently. Took the dust off my aria scale and used the opportunity to check out fitbit's API. First register your app at [[https://dev.fitbit.com/apps/new][dev.fitbit.com/apps/new]] and get a client_id=AABBCC. #+ATTR_HTML: :width 75% :height 75% [[file:images/fitbit-api-org-babel-and-gnuplot/fitbitapp.png]] You'll also need your USER_ID, from your Fitbitx user profile. #+ATTR_HTML: :width 75% :height 75% [[file:images/fitbit-api-org-babel-and-gnuplot/fitbituser.png]] We'll also need a token. I used the [[https://dev.fitbit.com/build/reference/web-api/oauth2/][implicit grant flow]] URL in my browser and extracted access_token=TOKEN. Now let's wire up two org source blocks to fetch the data and subsequently plot using gnuplot. It's pretty neat. You can take the output from one source block and use it as input to another. We use curl to fetch data from fitbit's API and pipe through [[https://stedolan.github.io/jq/][jq]] and sed to massage the output format into two columns. *Note:* Before using gnuplot in org babel, you'll need to install the gnuplot package and add to babel languages. #+BEGIN_SRC emacs-lisp (use-package gnuplot :ensure t) (use-package ob :config (org-babel-do-load-languages 'org-babel-load-languages '((gnuplot . t)))) #+END_SRC #+NAME: weight-data #+BEGIN_SRC sh :results table curl -s -H "Authorization: Bearer TOKEN" https://api.fitbit.com/1/user/USER_ID/body/weight/date/2018-06-09/2018-07-11.json | jq '.[][] | "\(.dateTime) \(.value)"' | sed 's/"//g' #+END_SRC #+RESULTS: weight-data | 2018-06-09 | 65.753 | | 2018-06-10 | 65.762 | | 2018-06-11 | 65.771 | | 2018-06-12 | 65.78 | | 2018-06-13 | 65.789 | | 2018-06-14 | 65.798 | | 2018-06-15 | 65.807 | | 2018-06-16 | 65.816 | | 2018-06-17 | 65.825 | | 2018-06-18 | 65.85 | | 2018-06-19 | 65.96 | | 2018-06-20 | 64.1 | | 2018-06-21 | 65.64 | | 2018-06-22 | 65.47 | | 2018-06-23 | 65.515 | | 2018-06-24 | 65.56 | | 2018-06-25 | 65.605 | | 2018-06-26 | 65.65 | | 2018-06-27 | 65.18 | | 2018-06-28 | 64.49 | | 2018-06-29 | 64.49 | | 2018-06-30 | 64.41 | | 2018-07-01 | 64.33 | | 2018-07-02 | 64.25 | | 2018-07-03 | 64.17 | | 2018-07-04 | 64.55 | | 2018-07-05 | 64.39 | | 2018-07-06 | 64.33 | | 2018-07-07 | 65.06 | | 2018-07-08 | 63.28 | | 2018-07-09 | 63.4 | | 2018-07-10 | 64.22 | | 2018-07-11 | 63.95 | Now feed the two column data to gnuplot. #+BEGIN_SRC gnuplot :var data=weight-data :exports code :file images/fitbit-api-org-babel-and-gnuplot/weight.png reset set title "My recent weight" set xdata time set timefmt '%Y-%m-%d' set format x "%d/%m/%y" set term png set xrange ['2018-06-09':'2018-07-11'] plot data u 1:2 with linespoints title 'Weight in Kg' #+END_SRC #+RESULTS: #+ATTR_HTML: :width 75% :height 75% [[file:images/fitbit-api-org-babel-and-gnuplot/weight.png]] Fetching data and plotting through org babel and gnuplot is pretty sweet. I've barely scratched the surface. There's more at [[https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-gnuplot.html][Org-babel-gnuplot]] and [[https://orgmode.org/worg/org-tutorials/org-plot.html][Plotting tables in Org-Mode using org-plot]]. Either way, this is another Emacs super power to keep in the toolbox. * [2018-07-08 Sun] PIPESTATUS for all return codes :PROPERTIES: :CUSTOM_ID: pipestatus-for-all-return-codes :END: From [[https://twitter.com/saruspete][@saruspete]]'s [[https://twitter.com/saruspete/status/1014801074794979335?s=12][tweet]], ${PIPESTATUS[@]} gives ya all piped commands' return codes: #+BEGIN_SRC sh :results verbatim echo foo | grep bar | tr z a | cat echo ${PIPESTATUS[@]} #+END_SRC #+RESULTS: : 0 1 0 0 * [2018-07-07 Sat] Emacs utilities for your OS :PROPERTIES: :CUSTOM_ID: emacs-utilities-for-your-os :END: Narrowing utilities are a wonderful way of increasing productivity. I have a few workflows using Emacs's [[https://github.com/emacs-helm/helm][Helm]] framework. There are great productivity boosters like [[https://www.alfredapp.com/][Alfred]] and [[https://qsapp.com/][Quicksilver]] for macOS, with batteries included. If you're a tinkerer, you'd enjoy the powerful [[http://hammerspoon.org/][Hammerspoon]]. Like elisp gluing all things Emacs, Hammerspoon uses Lua to glue all things macOS. You can build your own narrowing utilities using [[http://www.hammerspoon.org/docs/hs.chooser.html][chooser]] and a little Lua. #+BEGIN_SRC local chooser = hs.chooser.new(function(choice) hs.alert.show(choice['text']) end) chooser:choices({ { ["text"] = "Alfred\n", ["subText"] = "macOS only\n", }, { ["text"] = "Quicksilver\n", ["subText"] = "macOS only\n", }, { ["text"] = "Hammerspoon\n", ["subText"] = "macOS only\n", }, { ["text"] = "Emacs\n", ["subText"] = "is everywhere :)\n", }, }) chooser:show() #+END_SRC #+ATTR_HTML: :width 75% :height 75% [[file:images/emacs-utilities-for-your-os/chooser.png]] Howard Abrams's post on [[http://howardism.org/Technical/Emacs/capturing-content.html][Capturing Content for Emacs]] inspired me to look at gluing Emacs and macOS to launch my own cross-platform narrowing utilities. I've also taken this opportunity to look at Oleh Krehel's wonderful completion package: [[https://github.com/abo-abo/swiper][Ivy]]. We can use it to build a macOS narrowing utility. Ivy is remarkably easy to use. Turns out, [[http://oremacs.com/swiper/#api][ivy-read]] is all you need. A simple Emacs completion can be accomplished with little elisp. #+BEGIN_SRC emacs-lisp (ivy-read "Hello ivy: " '("One " "Two " "Three " "Four ")) #+END_SRC #+ATTR_HTML: :width 50% :height 50% [[file:images/emacs-utilities-for-your-os/simple_ivy.png]] Pretty nifty. Let's make this completion more accessible from the rest of the OS. To do so, we create a separate Emacs frame and make it pretty. We also want it to interact with the OS. We'll use /ivy-read/'s /:action/ to invoke a tiny bit of AppleScript. Oh and we'll also use some funny quotes to tease ourselves about our beloved editor. #+BEGIN_SRC emacs-lisp (with-current-buffer (get-buffer-create "*modal-ivy*") (let ((frame (make-frame '((auto-raise . t) (background-color . "DeepSkyBlue3") (cursor-color . "MediumPurple1") (font . "Menlo 15") (foreground-color . "#eeeeec") (height . 20) (internal-border-width . 20) (left . 0.33) (left-fringe . 0) (line-spacing . 3) (menu-bar-lines . 0) (minibuffer . only) (right-fringe . 0) (tool-bar-lines . 0) (top . 48) (undecorated . t) (unsplittable . t) (vertical-scroll-bars . nil) (width . 110))))) (set-face-attribute 'ivy-minibuffer-match-face-1 frame :background nil :foreground nil) (set-face-attribute 'ivy-minibuffer-match-face-2 frame :background nil :foreground "orange1") (set-face-attribute 'ivy-minibuffer-match-face-3 frame :background nil :foreground "orange1") (set-face-attribute 'ivy-minibuffer-match-face-4 frame :background nil :foreground "orange1") (set-face-attribute 'ivy-current-match frame :background "#ffc911" :foreground "red") (set-face-attribute 'minibuffer-prompt frame :foreground "grey") (let ((ivy-height 20) (ivy-count-format "")) (ivy-read "Emacs acronyms: " '(" Emacs: Escape-Meta-Alt-Control-Shift " " Emacs: Eight Megabytes And Constantly Swapping " " Emacs: Even a Master of Arts Comes Simpler " " Emacs: Each Manual's Audience is Completely Stupified " " Emacs: Eventually Munches All Computer Storage " " Emacs: Eradication of Memory Accomplished with Complete Simplicity " " Emacs: Easily Maintained with the Assistance of Chemical Solutions " " Emacs: Extended Macros Are Considered Superfluous " " Emacs: Every Mode Accelerates Creation of Software " " Emacs: Elsewhere Maybe All Commands are Simple " " Emacs: Emacs Makes All Computing Simple " " Emacs: Emacs Masquerades As Comfortable Shell " " Emacs: Emacs My Alternative Computer Story " " Emacs: Emacs Made Almost Completely Screwed " " Emacs: Each Mail A Continued Surprise " " Emacs: Eating Memory And Cycle-Sucking " " Emacs: Elvis Masterminds All Computer Software " " Emacs: Emacs Makes A Computer Slow" ) :action (lambda (funny-quote) (async-shell-command (format "osascript -e 'tell app \"System Events\" to display dialog \"%s\" buttons {\"OK\"}'" funny-quote))) :unwind (lambda () (shell-command "/Applications/Hammerspoon.app/Contents/Resources/extensions/hs/ipc/bin/hs -c 'backFromEmacs()'") (delete-frame) (other-window 1)))))) #+END_SRC #+ATTR_HTML: :width 100% :height 100% [[file:images/emacs-utilities-for-your-os/ivy_frame.gif]] So where's all this going? I wrote a utility to extract all links from [[https://raw.githubusercontent.com/xenodium/xenodium.github.io/master/index.org][this page's org file]] and make them easily searchable from anywhere on macOS by invoking *⌥-W*. The keys are bound using Lua, Hammerspoon, and emacsclient. This works well on macOS, but there are alternatives for other operating systems. #+BEGIN_SRC hs.execute("emacsclient -ne \""..elisp.."\" -s /tmp/emacs*/server") #+END_SRC Here's the resulting utility in action: #+ATTR_HTML: :width 100% :height 100% [[file:images/emacs-utilities-for-your-os/ivy_links.gif]] These integrations look promising. They enable me to bring cross-platform Emacs utilities into areas I hadn't considered. * [2018-07-01 Sun] Web serving tools bookmarks :PROPERTIES: :CUSTOM_ID: web-serving-tools-bookmarks :END: :MODIFIED: [2021-06-05 Sat] :END: - [[https://certbot.eff.org/][Certbot: Automatically enable HTTPS on your website, deploying Let's Encrypt certificates]]. - [[https://www.timdoug.com/log/2018/08/04/#wireguard_macos][How to configure WireGuard to tunnel traffic from a macOS client through a Debian server with IPv4 and IPv6]]. - [[http://irreal.org/blog/?p=7306][HTTPS Is Easy (Irreal)]]. - [[https://news.ycombinator.com/item?id=17689188][I made my own WireGuard VPN server (Hacker News)]]. - [[https://jsonapi.org/][JSON:API — A specification for building APIs in JSON]]. - [[https://mirage.io/][MirageOS: high-performance network applications across a variety of cloud computing and mobile platforms]]. - [[https://nginxconfig.io/][nginxconfig.io]]. - [[https://alex.dzyoba.com/blog/nginx-features-for-developers/][Nice nginx features for developers | There is no magic here]]. - [[https://idiallo.com/blog/handling-1-million-web-request][Poor man's way of handling 1.3 million web request]]. - [[https://www.getpostman.com/][Postman (API Development Environment)]]. - [[https://tools.suckless.org/quark/][quark: an extremely small and simple HTTP GET/HEAD-only web server for static content (suckless.org tools)]]. - [[https://github.com/pirate/wireguard-docs][The Missing Wireguard Documentation]]. - [[https://dev.to/ghardin137/web-authentication-for-actual-humans-part-two-ea6][Web Authentication for Actual Humans, Part Two - DEV Community]]. * [2018-06-24 Sun] URL shortener bookmarks :PROPERTIES: :CUSTOM_ID: url-shortener-bookmarks :END: - [[https://github.com/kellegous/go][go: Another Google-like Go short link service]]. - [[https://github.com/issmirnov/zap][zap: Blazing fast web shortcuts]]. * [2018-06-17 Sun] Trying out mu4e with mbsync :PROPERTIES: :CUSTOM_ID: trying-out-mu4e-with-mbsync :END: The email fun in Emacs continues. After a few weeks since I [[#trying-out-mu4e-and-offlineimap][started using mu4e and offlineimap]], I'm sold. Both are awesome. [[http://isync.sourceforge.net/mbsync.html][Mbsync]] is an [[http://www.offlineimap.org/][offlineimap]] alternative. Despite resyncing all my mail, the transition was fairly smooth. Here's how... ** Install isync (for mbsync) #+BEGIN_SRC sh brew install isync #+END_SRC ** Configure mbsync Mbsync uses ~~/.mbsyncrc~ for configuration. Migrating [[#trying-out-mu4e-and-offlineimap][~/.offlineimaprc]] to ~~/.mbsyncrc~ looks like: #+BEGIN_SRC conf IMAPAccount Personal Host some.imap.host.com User your_user_name PassCmd "gpg --quiet --batch -d ~/.offlineimap_accountname.gpg" Port 993 SSLType IMAPS AuthMechs Login CertificateFile ~/.offlineimapcerts.pem # My IMAP provider doesn't handle concurrent IMAP commands. PipelineDepth 1 IMAPStore Personal-remote Account Personal MaildirStore Personal-local Path ~/IMAP/Personal/ Inbox ~/IMAP/Personal/INBOX Channel Personal Master :Personal-remote: Slave :Personal-local: Patterns * Create Slave Sync All Expunge Both SyncState * #+END_SRC ** No concurrent IMAP commands supported My IMAP provider doesn't handle concurrent IMAP commands. [[https://kdecherf.com/blog/2017/05/01/mbsync-and-office-365/][mbsync and Office 365]] had the answer: #+BEGIN_SRC conf PipelineDepth 1 #+END_SRC ** Initial sync Run initial from the command line sync: #+BEGIN_SRC sh mbsync -Va #+END_SRC While syncing my largest inbox, it sometimes received an unexpected EOF error: #+BEGIN_SRC IMAP error: unexpected EOF from some.imap.host.com (1.2.3.4:993) #+END_SRC First few times, I restarted the syncing manually, but then used a loop to automatically restart it. Bash loops: #+BEGIN_SRC sh while true; do mbsync -V Personal; sleep 5; done #+END_SRC #+BEGIN_SRC sh for i in {1..5}; do mbsync -V Personal; sleep 5; done #+END_SRC Eshell loop: #+BEGIN_SRC sh for i in (number-sequence 1 10) {mbsync -V Personal; sleep 5} #+END_SRC ** Create mu index Reindex using mu, but first remove existing index for offlineimap messages: #+BEGIN_SRC sh rm -rf ~/.mu #+END_SRC Ok, do index now: #+BEGIN_SRC sh mu index --maildir=~/IMAP #+END_SRC ** Mu4e tweaks The /get mail/ command should now point to mbsync. #+BEGIN_SRC emacs-lisp (csetq mu4e-get-mail-command "mbsync -Va") #+END_SRC I had issues with duplicate IDs after moving and deleting messages from mu4e. [[http://pragmaticemacs.com/emacs/migrating-from-offlineimap-to-mbsync-for-mu4e/][Migrating from offlineimap to mbsync for mu4e]] had the answer: #+BEGIN_SRC emacs-lisp (csetq mu4e-change-filenames-when-moving t) #+END_SRC ** Helpful references - [[https://webgefrickel.de/blog/a-modern-mutt-setup][A modern mutt setup with neomutt, mbsync, msmtp and mu — part one | webgefrickel]]. - [[http://pragmaticemacs.com/emacs/migrating-from-offlineimap-to-mbsync-for-mu4e/][Migrating from offlineimap to mbsync for mu4e | Pragmatic Emacs]]. - [[https://copyninja.info/blog/email_setup.html][My personal Email setup - Notmuch, mbsync, postfix and dovecot]]. - [[https://github.com/jeremy-compostella/org-msg/blob/master/README.org][org-msg: Compose and reply to emails in a Outlook HTML friendly style]]. - [[http://www.ict4g.net/adolfo/notes/2014/12/27/EmacsIMAP.html][Reading IMAP Mail in Emacs on OSX]]. * [2018-06-15 Fri] Sticky function keys on touch bar :PROPERTIES: :CUSTOM_ID: sticky-function-keys-on-touch-bar :END: Visible (and sticky) function keys are not the touch bar default for Emacs. Let's change that: #+ATTR_HTML: :width 75% :height 75% [[file:images/sticky-function-keys-on-touch-bar/touchbar_function_keys.png]] * [2018-06-13 Wed] GNU find on macOS :PROPERTIES: :CUSTOM_ID: gnu-find-on-macos :END: At times, you may need GNU versions of command line utilities on macOS. For example, GNU find. As usual, Homebrew saves the day. Install with: #+BEGIN_SRC sh brew install findutils #+END_SRC Unless you install with --with-default-names (I don't), GNU utilities will be prefixed with a "g". #+BEGIN_SRC sh :results verbatim gfind --version #+END_SRC #+RESULTS: : find (GNU findutils) 4.6.0 : Copyright (C) 2015 Free Software Foundation, Inc. : License GPLv3+: GNU GPL version 3 or later . : This is free software: you are free to change and redistribute it. : There is NO WARRANTY, to the extent permitted by law. : : Written by Eric B. Decker, James Youngman, and Kevin Dalley. : Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS(FTS_CWDFD) CBO(level=2) If you need more, there are others: #+BEGIN_SRC sh brew install binutils brew install diffutils brew install ed brew install findutils brew install gawk brew install gnu-indent brew install gnu-sed brew install gnu-tar brew install gnu-which brew install gnutls brew install grep brew install gzip brew install screen brew install watch brew install wdiff --with-gettext brew install wget #+END_SRC * [2018-06-13 Wed] PlantUML bookmarks :PROPERTIES: :CUSTOM_ID: plantuml-bookmarks :END: :MODIFIED: [2020-06-27 Sat] :END: - [[https://scripter.co/notes/plantuml][Collection of PlantUML snippets from Scripter.co]]. - [[https://real-world-plantuml.com/][Real World PlantUML]]. - [[https://crashedmind.github.io/PlantUMLHitchhikersGuide/][Welcome to The Hitchhiker’s Guide to PlantUML!]]. * [2018-05-29 Tue] Adding mu4e maildirs extension :PROPERTIES: :CUSTOM_ID: adding-mu4e-maildirs-extension :END: Continuing the mu4e fun, added mu4e-maildirs-extension to display a mail dirs summary. #+ATTR_HTML: :width 75% :height 75% [[file:images/adding-mu4e-maildirs-extension/mu4e_maildirs_extension.png]] * [2018-05-28 Mon] Trying out mu4e and offlineimap :PROPERTIES: :CUSTOM_ID: trying-out-mu4e-and-offlineimap :END: #+ATTR_HTML: :width 75% :height 75% [[file:images/trying-out-mu4e-and-offlineimap/mu4e.png]] Managing Email from Emacs. Surely that's crazy-talk, but hey... let's give it a try. ** Install offlineimap Need to sync via imap. Use offlineimap. I'm on macOS, so homebrew is king for installing: #+BEGIN_SRC sh brew install offlineimap #+END_SRC Before can configure offlineimap, we'll need to handle a few things first. ** Get a cert fingerprint Use openssl for getting a certificate fingerprint. From offlineimap's [[http://www.offlineimap.org/doc/FAQ.html#view-the-fingerprint][FAQ:]] #+BEGIN_SRC sh SSL_CERT_DIR="" openssl s_client -connect imap.migadu.com:993 < /dev/null 2>/dev/null | openssl x509 -fingerprint -noout -text -in /dev/stdin #+END_SRC Should give you something like: #+BEGIN_QUOTE SHA1 Fingerprint=AA:BB:CC:DD:EE:DD:FF:AA:00:AA:2A:AA:AA:AA:A8:20:80:AA:A2:AA #+END_QUOTE ** Encrypt password Offlineimap can read passwords in plain text in its .offlineimaprc config file, but that's yuckie. Let's encrypt the password and use gnupg for that. Install it: #+BEGIN_SRC sh brew install gnupg #+END_SRC If you haven't already, generate a key #+BEGIN_SRC sh gpg --full-gen-key #+END_SRC Generate an offlineimap account password file. #+BEGIN_SRC sh echo "YourPassword" | gpg --encrypt --recipient "Your Name" -o ~/.offlineimap_accountname.gpg #+END_SRC ** Python password wrapper Based on Fabian's [[https://f-koehler.github.io/posts/2015-03-17-offlineimap-msmtp-gnupg.html][Encrypt OfflineIMAP and msmtp password with GnuPG]], I created ~/.read_password.py with: #+BEGIN_SRC python import os import subprocess def read_password(path): return subprocess.check_output(["gpg\n", "--quiet\n", "--batch\n", "-d\n", os.path.expanduser(path)]).strip() #+END_SRC ps. Alternatively, see [[http://stevelosh.com/blog/2012/10/the-homely-mutt/#retrieving-passwords][The homely Mutt]]'s section to store password in macOS's keychain. ** Configure offlineimap Offlineimap uses ~/.offlineimaprc for configuration. We now have all we need to put the configuration together: #+BEGIN_SRC conf [general] accounts = Personal # Load this python file. pythonfile = ~/.read_password.py [Account Personal] localrepository = Personal-Local remoterepository = Personal-Remote # After syncing, let mu index it. postsynchook = mu index --maildir ~/stuff/active/Mail # Sync imap every 5 minutes. autorefresh = 5 # Alternate between 10 quick syncs and full syncs. quick = 10 [Repository Personal-Local] type = Maildir localfolders = ~/stuff/active/Mail/Personal [Repository Personal-Remote] type = IMAP remotehost = some.imap.host.com remoteuser = your_user_name # Use function defined in .read_password.py to read the password. remotepasseval = read_password("~/.offlineimap_personal_account_password.gpg") # Use the SHA1 fingerprint retrieved with openssl. cert_fingerprint = aabbccddeeddffaa00aa2aaaaaaaa82080aaa2aa #+END_SRC *** Cert file You can use macOS's certificates from Keychain Access -> System Roots -> Certificates, select all, and ⌘-⇧-e (for export items). Save to ~/certs.pem and use offlineimap configutation: #+BEGIN_QUOTE sslcacertfile = /path/to/certs.pem #+END_QUOTE Another option is executing lib/mk-ca-bundle.pl from curl's tarball to generate ca-bundle.crt, using certdata.txt from Mozilla's source tree. ** Install mu4e Manually modified mu4e recipe to pick up my Emacs binary. TIL about homebrew's edit command: #+BEGIN_SRC sh brew edit mu #+END_SRC Changed the one line: #+BEGIN_QUOTE - ENV["EMACS"] = "no" if build.without? "emacs" + ENV["EMACS"] = "/Users/alvaro/homebrew/Cellar/emacs-plus/26.1-rc1_2/bin/emacs" #+END_QUOTE Finally installed mu4e: #+BEGIN_SRC sh brew install mu #+END_SRC ** Configure mu4e Lastly, configure mu4e: #+BEGIN_SRC emacs-lisp (add-to-list 'load-path (expand-file-name "~/homebrew/share/emacs/site-lisp/mu/mu4e")) (use-package mu4e :config ;; Update mail using 'U' in main view: (setq mu4e-get-mail-command "offlineimap") (setq mu4e-view-show-addresses t) (setq mu4e-attachment-dir (expand-file-name "~/Downloads/")) (setq mu4e-maildir "path/to/Mail") (setq mu4e-html2text-command "w3m -T text/html") ;; alternatively "textutil -stdin -format html -convert txt -stdout" (setq mu4e-user-mail-address-list '("myself@domain1.com" "myself@domain2.com")) (setq mu4e-context-policy 'pick-first) (setq mu4e-compose-context-policy 'always-ask) (setq mu4e-contexts (list (make-mu4e-context :name "domain1" :enter-func (lambda () (mu4e-message "Entering context myself@domain1.com")) :leave-func (lambda () (mu4e-message "Leaving context myself@domain1.com")) :match-func (lambda (msg) (when msg (mu4e-message-contact-field-matches msg '(:from :to :cc :bcc) "myself@domain1.com"))) :vars '((user-mail-address . "myself@domain1.com") (user-full-name . "My name") (mu4e-sent-folder . "/Domain1/Sent") (mu4e-drafts-folder . "/Domain1/Drafts") (mu4e-trash-folder . "/Domain1/Trash") (mu4e-compose-signature . nil) (mu4e-compose-format-flowed . nil) (smtpmail-smtp-user . "myself@domain1.com") (smtpmail-smtp-server . "smtp.domain1.com") (smtpmail-smtp-service . 587))) (make-mu4e-context :name "domain2" :enter-func (lambda () (mu4e-message "Entering context myself@domain2.com")) :leave-func (lambda () (mu4e-message "Leaving context myself@domain2.com")) :match-func (lambda (msg) (when msg (mu4e-message-contact-field-matches msg '(:from :to :cc :bcc) "myself@domain2.com"))) :vars '((user-mail-address . "myself@domain2.com") (user-full-name . "My name") (mu4e-sent-folder . "/Domain2/Sent") (mu4e-drafts-folder . "/Domain2/Drafts") (mu4e-trash-folder . "/Domain2/Trash") (mu4e-compose-signature . nil) (mu4e-compose-format-flowed . nil) (smtpmail-smtp-user . "myself@domain2.com") (smtpmail-smtp-server . "smtp.domain2.com") (smtpmail-smtp-service . 587)))))) (use-package smtpmail :config (setq smtpmail-stream-type 'starttls) (setq smtpmail-debug-info t) (setq smtpmail-warn-about-unknown-extensions t) (setq smtpmail-queue-mail t) (setq smtpmail-default-smtp-server nil) ;; Created with mu mkdir path/to/Mail/queue ;; Also avoid indexing. ;; touch path/to/Mail/queue/.noindex (setq smtpmail-queue-dir "path/to/Mail/queue/cur")) (use-package message :config (setq message-send-mail-function 'smtpmail-send-it)) #+END_SRC ** Authinfo Create an ~/.authinfo file for sendmail authentication with: #+BEGIN_SRC machine smtp.host1.com login account1@host1.com password somepassword1 machine smtp.host2.com login account2@host2.com password somepassword2 #+END_SRC Encrypt ~/.authinfo with M-x epa-encrypt-file. Keep ~/.authinfo.gpg and delete ~/.authinfo. ** Mu4e helpful references - [[http://cachestocaches.com/2017/3/complete-guide-email-emacs-using-mu-and-][A Complete Guide to Email in Emacs using Mu and Mu4e]]. - [[https://www.reddit.com/r/emacs/comments/5fkq7r/a_year_with_notmuch_mail_a_superfast_email_client/][A year with Notmuch mail - a super-fast email client available on Emacs]]. - [[https://dev.to/shrysr/archaic-text-based-email-clients-rock-3flm][Archaic: text based email clients rock - DEV Community (lots of great links)]]. - [[https://gist.github.com/areina/3879626][areina's Manage your email in emacs with mu4e]]. - [[https://notanumber.io/2016-10-03/better-email-with-mu4e/][Better Email with mu4e (NaN)]]. - [[https://vxlabs.com/2014/06/06/configuring-emacs-mu4e-with-nullmailer-offlineimap-and-multiple-identities/][Configuring Emacs mu4e with nullmailer, offlineimap and multiple identities]]. - [[http://www.macs.hw.ac.uk/~rs46/posts/2014-01-13-mu4e-email-client.html][Drowning in Email; mu4e to the Rescue]]. - [[https://ebzzry.io/en/emacs-mail/][Ebzzry: Setting up Mail in Emacs]]. - [[http://www.kirang.in/2014/11/13/emacs-as-email-client-with-offlineimap-and-mu4e-on-osx][Emacs as email client with offlineimap and mu4e on OS X]]. - [[https://zmalltalker.com/linux/mu.html][Email done right (mu)]]. - [[https://f-koehler.github.io/posts/2015-03-17-offlineimap-msmtp-gnupg.html][Encrypt OfflineIMAP and msmtp password with GnuPG]]. - [[https://etienne.depar.is/emacs.d/mu4e.html][Etienne's Mu4e customization]]. - [[https://github.com/OfflineIMAP/imapfw][GitHub - OfflineIMAP/imapfw: imapfw (IMAP/mail framework)]]. - [[https://github.com/kensanata/ggg][Gmail Gnus GPG Guide (GGGG)]]. - [[https://martinralbrecht.wordpress.com/2016/05/30/handling-email-with-emacs/][Handling Email with Emacs]] (helm included). - [[https://www.reddit.com/r/emacs/comments/5hfcid/i_got_mu4e_working/][I got mu4e working! (Reddit)]]. - [[https://blog.danielgempesaw.com/post/43467552978/installing-mu-and-mu4e-with-homebrew-with-emacs][Installing mu and mu4e with homebrew with emacs]]. - [[https://github.com/iqbalansari/dotEmacs/blob/master/config/mail.org][Iqbal Ansari's mail config]]. - [[https://github.com/iqbalansari/dotEmacs/blob/master/config/mail.org][iqbalansari/dotEmacs: calendar integration]]. - [[https://jherrlin.github.io/posts/emacs-mu4e/][Mail in Emacs with mu4e and mbsync (jherrlin)]]. - [[http://pragmaticemacs.com/emacs/master-your-inbox-with-mu4e-and-org-mode/][Master your inbox with mu4e and org-mode]]. - [[https://github.com/djcb/mu][Mu's github mirror]]. - [[http://www.djcbsoftware.nl/code/mu][Mu's page]]. - [[http://wenshanren.org/?p=111][mu4e: an E-mail Client for Emacs]]. - [[https://github.com/danielfleischer/mu4easy][mu4easy: mu4e + mbsync configuration for multiple accounts.]]. - [[http://rudolfochrist.github.io/blog/2015/03/21/offlineimap-with-ssl-files-on-osx/][OfflineIMAP with SSL files on OSX - Sebastian Christ]]. - [[https://news.ycombinator.com/item?id=14221501][OfflineIMAP: sync and backup tool for IMAP (Hacker News) and mbsync in comments]]. - [[https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/master/gnus-guide-en.org][Practical guide to use Gnus with Gmail]]. - [[http://pragmaticemacs.com/mu4e-tutorials/][Pragmatic Emacs's mu4e tutorials]]. - [[http://prodissues.com/2016/02/adding-mu4e-support-to-emacs.html][Prodissues: Adding mu4e Support To Emacs]]. - [[http://prodissues.com/2016/02/emacs-gpg-for-dummies.html][Prodissues: Emacs GPG For Dummies]]. - [[http://ict4g.net/adolfo/notes/2014/12/27/emacs-imap.html][Reading IMAP Mail in Emacs on OSX]]. - [[https://vxlabs.com/2019/07/03/send-queued-mails-in-background-with-mu4e/][Sending queued mails in the background with mu4e]]. - [[https://aliquote.org/post/setting-up-mu4e-1-0-c/][Setting Up Mu4e 1.0 C - aliquot]]. - [[https://dataswamp.org/~solene/2018-05-22-mu4esmtp.html][Solene's post: Sending mail with mu4e]]. - [[https://lars.ingebrigtsen.no/2014/12/01/the-emacs-network-security-manager][The Emacs Network Security Manager]]. - [[http://tech.memoryimprintstudio.com/the-ultimate-emailing-agent-with-mu4e-and-emacs][The Ultimate Emailing Agent with Mu4e and Emacs]]. - [[https://www.reddit.com/r/emacs/comments/8q84dl/tip_how_to_easily_manage_your_emails_with_mu4e/][TIP: How to easily manage your emails with mu4e (Reddit)]]. - [[https://etienne.depar.is/a-ecrit/post/2016/09/23/Two-custom-headers-for-mu4e][Two custom headers for mu4e - Étienne Deparis]]. - [[https://www.reddit.com/r/emacs/comments/73a3gp/using_emacs_to_read_gmail/][Using Emacs to read gmail (Emacs subreddit)]]. - [[http://www.brool.com/post/using-mu4e/][Using mu4e (Brool blog)]]. - [[https://github.com/zamansky/using-emacs/blob/master/mu4econfig-sample.el][Zamansky mu4e's sample config]]. - [[https://www.youtube.com/watch?v=newRHXKm4H4][Zamansky's video on mu4e]]. * [2018-05-24 Thu] Transparent Emacs titlebars on macOS :PROPERTIES: :CUSTOM_ID: transparent-emacs-titlebars-on-macos :END: Happy with [[https://github.com/d12frosted/homebrew-emacs-plus][Emacs Plus]] builds on Mac. You get some eye-candy bonuses like transparent titlebars. To install: #+BEGIN_SRC sh brew tap d12frosted/emacs-plus brew install emacs-plus --without-spacemacs-icon #+END_SRC Config: #+BEGIN_SRC emacs-lisp (when (memq window-system '(mac ns)) (add-to-list 'default-frame-alist '(ns-appearance . dark)) ; nil for dark text (add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))) #+END_SRC #+ATTR_HTML: :width 75% :height 75% [[file:images/transparent-emacs-titlebars-on-macos/transparent-emacs-titlebars-macos.png]] * [2018-05-24 Thu] Lunette: Like Spectacle but for Hammerspoon :PROPERTIES: :CUSTOM_ID: lunette-like-spectacle-but-for-hammerspoon :END: Came across [[https://github.com/scottwhudson/Lunette][Lunette]]. Gives ya Spectacle Keybindings for Hammerspoon. * [2018-05-23 Wed] Train Emacs to open files externally :PROPERTIES: :CUSTOM_ID: train-emacs-to-open-files-externally :END: TIL about the [[https://bitbucket.org/jpkotta/openwith][openwith]] package. It enables Emacs to defer to external programs for certain files. You choose which ones. Neat. #+BEGIN_SRC emacs-lisp (use-package openwith :ensure t :config (csetq openwith-associations '(("\\.\\(mp4\\|mp3\\|webm\\|avi\\|flv\\|mov\\)$" "open" (file)))) (openwith-mode 1)) #+END_SRC * [2018-05-22 Tue] Show hidden files in Finder :PROPERTIES: :CUSTOM_ID: show-hidden-files-in-finder :END: #+BEGIN_SRC sh defaults write com.apple.finder AppleShowAllFiles TRUE killall Finder #+END_SRC * [2018-05-22 Tue] Ejecting USB drives on Synology :PROPERTIES: :CUSTOM_ID: ejecting-usb-drives-on-synology :END: For posterity: #+BEGIN_QUOTE Control panel > External devices > USB Disk 1 > Eject #+END_QUOTE * [2018-05-21 Mon] Remounting Synology encrypted share :PROPERTIES: :CUSTOM_ID: remounting-synology-encrypted-share :END: Had been a while since I did this... for posterity: #+BEGIN_QUOTE Control panel > Shared Folder > Encryption > Mount #+END_QUOTE * [2018-05-20 Sun] Synology user had no home :PROPERTIES: :CUSTOM_ID: synology-user-had-no-home :END: Upon ssh'ing to a Synology box, the user had no home. #+BEGIN_QUOTE Could not chdir to home directory /var/services/homes/someone: No such file or directory #+END_QUOTE Fixed via: #+BEGIN_QUOTE Control Panel > User > Advanced > User Home > [x] Enable user home service #+END_QUOTE * [2018-04-30 Mon] Pre-commit hooks to save you from yourself :PROPERTIES: :CUSTOM_ID: pre-commit-hooks-to-save-you-from-yourself :END: Wanted to try out some code, but needed to ensure never checked in. Git pre-commit hooks are handy in this space. Add the following script to search for either @COMMITFAIL or @NOCOMMIT in the staged files. If found, attempts to commit will fail. Based on https://gist.github.com/rex/223b4be50285f6b8b3e06dea50d15887: #+BEGIN_SRC sh #!/bin/bash set -o nounset set -o errexit echo "Arguments:" echo "$@" echo "---" readonly FILES_PATTERN='(\..+)?$' readonly FORBIDDEN='(@?NOCOMMIT|@?COMMITFAIL)' if ( git diff --cached --name-only | grep -E "$FILES_PATTERN" | xargs grep -E --with-filename -n "$FORBIDDEN" ); then echo "ERROR: @COMMITFAIL or @NOCOMMIT found. Exiting to save you from yourself." exit 1 fi #+END_SRC Save to a file and create a symbolic link to your .git/hooks directory: #+BEGIN_SRC sh ln -s ../../git/commit-fail-pre-hook.sh .git/hooks/pre-commit #+END_SRC * [2018-04-19 Thu] Azores travel bookmarks :PROPERTIES: :CUSTOM_ID: azores-travel-bookmarks :END: :MODIFIED: [2018-05-08 Tue] :END: - [[http://www.fodors.com/go-list/2013/azores-islands/][Azores islands]]. - [[https://github.com/schilken/dot-hammerspoon][My configuration with init.lua and the require()ed modules]]. - [[http://www.lonelyplanet.com/travel-tips-and-articles/this-other-eden-the-azores-europes-secret-islands-of-adventure][This other Eden: the Azores, Europe's secret islands of adventure]]. * [2018-04-19 Thu] Debugging Emacs binary :PROPERTIES: :CUSTOM_ID: debugging-emacs-binary :END: From [[https://emacs.stackexchange.com/questions/14354/how-do-i-debug-an-emacs-crash][How do I debug an emacs crash? (Emacs Stack Exchange)]], disable optimizations when configuring and build: #+BEGIN_SRC sh CFLAGS="-O0 -g3" ./configure ... make #+END_SRC And good 'ol gdb (lldb works too): #+BEGIN_SRC sh gdb ../nextstep/Emacs.app/Contents/MacOS/Emacs #+END_SRC ** Reference - [[https://git.savannah.gnu.org/cgit/emacs.git/tree/etc/DEBUG][etc/DEBUG: Debugging GNU Emacs]]. * [2018-04-19 Thu] Paper less bookmarks :PROPERTIES: :CUSTOM_ID: paperless-bookmarks :END: :MODIFIED: [2018-05-26 Sat] :END: - [[https://github.com/danielquinn/paperless][danielquinn/paperless: Scan, index, and archive all of your paper documents]]. - [[http://www.karl-voit.at/2015/04/05/digitizing-paper/][Digitizing All Your Paper Stuff]]. - [[https://www.amazon.com/Fujitsu-ScanSnap-iX500-Duplex-Scanner/dp/B01G3JYVYM/ref=dp_ob_title_ce][Fujitsu ScanSnap iX500 Color Duplex Desk Scanner for Mac and PC]]. - [[http://www.jamierubin.net/2013/04/30/going-paperless-scanning-to-evernote-revisited/][Going Paperless: Scanning to Evernote, Revisited | Jamie Todd Rubin]]. - [[https://github.com/novoid/guess-filename.py][guess-filename.py: Derive a file name according to old file name cues and/or PDF file content]]. - [[http://www.noodlesoft.com/][Hazel for document/download management]]. - [[http://blog.matt-swain.com/post/26419042500/installing-tesseract-ocr-on-mac-os-x-lion][Installing Tesseract OCR on Mac OS X Lion]]. - [[http://irreal.org/blog/?p=5935][Paperless | Irreal]]. - [[http://solutions.weblite.ca/pdfocrx/][PDF OCR X - Mac & Windows OCR Software to convert PDFs and Images to Text]]. - [[http://www.documentsnap.com/batch-ocr-mac-fujitsu-scansnap/][Video: Batch OCR With The Mac Fujitsu ScanSnap]]. * [2018-04-18 Wed] Bologna travel bookmarks :PROPERTIES: :CUSTOM_ID: bologna-travel-bookmarks :END: - Il Cannone restaurant. * [2018-04-17 Tue] Grep through pdfs :PROPERTIES: :CUSTOM_ID: grep-through-pdfs :END: Late to the party, but investing in going paperless. Got a scanner with OCR, which generates searchable pdfs. If I could only grep through them... #+BEGIN_SRC sh brew install pdfgrep #+END_SRC Balance restored. * [2018-04-14 Sat] Hammerspoon bookmarks :PROPERTIES: :CUSTOM_ID: hammerspoon-bookmarks :END: :MODIFIED: [2019-04-22 Mon] :END: - [[https://github.com/peterpme/dotfiles/blob/master/hammerspoon/grid.lua][dotfiles/grid.lua at master]] for simple functions to resize windows. - [[https://gist.github.com/justintanner/71d640be159c2a76e85d5196cf22e98a][Emacs keys everywhere Hammerspoon Script]]. - [[http://zzamboni.org/post/getting-started-with-hammerspoon/][Getting Started With Hammerspoon (by Diego Martín Zamboni)]]. - [[https://github.com/agzam/spacehammer][Hammerspoon config inspired by Spacemacs]]. - [[http://zzamboni.org/post/just-enough-lua-to-be-productive-in-hammerspoon-part-1/][Just Enough Lua to Be Productive in Hammerspoon, Part 1]]. - [[http://zzamboni.org/post/just-enough-lua-to-be-productive-in-hammerspoon-part-2/][Just Enough Lua to Be Productive in Hammerspoon, Part 2]]. - [[https://github.com/anandpiyer/.dotfiles/blob/fb7bdf5d6382515f36587f2ada83330d83983624/.hammerspoon/init.lua#L200][launchOrFocusByBundleID]] for global key bindings (there are Emacs goodies there too). - [[https://github.com/schilken/dot-hammerspoon][My configuration with init.lua and the require()ed modules]]. - [[http://www.hammerspoon.org/Spoons/Seal.html][Seal]]. Helm-like for hammerspoon. - [[https://blog.kalis.me/setup-hyper-key-hammerspoon-macos/][Set up a Hyper Key with Hammerspoon on macOS]]. - [[https://github.com/asmagill/hammerspoon-config/blob/07ec892ab1351d2a7659d802e4cbfa8e8a0d5702/_scratch/zerobrane.lua][ZeroBrane completion]] and [[https://github.com/cmsj/hammerspoon-config/blob/master/init.lua][here]] also. * [2018-04-14 Sat] Options to reduce Go binary size :PROPERTIES: :CUSTOM_ID: options-to-reduce-go-binary-size :END: A Hacker News's thread [[https://news.ycombinator.com/item?id=16834181][Go gets preliminary WebAssembly support]] has a couple of tips to reduce binaries compiled with Go. #+BEGIN_SRC sh go build -ldflags=-s #+END_SRC [[https://upx.github.io/][UPX]] (Ultimate Packer for eXecutables) packs the binary further. #+BEGIN_SRC sh upx --ultra-brute #+END_SRC * [2018-04-09 Mon] Trying out tesseract :PROPERTIES: :CUSTOM_ID: trying-out-tesseract :END: As part of going paperless, looking into OCR. Trying out tesseract. Install #+BEGIN_SRC sh $ brew install gs $ brew install imagemagick $ brew install tesseract #+END_SRC #+BEGIN_SRC sh $ convert -density 300 -depth 8 receipt.pdf receipt.png $ tesseract receipt.png receipt.png.txt #+END_SRC * [2018-04-08 Sun] Sapporo travel bookmarks :PROPERTIES: :CUSTOM_ID: sapporo-travel-bookmarks :END: :MODIFIED: [2021-01-02 Sat] :END: - [[https://foodle.pro/restaurants/sapporo/175-0-deno-dandan-noodles][175 ° DENO Dandan Noodles, Sapporo]]. - [[https://www.vitra.com/en-gb/magazine/details/the-hill-of-the-buddha][The Hill of the Buddha]]. * [2018-04-08 Sun] Gif bookmarks :PROPERTIES: :CUSTOM_ID: gif-bookmarks :END: :MODIFIED: [2020-06-17 Wed] :END: - [[https://takinginitiative.wordpress.com/2020/03/07/an-idiots-guide-to-animation-compression/][An idiot’s guide to animation compression | Taking Initiative]]. - [[https://github.com/nwtgck/gif-progress/blob/develop/README.md][gif-progress: Attach progress bar to animated GIF]]. - [[https://gif.ski/][gifski — highest-quality GIF converter]]. - [[https://github.com/keycastr/keycastr][keycastr: an open-source keystroke visualizer]]. - [[https://github.com/phw/peek][phw/peek: Simple animated GIF screen recorder for Linux]]. * [2018-04-08 Sun] Trying out ShellCheck :PROPERTIES: :CUSTOM_ID: trying-out-shellcheck :END: [[https://github.com/koalaman/shellcheck][ShellCheck]] gives you automatic warnings/suggestions in bash/sh shell scripts. #+BEGIN_SRC sh $ brew install shellcheck #+END_SRC Bonus: If using Emacs's [[https://github.com/flycheck/flycheck][flycheck]], you get ShellCheck support out of the box. * [2018-04-08 Sun] Image editing bookmarks :PROPERTIES: :CUSTOM_ID: image-editing-bookmarks :END: :MODIFIED: [2020-07-11 Sat] :END: - [[https://news.ycombinator.com/item?id=17748266][Exif.tools – A multimedia file metadata tool (Hacker News)]]. - [[https://news.ycombinator.com/item?id=16668254][Fred's ImageMagick Scripts (Hacker News)]]. - [[https://linuxhint.com/howto_crop_gimp/][How to crop in GIMP (Linux Hint)]]. - [[https://linuxhint.com/imagemagick_sharpen_image/][ImageMagick to Sharpen an Image – Linux Hint]]. - [[https://news.ycombinator.com/item?id=23789934][Jpeg2png: Silky smooth JPEG decoding – no more artifacts (2016) | Hacker News]]. - [[https://twitter.com/pidybi/status/1278590835194564608][Make your own meme image using Imagemagick]]. - [[https://news.ycombinator.com/item?id=10222524][The Art of PNG Glitch (Hacker News)]]. - [[http://ucnv.github.io/pnglitch/][The Art of PNG Glitch]]. * [2018-04-05 Thu] Buying matcha powder online :PROPERTIES: :CUSTOM_ID: buying-matcha-powder-online :END: From Reddit's [[https://www.reddit.com/r/tea/comments/6qbh4l/matcha/][thread]]: - https://yunomi.life - https://shop.ippodo-tea.co.jp/kyoto/shopf/index.html - https://www.o-cha.com - http://hojotea.com/categ_e/viewe.htm - http://yuuki-cha.com - http://www.hibiki-an.com/index.php - http://www.thes-du-japon.com/index.php?main_page=index - https://www.chadoteahouse.com - https://www.denstea.com - https://www.sazentea.com/en - http://www.ujicha-kanbayashi.co.jp - http://www.marukyu-koyamaen.co.jp/products.html - http://www.fukumotoen.co.jp/shop/ - http://www.myokoen.com/shop/index.html * [2018-04-04 Wed] Getting macOS app bundle ID :PROPERTIES: :CUSTOM_ID: getting-macos-app-bundle-id :END: From [[https://stackoverflow.com/questions/39464668/how-to-get-bundle-id-of-mac-application#39464824][stack overflow]]: Option 1 #+BEGIN_SRC sh osascript -e 'id of app "Emacs"' #+END_SRC Option 2 #+BEGIN_SRC sh mdls -name kMDItemCFBundleIdentifier -r SomeApp.app #+END_SRC * [2018-03-31 Sat] Trying out chunkwm :PROPERTIES: :CUSTOM_ID: trying-out-chunkwm :END: #+ATTR_HTML: :width 75% :height 75% [[file:images/trying-out-chunkwm/chunkwm.png]] *** Installing [[https://github.com/koekeishiya/chunkwm][Chunkwm]] #+BEGIN_SRC sh $ brew tap crisidev/homebrew-chunkwm $ brew install --HEAD --with-tmp-logging chunkwm #+END_SRC Add a configuration file. Started off from this [[https://gist.github.com/shihanng/65b73712df2e51d4d78cc27c218bac35#file-chunkwmrc][example]]. #+BEGIN_QUOTE ~/.chunkwmrc chmod +x ~/.chunkwmrc #+END_QUOTE *Note*: Ensure core::plugin_dir matches homebrew's plugin directory. Typically something like: //path/to/homebrew/opt/chunkwm/share/chunkwm/plugins/ Start chunkwmrc service. #+BEGIN_SRC sh $ brew services start crisidev/chunkwm/chunkwm #+END_SRC *** Installing [[https://github.com/koekeishiya/skhd][skhd]] (a hotkey daemon) #+BEGIN_SRC sh $ brew install --HEAD --with-logging koekeishiya/formulae/skhd #+END_SRC Start skhd service. #+BEGIN_SRC sh $ brew services start koekeishiya/formulae/skhd #+END_SRC Skhd logs location. #+BEGIN_SRC sh /Users/you/homebrew/var/log/skhd/skhd.[out|err].log #+END_SRC Add a configuration file. Started off from this [[https://raw.githubusercontent.com/koekeishiya/chunkwm/master/src/plugins/tiling/examples/khdrc][example]]. #+BEGIN_SRC sh ~/.skhdrc chmod +x ~/.skhdrc #+END_SRC *** Installing [[https://github.com/koekeishiya/skhd][khd]] (easily invoke hotkeys from terminal) #+BEGIN_SRC sh $ brew install khd #+END_SRC Some additional Mission Control and keyboard shortcut preferences: #+ATTR_HTML: :width 75% :height 75% [[file:images/trying-out-chunkwm/mission_control.png]] #+ATTR_HTML: :width 75% :height 75% [[file:images/trying-out-chunkwm/keyboard_shortcuts.png]] * [2018-02-06 Tue] Building bazel on macOS :PROPERTIES: :CUSTOM_ID: building-bazel-on-macos :END: ** Bootstrap #+BEGIN_SRC sh brew tap bazelbuild/tap brew install bazelbuild/tap/bazel #+END_SRC ** Build #+BEGIN_SRC sh git clone https://github.com/bazelbuild/bazel.git cd bazel bazel build //src:bazel #+END_SRC ** Get your bazel binary #+BEGIN_SRC Self-contained binary in bazel-bin/src/bazel #+END_SRC ** Known revisions - https://github.com/bazelbuild/bazel.git @ d81a46cebe07f73d3ea38206262cf7a1a9513b42 - https://github.com/bazelbuild/rules_apple.git @ e921a9f727e039c8b5087d4f98c5d09f189658cd * [2018-01-07 Sun] Extracting files from pkg :PROPERTIES: :CUSTOM_ID: extracting-files-from-pkg :END: #+BEGIN_SRC sh mkdir tmp cd tmp xar -xf ../Some.pkg cat Payload | gunzip -dc |cpio -i #+END_SRC * [2018-01-07 Sun] Installing Inkscape with homebrew :PROPERTIES: :CUSTOM_ID: installing-inkscape-with-homebrew :END: #+BEGIN_SRC sh brew tap caskroom/cask brew install caskformula/caskformula/inkscape #+END_SRC * [2017-12-16 Sat] Magit amend commit author :PROPERTIES: :CUSTOM_ID: magit-amend-commit-author :END: Rarely use it, but handy. Use Magit to amend git commit author. - Rebase interactively (r, i). - Move point to commit to ammend. - Execute command (x). #+BEGIN_SRC sh git commit --amend --author="name " #+END_SRC - Commit (c, c). #+ATTR_HTML: :width 75% :height 75% [[file:images/amend-git-commit-author-on-magit/amending.gif]] * [2017-12-13 Wed] Homebrew install from cache :PROPERTIES: :CUSTOM_ID: homebrew-install-from-cache :END: Came across a 404 while installing graphviz-2.40.1.tar.gz via homebrew. If you can find the package elsewhere, copy over to homebrew's cache directory. #+BEGIN_SRC sh brew --cache #+END_SRC #+RESULTS: /Users/User/Library/Caches/Homebrew * [2017-11-16 Thu] org-babel Objective-C support :PROPERTIES: :CUSTOM_ID: org-babel-objective-c-support :END: Wanted to quickly execute an Objective-C snippet. org-babel didn't support it out of the box, but adding it was straightforward (looked at ob-C.el and ob-java.el): #+BEGIN_SRC emacs-lisp (require 'ob) (defcustom org-babel-objc-compile-command "clang -x objective-c -framework Foundation" "For example: \"clang -x objective-c -framework Foundation\"." :group 'org-babel :version "24.3" :type 'string) (defun org-babel-execute:objc (body params) "Compile Objective-C BODY with org PARAMS and execute binary." (let* ((src-file (org-babel-temp-file "org-babel-objc-block-" ".m")) (cmpflag (or (cdr (assq :cmpflag params)) "")) (full-body (org-babel-expand-body:generic body params)) (bin-file (org-babel-process-file-name (org-babel-temp-file "org-babel-objc-block" org-babel-exeext)))) (with-temp-file src-file (insert full-body)) (org-babel-eval (concat org-babel-objc-compile-command " " cmpflag " " src-file " " "-o" " " bin-file) "") ;; Using 2>&1 since org babel does not include stderr in output from NSLog. (let ((results (org-babel-eval (concat (org-babel-process-file-name bin-file) " 2>&1") ""))) (org-babel-reassemble-table (org-babel-result-cond (cdr (assq :result-params params)) (org-babel-read results) (let ((tmp-file (org-babel-temp-file "c-"))) (with-temp-file tmp-file (insert results)) (org-babel-import-elisp-from-file tmp-file))) (org-babel-pick-name (cdr (assq :colname-names params)) (cdr (assq :colnames params))) (org-babel-pick-name (cdr (assq :rowname-names params)) (cdr (assq :rownames params))))))) (provide 'ob-objc) #+END_SRC Add /objc/ to /org-babel-load-languages/, and you can subsequently compile and run Objective-C blocks like: #+BEGIN_SRC objc :results verbatim #import int main() { NSLog(@"Hello World"); return 0; } #+END_SRC #+RESULTS: : 2017-11-16 01:47:28.923 org-babel-objc-block-Aai8ux[15319:346480] Hello World * [2017-11-12 Sun] iOS dev command-line goodies :PROPERTIES: :CUSTOM_ID: ios-dev-command-line-goodies :END: ** Install ipa on device Get utility with: #+BEGIN_SRC sh npm install -g ipa-deploy npm install -g ios-deploy #+END_SRC Install ipa on connected iPhone: #+BEGIN_SRC sh ipa-deploy path/to/your/App.ipa #+END_SRC ** Install app on booted simulator Install ipa on connected iPhone: #+BEGIN_SRC sh xcrun simctl install booted path/to/your/App.app #+END_SRC ** Install ipa on booted simulator #+BEGIN_SRC sh #!/bin/bash # Unzip ipa, install app, and run on booted simulator. set -o nounset set -o errexit readonly IPA_PATH=$1 readonly TEMP_DIR_PATH=$(mktemp -d) readonly BASENAME=$(basename ${IPA_PATH}) readonly NAME=${BASENAME%.*} readonly APP_DIR_PATH="${TEMP_DIR_PATH}/Payload/${NAME}.app" readonly PLIST_FILE_PATH="${APP_DIR_PATH}/Info.plist" trap "rm -rf ${TEMP_DIR_PATH}" EXIT unzip -o "${IPA_PATH=}" -d "${TEMP_DIR_PATH}" readonly BUNDLE_ID=$(/usr/libexec/PlistBuddy -c "Print CFBundleIdentifier" ${PLIST_FILE_PATH}) xcrun simctl install booted "${APP_DIR_PATH}" xcrun simctl launch booted "${BUNDLE_ID}" #+END_SRC * [2017-11-01 Wed] Eshell pcomplete company completion :PROPERTIES: :CUSTOM_ID: eshell-pcomplete-company-completion :END: Howard Abrams's [[https://www.youtube.com/watch?v=RhYNu6i_uY4][Introduction to eshell video]] prompted me to poke at eshell some more. This time, I got eshell context aware completion by glueing the excellent [[https://company-mode.github.io][company]] and [[https://masteringemacs.org/article/pcomplete-context-sensitive-completion-emacs][pcomplete]] packages. #+ATTR_HTML: :width 75% :height 75% [[file:images/eshell-pcomplete-company-completion/company-pcomplete.png]] #+BEGIN_SRC emacs-lisp (require 'cl-lib) (require 'company) (require 'dash) (require 'pcomplete) (require 's) (defun company-pcomplete--overlap-tail (a b) "When A is \"SomeDev\" and B is \"Developer\", return \"eloper\"." (let ((prefix a) (remaining nil)) (while (and (not remaining) (> (length prefix) 0)) (when (s-starts-with? prefix b) (setq remaining (substring b (length prefix)))) (setq prefix (substring prefix 1))) remaining)) (defun company-pcomplete--candidates (prefix) "Get candidates for PREFIX company completion using `pcomplete'." ;; When prefix is: "~/Down" and completion is "Downloads", need ;; to find common string and join into "~/Downloads/". (-map (lambda (item) (if (s-starts-with? prefix item) item (concat prefix (company-pcomplete--overlap-tail prefix item)))) (all-completions prefix (pcomplete-completions)))) (defun company-pcomplete (command &optional arg &rest ignored) "Complete using pcomplete. See `company''s COMMAND ARG and IGNORED for details." (interactive (list 'interactive)) (case command (interactive (company-begin-backend 'company-pcomplete)) (prefix (company-grab-symbol)) (candidates (company-pcomplete--candidates arg)))) #+END_SRC Don't forget to add /company-pcomplete/ to /company-backends,/ and if you want an explicit binding, use something like: #+BEGIN_SRC emacs-lisp (bind-key "" #'company-complete eshell-mode-map) #+END_SRC * [2017-09-10 Sun] Basic imenu in helpful-mode :PROPERTIES: :CUSTOM_ID: basic-imenu-in-helpful-mode :END: I'm finding Wilfred Hughes's [[https://github.com/Wilfred/helpful][helpful-mode]], well... rather helpful. However, I'm missing imenu support. Here's a hacky way to get basic imenu. #+ATTR_HTML: :width 75% :height 75% [[file:images/basic-imenu-for-helpful-mode/helpful-imenu.png]] #+BEGIN_SRC emacs-lisp (defun helpful--create-imenu-index () "Create an `imenu' index for helpful." (beginning-of-buffer) (let ((imenu-items '())) (while (progn (beginning-of-line) ;; Not great, but determine if looking at heading: ;; 1. if it has bold face. ;; 2. if it is capitalized. (when (and (eq 'bold (face-at-point)) (string-match-p "[A-Z]" (buffer-substring (line-beginning-position) (line-end-position)))) (add-to-list 'imenu-items (cons (buffer-substring (line-beginning-position) (line-end-position)) (line-beginning-position)))) (= 0 (forward-line 1)))) imenu-items)) (defun helpful-mode-hook-function () "A hook function for `helpful-mode'." (setq imenu-create-index-function #'helpful--create-imenu-index)) (add-hook 'helpful-mode-hook #'helpful-mode-hook-function) #+END_SRC * [2017-08-19 Sat] Projectile shell dir company completion :PROPERTIES: :CUSTOM_ID: projectile-shell-dir-company-completion :END: [[https://github.com/bbatsov/projectile][Projectile]] and [[https://company-mode.github.io][company]] are just amazing Emacs packages. Projectile gives random access to files, while company completes well... anything. For shells, Emacs has a handful of options. Standing on the shoulders of package giants ([[https://github.com/magnars/dash.el][dash]] and [[https://github.com/rejeep/f.el][f]] included) and some elisp, we can bring random access to project directories from the shell. #+ATTR_HTML: :width 75% :height 75% [[file:images/projectile-shell-dir-company-completion/company-projectile-cd.png]] #+BEGIN_SRC emacs-lisp (require 'cl-lib) (require 'company) (require 'dash) (require 'f) (require 'projectile) (defvar-local company-projectile-cd-prefix "cd ") (defun company-projectile-cd (command &optional arg &rest ignored) "Company shell completion for any projectile path." (interactive (list 'interactive)) (case command (interactive (company-begin-backend 'company-projectile-cd)) (prefix (company-grab-symbol-cons company-projectile-cd-prefix (length company-projectile-cd-prefix))) (candidates (company-projectile-cd--candidates (company-grab-symbol-cons company-projectile-cd-prefix (length company-projectile-cd-prefix)))) (post-completion (company-projectile-cd--expand-inserted-path arg)))) (defun company-projectile-cd--candidates (input) "Return candidates for given INPUT." (company-projectile-cd--reset-root) (when (consp input) (let ((search-term (substring-no-properties (car input) 0 (length (car input)))) (prefix-found (cdr input))) (when prefix-found (if (projectile-project-p) (company-projectile-cd--projectile search-term) (company-projectile-cd--find-fallback search-term)))))) (defun company-projectile-cd--projectile (search-term) (-filter (lambda (path) (string-match-p (regexp-quote search-term) path)) (-snoc (projectile-current-project-dirs) ;; Throw project root in there also. (projectile-project-root)))) (defun company-projectile-cd--find-fallback (search-term) (ignore-errors (-map (lambda (path) (string-remove-prefix "./" path)) (apply #'process-lines (list "find" "." "-type" "d" "-maxdepth" "2" "-iname" (format "\*%s\*" search-term)))))) (defun company-projectile-cd--expand-inserted-path (path) "Replace relative PATH insertion with its absolute equivalent if needed." (unless (f-exists-p path) (delete-region (point) (- (point) (length path))) (insert (concat (projectile-project-root) path)))) (defun company-projectile-cd--reset-root () "Reset project root. Useful when cd'ing in and out of projects." (projectile-reset-cached-project-root) (when (projectile-project-p) (projectile-project-root))) #+END_SRC * [2017-08-09 Wed] Creating icns icons :PROPERTIES: :CUSTOM_ID: creating-icns-icons :END: Stack overflow yields [[https://stackoverflow.com/questions/12437433/where-can-i-find-icon-composer-on-mac][Where can i find Icon Composer on Mac?]] when I did a quick search to convert a png to icns. For future reference: #+BEGIN_SRC sh #!/bin/bash -e set -e set -o pipefail if [ "$#" -ne 1 ]; then echo "\nusage: to_icns.sh path/to/image.png\n" exit 1 fi readonly IMAGE_FPATH=$1 readonly BASENAME=$(basename ${IMAGE_FPATH%.*}) mkdir ${BASENAME}.iconset sips -z 16 16 $IMAGE_FPATH --out "${BASENAME}.iconset/icon_16x16.png" sips -z 32 32 $IMAGE_FPATH --out "${BASENAME}.iconset/icon_16x16@2x.png" sips -z 32 32 $IMAGE_FPATH --out "${BASENAME}.iconset/icon_32x32.png" sips -z 64 64 $IMAGE_FPATH --out "${BASENAME}.iconset/icon_32x32@2x.png" sips -z 128 128 $IMAGE_FPATH --out "${BASENAME}.iconset/icon_128x128.png" sips -z 256 256 $IMAGE_FPATH --out "${BASENAME}.iconset/icon_128x128@2x.png" sips -z 256 256 $IMAGE_FPATH --out "${BASENAME}.iconset/icon_256x256.png" sips -z 512 512 $IMAGE_FPATH --out "${BASENAME}.iconset/icon_256x256@2x.png" sips -z 512 512 $IMAGE_FPATH --out "${BASENAME}.iconset/icon_512x512.png" cp $IMAGE_FPATH "${BASENAME}.iconset/icon_512x512@2x.png" iconutil -c icns ${BASENAME}.iconset rm -R ${BASENAME}.iconset echo Wrote ${BASENAME}.icns #+END_SRC * [2017-08-06 Sun] Forcing aptX on MacOS bluetooth audio :PROPERTIES: :CUSTOM_ID: forcing-aptx-on-macos-bluetooth-audio :END: Bought a pair of QuietComfort 35. Audio quality on MacOS was lagging compared to iOS. Googling led to different posts suggesting the use of Bluetooth Explorer to force aptX usage. Did the trick for me. *Bluetooth Explorer* can be downloaded from https://developer.apple.com/download/more. Search for Hardware IO tools: #+ATTR_HTML: :width 75% :height 75% [[file:images/forcing-aptx-on-macos-bluetooth-audio/download-bluetooth-explorer.png]] Open *Hardware_IO_Tools_for_Xcode_7.3.dmg* and launch *Bluetooth Explorer*: #+ATTR_HTML: :width 75% :height 75% [[file:images/forcing-aptx-on-macos-bluetooth-audio/tools-image.png]] Select *Audio Options*: #+ATTR_HTML: :width 75% :height 75% [[file:images/forcing-aptx-on-macos-bluetooth-audio/audio-options.png]] Check *Force use of aptX*: #+ATTR_HTML: :width 75% :height 75% [[file:images/forcing-aptx-on-macos-bluetooth-audio/force-aptx.png]] Don't forget to disconnect and reconnect your Bluetooth device. * [2017-07-10 Mon] Hungary travel bookmarks :PROPERTIES: :CUSTOM_ID: hungary-travel-bookmarks :END: - [[https://www.lonelyplanet.com/hungary/budapest/travel-tips-and-articles/my-city-budapest/40625c8c-8a11-5710-a052-1479d276913c?][My city: Budapest - Lonely Planet]]. * [2017-07-08 Sat] Faster cursor movement on macOS :PROPERTIES: :CUSTOM_ID: faster-cursor-movement-on-macos :END: Faster cursor movement on macOS by increasing your keyboard's initial key repeat subsequent key repeat. #+BEGIN_SRC sh defaults write -g KeyRepeat -int 1 defaults write -g InitialKeyRepeat -int 10 #+END_SRC * [2017-07-07 Fri] Search/insert one-liners with Emacs helm-ag :PROPERTIES: :CUSTOM_ID: search-insert-one-liners-with-emacs-helm-ag :END: Emacs [[https://github.com/emacs-helm/helm][helm]] is awesome. [[https://github.com/syohex/emacs-helm-ag][helm-ag]] is double awesome. Searching for one-liners in your codebase, narrowing down with helm, and easily inserting is triple awesome. #+ATTR_HTML: :width 75% :height 75% [[file:images/search-and-insert-one-liners-with-helm-ag/helm-ag-insert.gif]] #+BEGIN_SRC emacs-lisp (defun ar/helm-ag (arg) "Helm-ag search remembering last location. With ARG, forget the last location." (interactive "P") (defvar ar/helm-ag--default-locaction nil) (setq ar/helm-ag--default-locaction (read-directory-name "search in: " (if arg default-directory ar/helm-ag--default-locaction) nil t)) (helm-do-ag ar/helm-ag--default-locaction)) (defun ar/helm-ag-insert (arg) ;; Helm-ag and insert match. (interactive "P") (let* ((actions (helm-make-actions "Insert" (lambda (candidate) ;; Drop file:line:column. For example: ;; arc_hostlink.c:13:2:#include ;; => #include (insert (replace-regexp-in-string "^[^ ]*:" "" candidate))))) (helm-source-do-ag (helm-build-async-source "The Silver Searcher" :init 'helm-ag--do-ag-set-command :candidates-process 'helm-ag--do-ag-candidate-process :persistent-action 'helm-ag--persistent-action :action actions :nohighlight t :requires-pattern 3 :candidate-number-limit 9999 :keymap helm-do-ag-map :follow (and helm-follow-mode-persistent 1)))) (call-interactively #'ar/helm-ag))) #+END_SRC * [2017-05-29 Mon] Sleep bookmarks :PROPERTIES: :CUSTOM_ID: sleep-bookmarks :END: :MODIFIED: [2019-03-12 Tue] :END: - [[https://news.ycombinator.com/item?id=15997016][Algorithmic Solution to My Insomnia (Hacker News)]]. - [[https://www.gwern.net/Melatonin][Melatonin - Gwern.net]]. - [[https://slatestarcodex.com/2018/07/10/melatonin-much-more-than-you-wanted-to-know][Melatonin: Much More Than You Wanted To Know | Slate Star Codex]]. * [2017-05-28 Sun] Tea bookmarks :PROPERTIES: :CUSTOM_ID: tea-bookmarks :END: :MODIFIED: [2018-12-09 Sun] :END: - [[http://www.notesontea.com][Georgia's notes on tea]]. - [[https://www.drweil.com/videos-features/videos/9-green-teas-to-try/][Nine Green Teas To Try | Video (Andrew Weil, M.D.)]]. * [2017-04-23 Sun] Math bookmarks :PROPERTIES: :CUSTOM_ID: math-bookmarks :END: :MODIFIED: [2021-11-09 Tue] :END: - [[https://www.3blue1brown.com/#lessons][3Blue1Brown]]. - [[https://news.ycombinator.com/item?id=14161876][Calculus Made Easy (1914) (Hacker News)]]. - [[https://math.stackexchange.com/questions/733754/visually-stunning-math-concepts-which-are-easy-to-explain][Visually stunning math concepts which are easy to explain]]. * [2017-04-23 Sun] GnuPG and macOS :PROPERTIES: :CUSTOM_ID: gnupg-and-macos :END: Had problems installing and using GnuPG on macOS, primarily for Emacs use: #+BEGIN_EXAMPLE gpg: problem with the agent: Inappropriate ioctl for device gpg: error creating passphrase: Operation cancelled gpg: symmetric encryption of '[stdin]' failed: Operation cancelled #+END_EXAMPLE Basic installation required: #+BEGIN_SRC sh brew install gnupg #+END_SRC But worked around the error above by using pinentry-mac (UI), instead of Emacs prompts. #+BEGIN_SRC sh brew install pinentry-mac #+END_SRC Edited ~/.gnupg/gpg-agent.conf with: #+BEGIN_EXAMPLE pinentry-program path/to/homebrew/bin/pinentry-mac #+END_EXAMPLE May need to kill gpg-agent to reload config. #+BEGIN_SRC sh gpgconf --kill gpg-agent #+END_SRC * [2017-03-13 Mon] Installing gnuplot on macOS :PROPERTIES: :CUSTOM_ID: installing-gnuplot-on-macos :END: UPDATE(2019-05-19 Sun): Plan A and B use options no longer available since the recent changes to [[https://github.com/Homebrew/homebrew-core/issues/31510][remove all options from Homebrew/homebrew-core formulae]]. See Plan C. ** +Plan A+ *** +Install gnuplot Qt+ +If you have the resources, you can try the Qt flavor. You need at least 15GB to download and a long build. Ran out of space on my Macbook Air. Aborted.+ #+BEGIN_SRC sh brew install gnuplot --with-qt #+END_SRC ** +Plan B+ *** +Install xquartz+ #+BEGIN_SRC sh brew install Caskroom/cask/xquartz #+END_SRC *** +Install gnuplot x11+ #+BEGIN_SRC sh brew install gnuplot --with-x11 #+END_SRC ** Install feedgnuplot Feedgnuplot is handy for plotting data streams realtime. #+BEGIN_SRC sh brew install feedgnuplot #+END_SRC ** Plan C *** Install with no options #+BEGIN_SRC sh brew install gnuplot #+END_SRC So far so good, but default gnuplot formula uses Qt and the Cocoa plugin could not be loaded: #+begin_quote qt.qpa.plugin: Could not find the Qt platform plugin "cocoa" in "" #+end_quote *** Debugging **** QT_DEBUG_PLUGINS Turns out you can get plugin logs using the QT_DEBUG_PLUGINS environment variable: #+begin_src sh export QT_DEBUG_PLUGINS=1 #+end_src #+begin_quote QFactoryLoader::QFactoryLoader() checking directory path "/Users/myuser/homebrew/Cellar/gnuplot/5.2.6_1/libexec/gnuplot/5.2/platforms" ... #+end_quote This led me to find out about the /gnuplot/5.2/gnuplot_qt/ binary. **** qt_prfxpath Getting the Qt prefix can be done by inspecting QtCore's strings: #+begin_src sh :results output :exports both strings /Users/myuser/homebrew/Cellar/qt/5.12.3/Frameworks/QtCore.framework/QtCore | grep qt_prfxpath #+end_src #+RESULTS: : qt_prfxpath=/usr/local/Cellar/qt/5.12.3 Ok so qt_prfxpath is pointing to //usr/local/Cellar/qt/, while my installation's is at //Users/myuser/homebrew/Cellar/qt/. This is problematic and indeed my fault for installing homebrew in //Users/myuser/homebrew/ instead of the recommended //usr/local/. Symlinking did the job: #+begin_src sh sudo mkdir -p /usr/local/Cellar sudo ln -s ~/homebrew/Cellar/qt /usr/local/Cellar/qt #+end_src #+begin_src sh /Users/myuser/homebrew/Cellar/gnuplot/5.2.6_1/libexec/gnuplot/5.2/gnuplot_qt #+end_src #+RESULTS: : QFactoryLoader::QFactoryLoader() checking directory path "/Users/myuser/homebrew/Cellar/qt/5.12.3/plugins/platforms" ... : QFactoryLoader::QFactoryLoader() looking at "/Users/myuser/homebrew/Cellar/qt/5.12.3/plugins/platforms/libqcocoa.dylib" : Found metadata in lib /Users/myuser/homebrew/Cellar/qt/5.12.3/plugins/platforms/libqcocoa.dylib Success. * [2017-01-22 Sun] Tel Aviv travel bookmarks :PROPERTIES: :CUSTOM_ID: tel-aviv-travel-bookmarks :END: :MODIFIED: [2019-01-27 Sun] :END: - Breakfast club (dancing). - Claro/Sarona Market. - [[https://en.wikipedia.org/wiki/Dizengoff_Square][Dizengoff Square - Wikipedia]]. - Drink Cafe hafuch at Rothschild 12. - Jaffa's Flea market. - Nightlife: Kuli Alma's hipster haven. Imperial craft cocktail bar (drink Gold fashioned). - Park HaYarkon. - Tel Aviv museum of art. * [2017-01-22 Sun] Jerusalem travel bookmarks :PROPERTIES: :CUSTOM_ID: jerusalem-travel-bookmarks :END: - Jerusalem: Rooftop Mamilla restarurant. * [2017-01-22 Sun] Nepal travel bookmarks :PROPERTIES: :CUSTOM_ID: nepal-travel-bookmarks :END: :MODIFIED: [2024-03-09 Sat] :END: - [[https://www.erikastravelventures.com/annapurna-circuit-itinerary/][Annapurna Circuit Itinerary - Erika's Travelventures]]. - [[https://www.planetware.com/pictures/nepal-nep.htm][Nepal in Pictures: 19 Beautiful Places to Photograph]]. - [[https://en.wikipedia.org/wiki/Patan_Durbar_Square][Patan Durbar square]]. - [[https://vargiskhan.com/log/truth-behind-mysterious-magnetic-hill-of-ladakh/][The Truth Behind the Mysterious Magnetic Hill of Ladakh - Vargis Khan]]. * [2016-12-02 Fri] Singapore notes :PROPERTIES: :CUSTOM_ID: singapore-notes :END: - Hotel Mono, 18 Mosque street #01-04. - Buddha tooth relic museum. - [[http://www.telegraph.co.uk/travel/picturegalleries/8308524/Singapores-best-hawker-centres.html][Best Hawker centers]]. - Kong Meng San Phor Kark See Monastery. - [[http://gothere.sg][Go there (figure out fastest MRT route)]]. - [[http://2bearbear.com/what-to-eat-at-abc-market-hawker-centre-abc-brickworks-food-centre/][What to eat at ABC Market (Hawker Centre) aka ABC Brickworks Food Centre?]]. - Curry puffs (see [[http://www.hungrygowhere.com/gallery/taste-test-crisp-curry-puffs-*gid-39443101/][Taste test: Crisp curry puffs]]). - [[http://thepeakmagazine.com.sg/2016/07/its-official-here-are-singapores-17-michelin-rated-hawker-stalls-in-2016/][Singapore’s 17 Michelin-rated Hawker Stalls in 2016]]. - Temples - [[http://burmesebuddhisttemple.org.sg/index.htm][Sasanaramsi Burmese temple (14, Tai Gin Road, Singapore 327873)]]. - [[https://en.wikipedia.org/wiki/Thian_Hock_Keng][Thian Hock Keng temple]]. - [[http://sultanmosque.sg][Sultan Mosque]]. - Hawkers - Mr and Mrs Mohgan's Super Crispy Roti Prata ([[http://www.hungrygowhere.com/gallery/hgw-s-best-hawker-food-for-2015-*gid-75813101/16560200][source]]) on Crane Road. Dhal/fish/mutton curry side. - Roast Paradise (maybe) Address: #01-122 Old Airport Road Food Centre. Hours: Tues-Sun: 11am to 4pm or till sold out, Wed and Sun: 11am to 2pm, Closed on Mondays. - Fatty Cheong, 肥仔详, (#01-120, ABC Brickworks Food Centre, 6 Jalan Bukit Merah Singapore 150006): char siew and xio bak rice and char siew noodles. - Hoo Kee Bak Chang (Amoy Street Food Centre): bak zhang (glutinous rice dumpling). Try Choose from three kinds: chestnut ($2.80); chestnut with salted egg yolk ($3.60); and chestnut with mushroom ($3.60). - Lim Kee (Orchard) Banana Fritters (Maxwell food centre, [[http://www.hungrygowhere.com/gallery/hgw-s-best-hawker-food-for-2015-*gid-75813101/0e560200][source]]). - Mr Avocado Exotic Juice (Alexandra village food centre, [[http://www.hungrygowhere.com/gallery/hgw-s-best-hawker-food-for-2015-*gid-75813101/19560200][source]]). - Tanglin Crispy Curry Puff (Hong Lim Food Centre or Maxwell, [[http://www.hungrygowhere.com/gallery/hgw-s-best-hawker-food-for-2015-*gid-75813101/65560200][source]]) (东陵酥皮咖喱角). Try sardine curry puff? - Chuan Kee Satay ([[http://www.hungrygowhere.com/gallery/hgw-s-best-hawker-food-for-2015-*gid-75813101/63560200][source]]). Long queue for pork satay. - Selera Rasa Nasi Lemak ([[http://www.hungrygowhere.com/gallery/hgw-s-best-hawker-food-for-2015-*gid-75813101/6b560200][source]]). - Fu Shun Jin Ji Shao La Mian Jia (Maxwell food centre, [[http://www.hungrygowhere.com/dining-guide/hawker/food-guide-maxwell-food-centre-*aid-10733101/][source]]): Char siu + noodles. - Shanghai La Mian Xiao Long Bao (Alexandra Village food centre, [[http://www.hungrygowhere.com/gallery/food-guide-alexandra-village-food-centre-*gid-087b3101/584c0200][source]]): xiao long bao or soup dumplings ($4.50 for 7 pieces). - Timbre+ (hipster hawker centre? [[http://www.straitstimes.com/lifestyle/food/10-dishes-to-try-at-hipster-hawker-centre-timbre][source]]). - Supertree Grove (go at dusk, see lights turn on). - Singapore Botanic garden. - Ginger Garden. - Palms valley. - Orchid garden. - Sri Mariamman Temple. - Kusu Island? - Chilly crab (“Jumbo” Chilli Crab Restaurant in Clarke Quay or Harvest Seafood Restaurant)? - Afternoon tea? - www.tea-chapter.com.sg - Bumboats (£2.50 return) leave Changi Point between 6am and 9.30pm for the 10-minute crossing to Palau Ubin. Hire a bicycle in the village where the boats dock. - Haji Lane (colorful road). - Tiong Bahru 1930s public housing estate (**) - Chong Yu Wanton Mee (Tiong Bahru Market And Food Centre #02-30, 30 Seng Poh Road, [[http://www.timeout.com/singapore/restaurants-and-cafes/chong-yu-wanton-mee#tab_panel_2][source]]). - old-fashioned treats at Tiong Bahru Galicier (55 Tiong Bahru Rd). - Chinatown - Pek Sin Choon Tea: Oldest team merchants. - Ang Mo Kio: Sri Mariamman Hindu temple. - Strangelets: quirky stuff from around the world. - 40 Hands: Allegedly one of most popular coffee joints. - BooksActually: Coolest book shop. - Keong Saik (next to Chinatown) - 1939 Hotel. - The Library (49 Keong Saik Rd): night drinks, ask for key/password next door (the-study.sg) (**) - [[http://marikos.com.sg][Mariko's (Now Phat Cat laundry): Maybe food or drink at night?]] (**) - Rose Citron (23 Keong Said Rd): French and Asian articles. - Everton park (old housing estate), new meets old - Coffee - Nylon coffee roasters (http://nyloncoffee.sg). - Just Want Coffee (justwant.com.sg). - Cozy corner coffee. - Sweets - Grin Affair (grinaffair.com): natural ingredients into glass jar creations. - Batterworks (batter-works.com): pastries. - http://cozycornercoffee.com. - Seriously ice scream (facebook.com/seriouslyicecream). - Ji Xiang Confectionery (jixiangconfectionery.com): Traditional glutinous sweets. (**) - Food - The Provision Shop (Blk 3 Everton Park): for a classic and affordable meal. - Chew the Fat (Blk 6 Everton Park): comfort food. - Eden's Kitchen (http://edenskitchen.sg): healthy, green tea, coconut oil, etc. - Jalan Besar - Char: unconventional char siu ([[http://www.nytimes.com/2015/01/25/travel/restaurant-report-char-in-singapore.html][source]]). - The Banana Leaf Apollo (Little India). - Beach Road Scissors-Cut (220 Jln Besar): Curry Rice. (**) - Fu Zhou Poh Hwa Oyster Cake (166 Jln Besar): UFO-shaped snacks. (**) - [[http://www.sweechoon.com][Swee Choon Tim Sum Restaurant: a dim sum institution!]]. (**) - [[http://papapalheta.com][Papa Palheta coffee: best coffee in town?]]. - [[http://thegeneralco.sg][General Company: awesome design and workshops]]. (**) - [[http://eat.thebravery.sg][The Bravery: brunch, aka awesome pancakes]]. (**) - [[http://aeiou.sg][AEIOU: Retro shopping]]. - Geylang (preserved shophouses and rich in Malay history) - Hajjah Mona Nasi Padang (Geylang Serai food centre): Order nasi padang (try dry one). - Biryani Express (Geylang Serai food centre) - Red light district. Still? - [[http://brawnandbrains.sg/][Brawn & Brains (Coffee)]]. - [[http://oldgeylang.com.sg][Old Geylang (crocodile, turtle soup, other oddities)]]. - Hi-Thrift (1 Geylang Rd): Second hand treasures? (**). * [2016-12-02 Fri] Email provider bookmarks :PROPERTIES: :CUSTOM_ID: email-provider-bookmarks :END: :MODIFIED: [2018-05-29 Tue] :END: - [[https://www.robinwhittleton.com/2018/02/18/dropping-g-suite/][Dropping G Suite - Robin Whittleton]]. - [[https://heluna.com/][Heluna - Cloud-based antispam]]. - [[https://mailinabox.email/][Mail-in-a-Box]]. - [[https://mailbox.org/][mailbox.org – Ihr sicherer E-Mail-Anbieter]]. - [[https://mailbox.org/][Mailbox.org]]. - [[http://migadu.com][Migadu]]. - [[http://Posteo.de][Posteo]]. - [[https://protonmail.com/][ProtonMail]]. - [[https://soverin.net/][Soverin - Home - Soverin]]. * [2016-12-01 Thu] Go snippets :PROPERTIES: :CUSTOM_ID: go-snippets :END: ** Command-line flags #+BEGIN_SRC go import ( "flag" ) type args struct { flag1 string flag2 string arg string } func parseArgs() args { args := args{} flag.StringVar(&args.flag1, "flag1\n", "\n", "some flag 1 with sample `value`") flag.StringVar(&args.flag2, "flag2\n", "\n", "some flag 2 with sample `value`") flag.CommandLine.Usage = func() { fmt.Fprintf(os.Stderr, "Usage of %s:\n\n", os.Args[0]) fmt.Fprintf(os.Stderr, "\n myarg\n\n") flag.PrintDefaults() } flag.Parse() args.arg = flag.Arg(0) if args.flag1 == "" || args.flag2 == "" || args.arg == "" { flag.CommandLine.Usage() os.Exit(1) } return args } func main() { args := parseArgs() fmt.Printf("Args: %#v\n", args) } #+END_SRC #+BEGIN_SRC sh go run main.go -flag1 val1 -flag2 val2 arg #+END_SRC * [2016-12-01 Thu] Javascript snippets :PROPERTIES: :CUSTOM_ID: javascript-snippets :END: * [2016-11-27 Sun] Sydney travel bookmarks :PROPERTIES: :CUSTOM_ID: sydney-travel-bookmarks :END: - [[https://www.buzzfeed.com/mikeynicholson/thats-not-a-pool-this-is-a-pool][17 Stunning Sydney Pools That Will Make You Want To Jump Back In The Water]]. - [[http://apassionandapassport.com/2015/01/48-hours-sydney-australia/][48 Hours in Sydney]]. - [[http://bourkestreetbakery.com.au/][Bourke Street Bakery]]. - Collector Store (Surrey Hills). - [[http://merivale.com.au/coogeepavilion][Coogee Pavilion]]. - [[http://fouratefive.com/][Four ate five]]. - [[http://www.harryscafedewheels.com.au/][Harry's Cafe de Wheels: Famous for Pies and Peas, Meat Pies, Hot Dogs]]. - [[https://www.hurricanesgrillandbar.com.au/bondi-beach/][Hurricane’s grill & bar Bondi beach]]. - [[http://loxstockandbarrel.com.au/][Lox Stock & Barrel]]. - [[http://marigold.com.au][Marigold citymark (dim sum)]]. - [[http://www.reubenhills.com.au/about][Reuben Hills]]. - [[https://seanspanaroma.co/][Seans]]. - [[http://thetrustedtraveller.com/sydneys-best-markets/][Sydney's Best Markets - The Trusted Traveller]]. - [[http://theeightrestaurant.com.au][The eight (dim sum)]]. - [[http://theglenmore.com.au/][The Glenmore]]. - [[http://www.threeblueducks.com/][Three Blue Ducks]]. * [2016-10-16 Sun] Laos travel bookmark :PROPERTIES: :CUSTOM_ID: laos-travel-bookmark :END: - [[https://www.youtube.com/watch?v=uImN-P4xh1U][Best Way to Enjoy Luang Prabang]]. * [2016-10-08 Sat] Singapore travel bookmarks :PROPERTIES: :CUSTOM_ID: singapore-travel-bookmarks :END: :MODIFIED: [2021-11-23 Tue] :END: - [[https://www.reddit.com/r/singapore/comments/4s5y70/any_place_to_go_thrift_shopping_in_singapore/][Any place to go thrift shopping in Singapore? (Reddit)]]. - East coast lagoon. - [[https://twitter.com/visakanv/status/1129373195901915136][Food post on SG]]. - [[http://ieatishootipost.sg/tai-hua-bak-chor-mee-everybody-queue-up][Hillstreet Tai Hwa Pork Noodles: Everybody Queue up!]]. - [[https://en.wikipedia.org/wiki/Little_India,_Singapore][Little India]]. - [[https://twitter.com/visakanv/status/1171034065354379264][More SG spots]]. - [[http://thehoneycombers.com/singapore/second-hand-shopping-in-singapoe-best-places-for-thrift-shopping-for-pre-loved-clothes-used-furniture-and-vintage-accessories/][Second hand shopping in Singapore]]. - [[https://twitter.com/visakanv/status/1171037799673262083][SG spots]]. - [[http://www.telegraph.co.uk/travel/picturegalleries/8308524/Singapores-best-hawker-centres.html][Singapore's best hawker centres - Telegraph]]. - [[http://sg.asia-city.com/][The Insider's Guide to Singapore (SG Magazine Online)]]. - [[http://www.mariefranceasia.com/fashion/serial-shopper/shopping-guide/treasure-hunt-5-places-thrift-singapore-107735.html][Treasure Hunt: 5 Places to thrift in Singapore]]. - [[https://twitter.com/visakanv/status/1204136302230130688][Visakan Veerasamy on Twitter: "what do you know about Singapore?"]]. - [[https://www.reddit.com/r/singapore/comments/5gf0y5/what_is_the_best_hawker_center_in_singapore/][What is the best hawker center in singapore? (Reddit)]]. * [2016-10-01 Sat] Cambodia travel bookmarks :PROPERTIES: :CUSTOM_ID: cambodia-travel-bookmarks :END: - Pub Street (Siem Reap, Cambodia). * [2016-10-01 Sat] New York travel bookmarks :PROPERTIES: :CUSTOM_ID: new-york-travel-bookmarks :END: - [[https://www.lonelyplanet.com/usa/new-york-city/travel-tips-and-articles/best-taco-joints-in-new-york-city][Best taco joints in New York City - Lonely Planet]]. - [[https://twitter.com/EricaJoy/status/1079505326922174464][Nice and/or fancy restaurant to eat at in brooklyn (Erica Joy's tweet)]]. * [2016-09-18 Sun] API design bookmarks :PROPERTIES: :CUSTOM_ID: api-design-bookmarks :END: :MODIFIED: [2020-09-05 Sat] :END: - [[http://blog.madewithlove.be/post/birdseye-view-on-api/][A bird's eye view on API development]]. - [[https://msdn.microsoft.com/en-us/library/dd203052.aspx][A Guide to Designing and Building RESTful Web Services with WCF 3.5 (Microsoft)]]. - [[https://news.ycombinator.com/item?id=24383180][Ask HN: Suggestions for books about API design? | Hacker News]]. - [[http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api][Best Practices for Designing a Pragmatic RESTful API]]. - [[https://apisyouwonthate.com/][Build APIs You Won't Hate]]. - [[https://mollyrocket.com/casey/stream_0028.html][Designing and Evaluating Reusable Components]]. - [[http://harrymoreno.com/2016/03/31/API-design-link-roundup.html][Harry Moreno | API Design Link Roundup]]. - [[https://ozlabs.org/~rusty/index.cgi/tech/2008-03-30.html][How Do I Make This Hard to Misuse?]]. - [[http://static.googleusercontent.com/media/research.google.com/en//pubs/archive/32713.pdf][How to Design a Good API and Why it Matters (Google)]]. - [[https://www.youtube.com/watch?v=aAb7hSCtvGw][How To Design A Good API and Why it Matters - YouTube]]. - [[http://sheredom.wordpress.com/2014/08/10/how-to-design-api-function-that-creates-something/][How to design API function creating objects]]: By Neil Henning. - [[https://geemus.gitbooks.io/http-api-design/content/en/index.html][HTTP API Design Guide]]. - [[http://jsonapi.org/][JSON API — A specification for building APIs in JSON]]. - [[https://github.com/Microsoft/api-guidelines/blob/master/Guidelines.md][Microsoft REST API Guidelines]]. - [[http://wooptoo.com/blog/notes-on-restful-apis/][Notes on RESTful APIs (Updated)]]. - [[https://bocoup.com/weblog/documenting-your-api][REST API Documentation Best Practices]]. - [[http://www.restapitutorial.com/][REST API Tutorial]]. - [[https://www.youtube.com/watch?v=hdSrT4yjS1g][REST+JSON API Design - Best Practices for Developers - YouTube]]. - [[https://drive.google.com/a/xenodium.com/file/d/0B8qU9uFznmLsUEZ3TEFMbDZQcUE/view][RESTful Service Design - UC Berkeley]]. - [[http://sweng.the-davies.net/Home/rustys-api-design-manifesto][Rusty's API Design Manifesto]]. - [[http://www.aristeia.com/Papers/IEEE_Software_JulAug_2004_revised.htm][Scott Meyers: The Most Important Design Guideline?]]. - [[https://swift.org/documentation/api-design-guidelines/][Swift.org - API Design Guidelines]]. - [[http://www.slideshare.net/landlessness/teach-a-dog-to-rest][Teach a Dog to REST]]. - [[https://bradfults.com/the-best-api-documentation-b9e46400379a#.a7k8edhyc][The Best API Documentation]]. - [[http://www4.in.tum.de/~blanchet/api-design.pdf][The Little Manual of API Design (Jasmin Blanchette, Trolltech)]]. - [[https://drive.google.com/a/xenodium.com/file/d/0B8qU9uFznmLsdFBHS1I2c1ZLRkE/view][Web API Design - Crafting interfaces that developers love]]. - [[http://programmingisterrible.com/post/139222674273/write-code-that-is-easy-to-delete-not-easy-to][Write code that is easy to delete, not easy to extend]]. * [2016-09-18 Sun] Handy pdf utilities :PROPERTIES: :CUSTOM_ID: handy-pdf-utilities :END: Straight out of [[http://jvns.ca/blog/2016/08/29/how-i-made-a-zine][How (and why) I made a zine]], some handy utilities for generating pdfs... ** Convert pngs to pdfs #+BEGIN_SRC sh # start with a bunch of PNG images of your zine pages # convert them all to PDF for i in *.png do # imagemagick is the best thing in the world convert $i $i.pdf done #+END_SRC ** Combine pdfs Combine pdfs using pdftk: #+begin_src sh pdftk *.pdf cat output zine.pdf #+end_src Combine pdfs using poppler: #+begin_src sh pdf unite PDF1.pdf PDF2.pdf PDF3.pdf #+end_src ** Reorder pdf pages #+BEGIN_SRC sh # pdfmod is a GUI that lets you reorder pages pdfmod zine.pdf #+END_SRC ** Add margins to pdf #+BEGIN_SRC sh # pdfcrop lets you add margins to the pdf. this is good because otherwise the # printer will cut off stuff at the edges pdfcrop --margin '29 29 29 29' zine.pdf zine-intermediate.pdf #+END_SRC ** Turn pdf into booklet #+BEGIN_SRC sh # pdfjam is this wizard tool that lets you take a normal ordered pdf and turn # it into something you can print as a booklet on a regular printer. # no more worrying about photocopying machines pdfjam --booklet true --landscape --suffix book --letterpaper --signature 12 --booklet true --landscape zine-intermediate.pdf -o zine-booklet.pdf #+END_SRC * [2016-09-15 Thu] Fuzzy search Emacs compile history :PROPERTIES: :CUSTOM_ID: fuzzy-search-emacs-compile-history :END: I wrote about [[#search-bash-history-with-emacs-helm][searching bash history with Emacs Helm]] some time ago. Since then, I've learned about /completing-read/ to generically handle simple Emacs completions (very handy for supporting Helm, Ivy, and Ido completions). Here's a simple way to combine /completing-read/ and the /compile/ command to enable fuzzy searching your compile history: #+ATTR_HTML: :width 75% :height 75% [[file:images/fuzzy-search-emacs-compile-history/fuzzy_compile.gif]] #+BEGIN_SRC emacs-lisp (defun ar/compile-completing () "Compile with completing options." (interactive) (let ((compile-command (completing-read "Compile command: " compile-history))) (compile compile-command) (add-to-list 'compile-history compile-command))) #+END_SRC * [2016-09-05 Mon] Jumping on the Emacs 25 bandwagon :PROPERTIES: :CUSTOM_ID: jumping-on-emacs-25-bandwagon :END: Can't miss out on all the new fun. Emacs 25 RC2 is out and lots of people already using it. Since I'm mostly on MacOS these days, installing via homebrew with --devel, gets you RC2: #+BEGIN_SRC sh brew install emacs --devel --with-cocoa --with-gnutls --with-librsvg --with-imagemagick #+END_SRC #+ATTR_HTML: :width 75% :height 75% [[file:images/jumping-on-emacs-25-bandwagon/emacs25.png]] The only hiccup so far's been org mode failing to export, which was fixed by re-installing it (follow [[https://lists.gnu.org/archive/html/emacs-orgmode/2015-08/msg00320.html][this thread]]). * [2016-07-31 Sun] San Francisco's Mission District travel bookmarks :PROPERTIES: :CUSTOM_ID: san-franciscos-mission-district-travel-bookmarks :END: - Atlas Cafe. - Blue Bottle Coffee. - Cafe la Boheme. - [[https://en.wikipedia.org/wiki/Clarion_Alley][Clarion Alley]]. - Coffee Bar. - Dynamo donut & coffee. - Four Barrel Coffee. - Grand Coffee. - Haus Coffee. - Kafe 99. - Linea cafe. - Mission skateboards. - pNakamoto's Bitcoin shop. - Philz Coffee. - Ritual Coffee roasters. - Rodger's coffee & tea. - Sightglass Coffee. - Stable Cafe. - Sugar lump coffee lounge. * [2016-07-25 Mon] Moscow travel bookmarks :PROPERTIES: :CUSTOM_ID: moscow-travel-bookmarks :END: :MODIFIED: [2019-10-07 Mon] :END: - [[http://www.drzhivago.ru/en/][Drюzhivago (restaurant)]]. - [[http://park-gorkogo.com/][Gorky park]]. - [[https://twitter.com/archpng/status/1180991886674321408][Hotel Peking]]. - [[http://www.kremlin-izmailovo.com/o-kremle/kreml-segodnja][Izmailovo]]. - [[http://mgomz.com/][Kolomenskoe (park)]]. - [[http://www.kreml.ru/en-Us/museums-moscow-kremlin][Kremlin]]. - [[http://kuskovo.ru/en][Kuskovo (park)]]. - [[https://www.mariinsky.ru/en/][Mariinsky (see ballet or opera)]]. - [[https://themoscowtimes.com/][Moskow times (check for events)]]. - [[http://strelka.com/en/bar][Strelka (lectures, cocktails and dances)]]. - [[https://www.tarasbulba.ru/main-menu.html][Tarasbulba (food)]]. - [[http://www.tsaritsyno-museum.ru/index.php?lang=en][Tsaritsyno park]]. * [2016-07-24 Sun] Vietnam travel bookmarks :PROPERTIES: :CUSTOM_ID: vietnam-travel-bookmarks :END: :MODIFIED: [2019-11-29 Fri] :END: - Can Ba Quan - Nikki Tren. - Vietnamese Cajun. - [[https://www.lonelyplanet.com/vietnam/con-son/travel-tips-and-articles/exploring-vietnams-remote-con-dao-islands][Exploring Vietnam's remote Con Dao Islands]]. - [[https://www.vietnamonline.com/destination/hoi-an.html][Hoi An, Vietnam- Travel guide]]. - [[http://www.weloveeattravel.com/list-locations-somebody-feed-phil-saigon-vietnam/][List of Locations: Somebody Feed Phil - Ho Chi Minh City, Vietnam]]. - Pho Bo Phu Gia - DC: 146K LY Chinh Thang. - 0908 208 866. - Simon Standly and Vin Dao (food journalists) - [[http://www.weloveeattravel.com/list-locations-somebody-feed-phil-saigon-vietnam/][Somebody Feed Phil, List of Locations: Ho Chi Minh City]]. - Thuc Pham Duc Viet - Bahn Mi - Pate Bu Cha - Nhan Dat Bi Cha - [[https://saigonboy.me/another-favorite-bookstore-bookworm-hanoi][Another favorite bookstore - Bookworm Hanoi | The Saigon boy]] * [2016-07-19 Tue] Pokémon Go bookmarks :PROPERTIES: :CUSTOM_ID: pokemon-go-bookmarks :END: :MODIFIED: [2016-07-24 Sun] :END: - [[https://www.reddit.com/r/pokemon/comments/4ruand/pok%25C3%25A9mon_go_lengthy_introduction_guide][Pokémon GO Lengthy Introduction Guide (Reddit)]]. - [[https://rankedboost.com/pokemon-go/catching-locations/][Pokémon locations]]. - [[https://www.reddit.com/r/pokemongo/comments/4rlnmc/some_tips_from_my_last_days_playing][Some tips from my last days playing (Reddit)]]. - [[https://www.reddit.com/r/pokemongo/comments/4srsiu/yet_another_tips_and_tricks_from_a_level_20][Yet another "Tips and Tricks" from a level 20+ (Reddit)]]. * [2016-07-03 Sun] Coffee bookmarks :PROPERTIES: :CUSTOM_ID: coffee-bookmarks :END: - [[http://www.idosi.org/wasj/wasj2(5)/17.pdf][Changes properties of coffee brew during roasting]]. - [[http://www.coffeegeek.com/guides/aeropresscoldbrew][Aeropress Iced Coffee]]. * [2016-07-03 Sun] Machine learning bookmarks :PROPERTIES: :CUSTOM_ID: machine-learning-bookmarks :END: :MODIFIED: [2019-01-27 Sun] :END: - [[https://news.ycombinator.com/item?id=12083124][A Course in Machine Learning (Hacker News)]]. - [[https://news.ycombinator.com/item?id=11985709][How to start learning deep learning (Hacker News)]]. - [[http://ofir.io/How-to-Start-Learning-Deep-Learning][How to start learning deep learning]]. - [[https://medium.com/@ageitgey/machine-learning-is-fun-80ea3ec3c471#.tg3yzvbep][Machine Learning is Fun! The world’s easiest introduction to Machine Learning]]. - [[https://news.ycombinator.com/item?id=19000027][Practical Deep Learning for Coders 2019 (Hacker News)]]. - [[https://www.quora.com/What-are-the-best-ways-to-pick-up-Deep-Learning-skills-as-an-engineer/answer/Greg-Brockman?srid=cgo&share=d1ac0da2][What are the best ways to pick up Deep Learning skills as an engineer? (Quora)]]. * [2016-06-17 Fri] Emacs and emotional vocab :PROPERTIES: :CUSTOM_ID: emacs-and-emotional-vocab :END: Having read [[http://www.nytimes.com/2016/06/05/opinion/sunday/are-you-in-despair-thats-good.html][Are You in Despair? That’s Good]], I was encouraged to expand my emotional vocabulary. As a [[https://github.com/emacs-mirror/emacs/blob/master/lisp/play/zone.el][zone.el]] fan (checkout [[https://github.com/wasamasa/zone-nyan][nyan]], [[https://github.com/kawabata/zone-sl][sl]], and [[https://github.com/kawabata/zone-rainbow][rainbow]]), I looked into writing a zone [[https://github.com/emacs-mirror/emacs/blob/master/lisp/play/zone.el#L52][program]]. When /zone-when-idle/ is set, zone acts as a screensaver of sorts. We can use this to display random emotional vocab whenever Emacs is idle for a period of time. Let's get to it... Zone keeps a list of programs to choose from when kicked off. Below is a basic /zone-hello/ program, along with an interactive command for previewing. Not much to these. The tiny program prepares the screen for zoning and inserts text while no input is pending. #+BEGIN_SRC emacs-lisp (defun zone-hello () (delete-other-windows) (setq mode-line-format nil) (zone-fill-out-screen (window-width) (window-height)) (delete-region (point-min) (point-max)) (goto-char (point-min)) (while (not (input-pending-p)) (insert "hello zone\n") (zone-park/sit-for (point-min) 0.2))) (defun zone-hello-preview () (interactive) (let ((zone-programs [zone-hello])) (zone))) #+END_SRC Here's what /zone-hello/ looks like: #+ATTR_HTML: :width 75% :height 75% [[file:images/emacs-and-emotional-vocab/minimal-zone.gif]] Back to improving our emotional vocabulary, we'll need a dictionary for our goal. A quick search yields a potential list of [[http://www.psychpage.com/learning/library/assess/feelings.html][words]]. We can use [[http://wordnet.princeton.edu/][WordNet]] to define them while offline. These two sources will do for now. We tie it all together in [[https://github.com/xenodium/dotfiles/blob/master/emacs/ar/zone-words.el][zone-words.el]] and the resulting zone program looks as follow: #+ATTR_HTML: :width 75% :height 75% [[file:images/emacs-and-emotional-vocab/emotions.gif]] UPDATE: Just came across [[http://blog.josephwilk.net/art/emacs-animation.html][Animations With Emacs]]. A post with awesome zone examples. * [2016-05-10 Tue] Emacs: Find number of days between dates :PROPERTIES: :CUSTOM_ID: emacs-find-number-of-days-between-dates :END: Needed to find the number of days between two dates. Emacs calendar must know this... - Fire up the manual (M-x info-emacs-manual or C-h r). - Info-goto-node (or g). - Type "counting days" and voilá: #+BEGIN_QUOTE To determine the number of days in a range, set the mark on one date using `C-', move point to another date, and type `M-=' (`calendar-count-days-region'). The numbers of days shown is _inclusive_; that is, it includes the days specified by mark and point. #+END_QUOTE #+ATTR_HTML: :width 75% :height 75% [[file:images/emacs-find-number-of-days-between-dates/emacs-days-between-dates.gif]] /Note: you can use the mouse to jump to another date, or "g d" (calendar-goto-date)./ * [2016-05-08 Sun] RoutingHTTPServer snippet :PROPERTIES: :CUSTOM_ID: routinghttpserver-snippet :END: [[https://github.com/mattstevens/RoutingHTTPServer][RoutingHTTPServer]] snippet: #+BEGIN_SRC objc RoutingHTTPServer *routingHTTPServer = [[RoutingHTTPServer alloc] init]; [routingHTTPServer setPort:8000]; [routingHTTPServer setDefaultHeader:@"Server" value:@"YourAwesomeApp/1.0"]; [routingHTTPServer handleMethod:@"GET" withPath:@"/hello" block:^(RouteRequest *request, RouteResponse *response) { [response setHeader:@"Content-Type" value:@"text/plain"]; [response respondWithString:@"Hello!"]; }]; NSError *error = nil; if (![routingHTTPServer start:&error]) { NSLog(@"Error starting HTTP Server: %@\n", error); } #+END_SRC * [2016-05-06 Fri] Alaska travel bookmarks :PROPERTIES: :CUSTOM_ID: alaska-travel-bookmarks :END: - Anchorage. - Denali NP. - Exit Glacier / Kenai Fjord NP. - Ice Falls Hike. - Iditarod race husky camp. - Seward: Kenai Fjord Wildlife cruise (Major Marine cruises). - Talkeetna fishing. * [2016-05-06 Fri] UIViewController bookmarks :PROPERTIES: :CUSTOM_ID: uiviewcontroller-bookmarks :END: - [[https://twitter.com/twostraws/status/1035193619307618304][What's your number one tip for avoiding massive view controllers?]]. - [[http://khanlou.com/2014/09/8-patterns-to-help-you-destroy-massive-view-controller/][8 Patterns to Help You Destroy Massive View Controller]]. - [[https://realm.io/news/tryswift-daniel-steinberg-blending-cultures/][Blending Cultures: The Best of Functional, Protocol-Oriented, and Object-Oriented Programming]]. - [[https://www.youtube.com/watch?v=xsSnOQynTHs&feature=youtu.be][Dan Abramov - Live React: Hot Reloading with Time Travel]]. - [[http://inessential.com/2016/04/08/comparing_reactive_and_traditional][Comparing Reactive and Traditional]]. - [[http://reswift.github.io/ReSwift/master/getting-started-guide.html][ReSwift: Getting Started]]. - [[https://github.com/sahandnayebaziz/StateView/blob/master/readme.md][StateView is a UIView substitute that automatically updates itself when data changes]]. - [[http://inessential.com/2016/04/11/the_objective-c_version][The Objective-C version to "Comparing Reactive and Traditional"]]. - [[https://realm.io/news/andy-matuschak-refactor-mega-controller][Let's Play: Refactor the Mega Controller!]]. - [[https://github.com/jlyman/RN-NavigationExperimental-Redux-Example][How to use Redux to manage navigation state in a React Native]]. - [[https://github.com/sahandnayebaziz/StateView][StateView: UIView substitute automatically updating itself when data changes.]] - [[https://developer.apple.com/videos/play/wwdc2015/219/][Mysteries of Auto Layout, Part 2]]. - [[https://www.youtube.com/watch?v=COviCoUtwx4][Netflix JavaScript Talks - RxJS Version 5]]. - [[http://www.reactive-streams.org][Reactive Streams]]. * [2016-05-03 Tue] When OOO impulse kicks in... :PROPERTIES: :CUSTOM_ID: when-ooo-impulse-kicks-in :END: - You start moving trivial bits of code into classes, with the anticipation that you might use it one day. Stop. - On naming, semantic clarity trumps brevity. Yup, the verbosity may be worth it. * [2016-05-02 Mon] Pakistan travel bookmarks :PROPERTIES: :CUSTOM_ID: pakistan-travel-bookmarks :END: :MODIFIED: [2023-04-20 Thu] :END: - [[https://www.phillymag.com/news/2023/04/08/philly-cheesesteaks-lahore-pakistan/][How Philly Cheesesteaks Became a Big Deal in Lahore, Pakistan]]. - Karachi. - Lahore. - Rabelpindi. - Shinwari BBQ. * [2016-05-02 Mon] Money bookmarks :PROPERTIES: :CUSTOM_ID: money-bookmarks :END: :MODIFIED: [2021-11-23 Tue] :END: - [[https://www.thestreet.com/slideshow/13552416/1/10-countries-where-that-social-security-check-will-let-you-retire-in-style.html][10 Countries Where That Social Security Check Will Let You Retire in Style (TheStreet)]]. - [[https://www.lovemoney.com/guides/75277/tax-relief-return-cut-your-income-tax-capital-gains-tax-inheritance-tax][20 items to consider for taxes: Income Tax, Council Tax, and Inheritance Tax (lovemoney.com)]]. - [[https://www.benetworthy.com/worst-financial-advice/][25 Bloggers Share The Worst Financial Advice They've Ever Received - Be Net Worthy]]. - [[https://www.reddit.com/r/UKPersonalFinance/comments/7o3o06/25_yo_potentially=_2m_bit_overwhelmed/][25 y/o. Potentially £2m. Bit overwhelmed. : UKPersonalFinance]]. - [[https://financialpanther.com/9-best-personal-finance-podcasts/][9 Best New Personal Finance Podcasts - Financial Panther]]. - [[https://www.reddit.com/r/UKPersonalFinance/comments/cdjdui/a_guide_to_index_funds/][A guide to index funds : UKPersonalFinance]]. - [[http://monevator.com/category/investing/passive-investing-investing/][A guide to passive investing in the UK]]. - [[https://www.reddit.com/r/UKPersonalFinance/comments/aq5ss6/a_simple_example_of_contributing_half_your_age_as/][A Simple Example of Contributing Half Your Age as a Percentage of Salary to a Pension : UKPersonalFinance]]. - [[https://adviserbook.co.uk/][AdviserBook | Find a regulated financial adviser near you]]. - [[https://www.amazon.com/How-Interview-Financial-Advisor-Piaw-ebook/dp/B00GXDT9LY][Amazon.com: How to Interview a Financial Advisor eBook: Piaw Na: Kindle Store]]. - [[https://www.reddit.com/r/UKPersonalFinance/comments/9edd3m/any_critique_against_the_vanguard_ftse_global_all/][Any critique against the Vanguard FTSE global all cap index? : UKPersonalFinance]]. - [[https://www.fca.org.uk/firms/authorised-recognised-funds][Authorised and recognised funds (FCA)]]. - [[https://www.bankaccountsavings.co.uk/calculator][Bank Account Savings: Open up multiple accounts to maximise your savings]]. - [[https://benefits-calculator.turn2us.org.uk/AboutYou][Benefit Calculator - About You - Turn2us]]. - [[https://www.vanguard.com/pdf/icrpr.pdf][Best practices for portfolio rebalancing (Vanguard research July 2010)]]. - [[https://www.vanguard.com/pdf/ISGPORE.pdf][Best practices for portfolio rebalancing (Vanguard)]]. - [[https://www.bogleheads.org/wiki/Bogleheads%C2%AE_investment_philosophy][Bogleheads® investment philosophy - Bogleheads]]. - [[https://transferwise.com/us/borderless/pricing][Borderless account pricing: What are the fees? - TransferWise]]. - [[https://www.totallymoney.com/buy-to-let-yield-map/][Buy-to-Let Rental Yield Map 2019 - TotallyMoney]]. - [[https://www.financial-hacker.com/bye-yahoo-and-thank-you-for-the-fish/][Bye Yahoo, and thanks for all the fish (The Financial Hacker) - See comments for alternatives]]. - [[https://canadiancouchpotato.com/2015/07/13/calculating-your-portfolios-rate-of-return/][Calculating Your Portfolio’s Rate of Return]]. - [[https://www.reddit.com/r/UKPersonalFinance/comments/9exrhv/can_i_open_a_lisa_and_a_private_pension_vanguard/][Can I open a LISA and a Private Pension (Vanguard LifeStrategy)?]]. - [[https://www.expertsforexpats.com/expat-tax/capital-gains-tax-for-british-expats][Capital Gains Tax for Expats - Experts for Expats]]. - [[https://cfiresim.com/][cFIREsim]]. - [[https://www.reddit.com/r/UKPersonalFinance/comments/gsvt3r/cheapest_way_to_pay_for_a_yearly_usd_subscription/][Cheapest way to pay for a yearly USD subscription in the UK : UKPersonalFinance]]. - [[https://www.gov.uk/check-if-you-need-tax-return][Check if you need to send a Self Assessment tax return - GOV.UK]]. - [[https://www.gov.uk/guidance/check-the-recognised-overseas-pension-schemes-notification-list][Check the recognised overseas pension schemes notification list - GOV.UK]]. - [[https://www.choosefi.com][ChooseFI (Join the Financial Independence Movement)]]. - [[https://www.citizensadvice.org.uk/][Citizens Advice]]. - [[https://www.codementor.io/][Codementor (Get live 1:1 coding help, hire a developer, & more)]]. - [[https://www.coursera.org/learn/financial-markets-global/reviews][Coursera (Online Courses From Top Universities. Join for Free)]]. - [[http://www.cfiresim.com/][Crowdsourced Financial Independence and Early Retirement Simulator/Calculator]]. - [[https://qr.ae/TUK1OD][Crystal's Quora answer to becoming a millionaire (full sensible/conservative advice) ]]. - [[https://news.ycombinator.com/item?id=17930318][Don't Steal Money from Day Traders Before They Lose It (Hacker News)]]. - [[https://twitter.com/ericajoy/status/1057774364181987328?s=12][EricaJoy on Twitter: what is the process for finding a financial advisor/accountant/etc]]. - [[https://www.justetf.com/de-en/][ETF portfolios made simple (justETF)]]. - [[https://www.bogleheads.org/wiki/EU_investing][EU investing - Bogleheads]]. - [[https://www.ft.com/content/c6183f2f-f58a-3569-a6ac-9d2b44adfe28][European active managers beaten by passives, 10-year study finds (Financial Times)]]. - [[https://app.fin-dee.com/][Fin-dee (FIRE calculator)]]. - [[https://www.khanacademy.org/economics-finance-domain/core-finance][Finance and capital markets | Economics and finance | Khan Academy]]. - [[https://www.reddit.com/r/UKPersonalFinance/comments/9viifz/financial_education_book_for_teenagers_by_martin/][Financial education book for teenagers by Martin Lewis : UKPersonalFinance]]. - [[https://www.madfientist.com/podcast][Financial Independence Podcast]]. - [[https://www.reddit.com/r/FIREUK/][Financial Independence Retiring Early UK (r/fireuk)]]. - [[https://www.reddit.com/r/EuropeFIRE][Financial independence/retire early in Europe (reddit)]]. - [[https://www.financialsamurai.com/wp-content/uploads/2018/08/reasons-to-sell.jpg][Financial Samurai png (typical reasons to sell assets in short term = bad idea long term)]]. - [[https://www.thepfs.org/yourmoney/find-an-adviser/][Find an Adviser]]. - [[https://www.vouchedfor.co.uk/][Find Top-Rated Financial Advisers, Mortgage Advisers, Solicitors and Accountants]]. - [[https://firecalc.com/][FIRECalc: A different kind of retirement calculator]]. - [[https://www.moneymarketing.co.uk/fund-charting-2/][Fund Charting – top-performing funds]]. - [[https://www.economist.com/finance-and-economics/2017/06/24/fund-managers-rarely-outperform-the-market-for-long][Fund managers rarely outperform the market for long - Buttonwood #passive-over-active]]. - [[https://www.reddit.com/r/UKPersonalFinance/comments/9n0636/investing_global_=all_cap_vs_small_cap_first_time/][Global All Cap VS Small Cap - first time 24 Male : UKPersonalFinance]]. - [[https://www.reddit.com/r/UKPersonalFinance/wiki/globaltracker][globaltracker - UKPersonalFinance]]. - [[https://www.reddit.com/r/Bogleheads/comments/gvxawv/how_do_i_take_a_wage_from_my_vanguard/][How do I take a wage from my vanguard lifestrategy fund]]. - [[https://www.quora.com/How-does-AQR-Capital-compare-with-Two-Sigma][How does AQR Capital compare with Two Sigma? - Quora]]. - [[https://smartersquirrel.com/how-i-built-a-six-figure-passive-income-by-age-47][How I built a six figure passive income by age 47]]. - [[https://urbanplanned.wordpress.com/2018/08/05/how-i-paid-off-5000-of-consumer-debt-in-5-months/][How I paid off £5000 of consumer debt in 5 months – URBANPLANNED]]. - [[https://www.reddit.com/r/UKPersonalFinance/comments/elr5qp/how_much_more_expensive_do_kids_get_as_they_get/][How much more expensive do kids get as they get older? : UKPersonalFinance]]. - [[https://adamfayed.com/2018/06/26/howtobecomerichbyinvesting/][How to become rich by investing: rational Investing Based on Evidence vs Speculation]]. - [[https://www.reddit.com/r/UKPersonalFinance/comments/cvfkr3/how_to_buy_your_first_house_for_dummies/][How to buy your first house for dummies : UKPersonalFinance]]. - [[https://moneytothemasses.com/tax/income-tax-2/reader-question-whats-the-easiest-way-to-work-out-how-much-my-bonus-will-be-taxed][How to work out what the tax will be on my bonus?]]. - [[https://ukpersonal.finance/windfall/][I have £x, what should I do with with it? - UKPersonalFinance Wiki]]. - [[https://www.reddit.com/r/UKPersonalFinance/comments/aickhc/iama_24yo_selling_my_company_for_500000_need/][IAMA 24yo selling my company for £500,000 - need serious advice. : UKPersonalFinance]]. - [[https://www.moneysavingexpert.com/tax-calculator/][Income tax calculator: Find out your take-home pay]]. - [[https://ukpersonal.finance/index-funds/][Index Funds - UKPersonalFinance Wiki]]. - [[https://www.fool.co.uk/investing-basics/isas-and-investment-funds/index-trackers-vs-managed-funds/][Index Trackers vs. Managed Funds | The Motley Fool UK #passive-over-active]]. - [[https://cashflowcop.com/invaluable-books/][Invaluable Books - Cashflow Cop]]. - [[https://ukpersonal.finance/investing-101/][Investing 101 - UKPersonalFinance Wiki]]. - [[https://www.youtube.com/watch][Investing in gold]]. - [[https://www.moneysavingexpert.com/savings/investment-beginners/][Investment for beginners]]. - [[https://www.reddit.com/r/UKPersonalFinance/comments/f377un/investment_jargon_putting_me_off/][Investment Jargon Putting Me Off : UKPersonalFinance]]. - [[https://www.reddit.com/r/UKPersonalFinance/comments/9oz32t/is_btl_still_worth_it/][Is BTL still worth it? : UKPersonalFinance]]. - [[https://www.moneysavingexpert.com/savings/ISA-guide-savings-without-tax/][ISA allowance: ISA limits & rules - MoneySavingExpert]]. - [[https://jlcollinsnh.com/][jlcollinsnh]]. - [[https://www.youtube.com/watch?v=WsWLPhVvPaQ][Killik Explains: A short guide to personal pensions (SIPPs) - YouTube]]. - [[https://www.youtube.com/watch?v=uUtSdTaiLCE][Killik Explains: Retirement Saving - Lifetime ISAs vs Pensions - YouTube]]. - [[https://frugalfoxes.home.blog/2019/01/15/lifestrategy-100-vs-ftse-global-all-cap-index-fund-what-are-the-differences][LifeStrategy® 100 vs FTSE Global All Cap Index Fund – What are the differences?]]. - [[https://www.moneysavingexpert.com/savings/lifetime-ISAs/][Lifetime ISAs: free 1000 towards your first home or retirement]]. - [[https://www.moneysavingexpert.com/savings/lifetime-ISAs/][Lifetime ISAs: free £33,000 towards your first home or retirement]]. - [[http://monevator.com/low-cost-index-trackers/][Low cost index trackers that will save you money (Monevator)]]. - [[https://www.madfientist.com/podcast][Mad Fientist: Financial Independence Podcast]]. - [[https://www.bogleheads.org/wiki/Managing_a_windfall][Managing a windfall - Bogleheads]]. - [[http://thefirestarter.co.uk/meet-the-firestarter/][Meet The FIREstarter! - theFIREstarter]]. - [[https://millennialmoney.com/][Millennial Money (Next Generation Personal Finance)]]. - [[https://www.workforcemillionaire.com/moms-rules-of-finance/][Mom's Rules of Finance (Workforce Millionaire - Investing in Your Future)]]. - [[http://monevator.com/][Monevator — Make more money, invest profitably, retire early]]. - [[http://monevator.com/compare-uk-cheapest-online-brokers/][Monevator: Compare the UK’s cheapest online brokers]]. - [[https://www.monito.com/][Money transfer: compare ways to send money online with Monito]]. - [[https://www.monolune.com/][Monolune (trading tools, articles)]]. - [[https://dstockhammer.github.io/monthly-savings-juggler/][Monthly Savings Juggler]]. - [[http://tools.morningstar.co.uk/uk/xray/editholdings.aspx?LanguageId=en-GB][Morningstar® Integrated Web Tools™ - Instant X-Ray]]. - [[https://ukpersonal.finance/mortgages/][Mortgages - UKPersonalFinance Wiki]]. - [[http://www.mrmoneymustache.com/][Mr. Money Mustache — Early Retirement through Badassity]]. - [[https://www.nsandi.com][National Savings and Investments NS&I]]. - [[https://www.nasdaq.com/symbol/][NDAQ Stock Quote - Nasdaq, Inc. Common Stock Price - Nasdaq]]. - [[https://www.telegraph.co.uk/money/transferwise/overseas-mortgages/][Overseas mortgages: everything you need to know]]. - [[https://www.moneysavingexpert.com/reclaim/parking-ticket-appeals/][Parking Ticket Appeals: Fight unfair fines - Money Saving Expert]]. - [[https://marcusmichaels.github.io/personal-finance-flowchart][Personal Finance Flowchart (github)]]. - [[https://www.moneysavingexpert.com/savings/personal-savings-allowance/][Personal Savings Allowance 2018/19 - up to £1,000 interest tax-free]]. - [[https://imgur.com/ZBaOGJj][Plotted my income and outgoings]]. - [[https://www.portfolio-performance.info/portfolio/][Portfolio Performance (crossplatform app)]]. - [[http://engaging-data.com/will-money-last-retire-early/][Post-Retirement Calculator: Will My Money Survive Early Retirement? Visualizing Longevity Risk - Engaging Data]]. - [[https://www.moneysavingexpert.com/savings/premium-bonds-calculator/][Premium Bond Probability Calculator]]. - [[https://www.moneysavingexpert.com/savings/premium-bonds/][Premium Bonds: are they worth it? - MoneySavingExpert]]. - [[https://www.reddit.com/r/UKPersonalFinance/comments/aopvqe/purchasing_a_new_property_with_a_baby_on_the_way/][Purchasing a new property with a baby on the way..? : UKPersonalFinance]]. - [[https://reboapp.co.uk/][rebo - Portfolio management software for UK private investors]]. - [[https://marcusmichaels.github.io/personal-finance-flowchart/][Reddit Personal Finance Flowchart (interactive)]]. - [[https://moneytothemasses.com/owning-a-home/mortgages/should-you-fix-your-mortgage-now][Remortgaging in 2019 - is now the right time to fix & for how long? - Money To The Masses]]. - [[https://rockstarfinance.com/][Rockstar Finance (Curating the best of money and personal finance)]]. - [[https://directory.rockstarfinance.com/personal-finance-blogs][Rockstar Finance's Directory of Bloggers]]. - [[http://media.morningstar.com/uk/MEDIA/Comprehensive_update_on_the_Safe_Withdrawal_Rate.pdf][Safe withdrawal rate (morningstar)]]. - [[https://www.kalzumeus.com/2012/01/23/salary-negotiation/][Salary Negotiation: Make More Money, Be More Valued | Kalzumeus Software]]. - [[http://sankeymatic.com/build/][SankeyMATIC (BETA): Build a diagram (redditor expenses/wages)]]. - [[https://thesavingninja.com/sipp-and-isa-fee-comparison/][Saving Ninja: What Platform to Use Now? (iWeb vs Charles Stanley vs Halifax share dealing vs Aviva vs Vanguard Investor)]]. - [[https://www.moneysavingexpert.com/savings/savings-accounts-best-interest/][Savings accounts: 1.5% easy access or up to 2.7% fixed]]. - [[https://www.reddit.com/r/financialindependence/comments/9bhg0j/so_you_want_to_be_a_landlord/][So, you want to be a landlord?? : financialindependence]]. - [[https://www.reddit.com/r/UKPersonalFinance/comments/eki7yt/started_my_dream_job_and_now_i_am_pregnant/][Started my dream job and now I am pregnant : UKPersonalFinance]]. - [[https://www.choosefi.com/starting-late-but-retiring-rich/][Starting Late But Retiring Rich: The Story Of Stephen And Becky ChooseFI]]. - [[https://www.moneysavingexpert.com/savings/stocks-shares-isas/][Stocks & shares ISAs: find the best platform - MSE]]. - [[https://jlcollinsnh.com/2014/01/27/stocks-part-xxi-investing-with-vanguard-for-europeans/][Stocks — Part XXI: Investing with Vanguard for Europeans]]. - [[https://www.moneysavingexpert.com/banking/tax-rates/#rate][Tax rates 2018/19: tax bands explained - MoneySavingExpert]]. - [[https://www.moneysavingexpert.com/banking/tax-rates/][Tax rates 2018/19: tax bands explained - MoneySavingExpert]]. - [[https://www.choosefi.com/10-pillars-of-fi/][The 10 Pillars Of FI ChooseFI]]. - [[https://theescapeartist.me][The Escape Artist (You can escape to financial freedom)]]. - [[https://www.financial-hacker.com/][The Financial Hacker – A new view on algorithmic trading]]. - [[https://www.lemonfool.co.uk/][The Lemon Fool (Discussion forums for UK shares, Personal Finance and Investment)]]. - [[https://www.financialsamurai.com/the-rise-of-stealth-wealth-guide-to-staying-invisible-from-society-rage/][The Rise Of Stealth Wealth]]. - [[https://i.imgur.com/Qi3rF3S.png][The world according to fleet-float equity market capitilization]]. - [[https://www.youtube.com/watch?v=s75GcslrfOE][Tim Bennett Explains: Which is best - an ISA or a SIPP? - YouTube]]. - [[https://www.moneysavingexpert.com/savings/best-cash-isa/][Top Cash ISAs: 1.35% easy access, 2.3% fixed - MSE]]. - [[https://www.cisi.org/cisiweb2/cisi-website/about-us/press-release/2018/09/05/uk-consumers-offered-free-personal-financial-planning-sessions-worth-up-to-500-in-cisi-financial-planning-week-3--10-october-makedreamshappen][UK Financial Planning Week]]. - [[https://ukpersonal.finance/uk-funds-faq/][UK Funds FAQ]]. - UKPersonalFinance redditor quote: "Deprogrammed myself from the zeitgeist of brands/labels. I either buy cheap or I buy quality dependent on application, but in either event I ignore the label." - [[https://www.gov.uk/employee-tax-codes/numbers][Understanding your employees' tax codes: What the numbers mean - GOV.UK]]. - [[https://firehub.eu/blogs/country/united-kingdom][United Kingdom | Countries (FIREhub.eu)]]. - [[http://www.avios.com/gb/en_gb/spend/zone-map?from=flightSearch][Use the Avios Rewards Flight Calculator to plan flights]]. - [[https://www.trustnet.com/factsheets/o/ngly/vanguard-ftse-global-all-cap-index][Vanguard FTSE Global All Cap Index A Acc GBP (trustnet)]]. - [[http://www.morningstar.co.uk/uk/funds/snapshot/snapshot.aspx?id=F00000XXVV&tab=13][Vanguard FTSE Global All Cap Index Fund Investor A GBP Accumulation (Morningstar)]]. - [[https://markets.ft.com/data/funds/tearsheet/summary?s=GB00BD3RZ582:GBP][Vanguard FTSE Global All Cap Index Fund Investor A GBP Accumulation, GB00BD3RZ582:GBP summary - FT.com]]. - [[https://www.trustnet.com/factsheets/o/acdv/vanguard-lifestrategy-100-equity][Vanguard LifeStrategy 100% Equity A Acc (Trustnet)]]. - [[https://www.trustnet.com/factsheets/o/acdt/vanguard-lifestrategy-80-equity][Vanguard LifeStrategy 80% Equity A (Trustnet)]]. - [[https://www.vanguardinvestor.co.uk/investing-explained/what-are-lifestrategy-funds][Vanguard LifeStrategy® Funds]]. - [[https://www.vanguardinvestor.co.uk/need-help/answer/whats-a-bed-and-isa-and-how-do-i-do-it][Vanguard: Helping you reach your investing goals | Vanguard]]. - [[https://www.vanguardinvestor.co.uk/investments/vanguard-lifestrategy-40-equity-fund-accumulation-shares/portfolio-data][Vanguard: LifeStrategy® 40% Equity Fund - Accumulation]]. - [[https://www.vanguardinvestor.co.uk/what-we-offer/personal-pension/pension-calculator][Vanguard’s simple Pension Calculator]]. - [[https://www.financialsamurai.com/the-way-of-the-financial-samurai-core-principles-for-achieving-financial-independence-and-living-your-best-life/][Way Of The Financial Samurai: Core Principles For Financial Independence]]. - [[https://www.reddit.com/r/FIREUK/comments/99ys2d/what_are_some_good_net_worth_tracking_tools_for/][What are some good net worth tracking tools? (for the UK) : FIREUK]]. - [[https://www.co-oplegalservices.co.uk/media-centre/articles-may-aug-2017/what-does-a-declaration-of-trust-do/][What Does a Declaration of Trust / Deed of Trust Do?]]. - [[https://awealthofcommonsense.com/2014/02/worlds-worst-market-timer/][What if You Only Invested at Market Peaks?]]. - [[https://www.quora.com/What-is-the-smartest-financial-habit-that-you-have][What is the smartest financial habit that you have? - Quora]]. - [[https://oec.world/en/visualize/tree_map/hs92/export/gbr/show/all/2018/][Where does export to? (2018) | OEC - The Observatory of Economic Complexity]]. - [[http://monevator.com/why-a-total-world-equity-index-tracker-is-the-only-index-fund-you-need][Why a world equity index tracker?]]. - [[https://www.quora.com/Why-are-most-people-broke][Why are most people broke? - Quora]]. - [[https://www.thebalance.com/why-do-bond-prices-and-yields-move-in-opposite-directions-417082][Why Bond Prices and Yields Move in Opposite Directions]]. - [[https://www.reddit.com/r/UKPersonalFinance/comments/dschqz/why_do_we_believe_that_the_price_of_stocks_will/][Why do we believe that the price of stocks will grow over the long term]]. - [[https://www.youtube.com/watch?v=zrCo0m5gSfc][Why Jack Bogle Doesn't Like ETFs (Forbes - YouTube)]]. - [[http://www.stonebanks.co.uk/][www.stonebanks.co.uk (capital gains calculator)]]. - [[http://www.x-o.co.uk/][X-O.co.uk - Execution Only Share Dealing (broker)]]. * [2016-05-02 Mon] Scotland travel bookmarks :PROPERTIES: :CUSTOM_ID: scotland-travel-bookmarks :END: - [[https://www.airbnb.co.uk/rooms/7908227][The Open Book (AirBnB + a bookshop)]]. - [[https://twitter.com/tehbus/status/884464692030308352][Where to eat in Edinburgh? (Twitter)]] * [2016-05-02 Mon] St. Petersburg travel bookmarks :PROPERTIES: :CUSTOM_ID: st-petersburg-travel-bookmarks :END: :MODIFIED: [2020-08-05 Wed] :END: - [[http://fabergemuseum.ru/][Faberge Muse]]. - [[https://duckduckgo.com/][Find a place to eat Koryushka (fried fish)]]. - [[https://vovanovaque.com/russia/saintpetersburg/pyshechnaya.html][Get "Pyshka" at Pyshechnaya in Saint Petersburg: local donut shop with 60 years of history]]. - [[http://www.hermitagemuseum.org/wps/portal/hermitage/?lng=en][Hermitage Museum]]. - [[http://eng.cathedral.ru/spasa_na_krovi/][Savior on the Spilled Blood Church]]. - [[http://www.stolle.ru/en/menu/saint-petersburg][Stolle (pie shop)]]. * [2016-05-02 Mon] 8 week half-marathon training :PROPERTIES: :CUSTOM_ID: 8-week-half-marathon-training :END: An 8-week training schedule: | WEEK | MON | TUE | WED | THU | FRI | SAT | SUN | |------+------+---------------+--------+---------+------+--------+---------------| | 1 | Rest | 5 Km | 5 Km | +Cycle+ | Rest | 5 Km | +8 Km+ 9 Km | | | | 29:56 | 29:54 | | | 29:45 | 1:00:55 | | 2 | Rest | 7 Km | 5 Km | +Cycle+ | Rest | 5 Km | 10 Km | | | | 41:36 | 27:52 | | | 28:23 | 59:17 | | 3 | Rest | +8 Km+ 8.1 Km | 5 Km | +Cycle+ | Rest | 5 Km | 12 Km | | | | 49:29 | 29:33 | | | 27:50 | 1:06 | | 4 | Rest | 8 Km | Rest | 8 Km | Rest | 5 Km | 14 Km | | | | 46:39 | | 49:28 | | 29:40 | | | 5 | Rest | 8 Km | Rest | +8 Km+ | Rest | +6 Km+ | +16 Km+ 10 Km | | | | 48:50 | | | | | 53:38 | | 6 | Rest | +8 Km+ | +8 Km+ | 8 Km | Rest | 8 Km | 19 Km | | | | | | 51:39 | | 37:09 | 2:02 | | 7 | Rest | 8 Km | Rest | 12 Km | Rest | 8 Km | 16 Km | | | | 52:55 | | | | | | | 8 | Rest | 8 Km | Rest | 5 Km | 5 K | Rest | Race | | | | | | | | | | |------+------+---------------+--------+---------+------+--------+---------------| * [2016-05-02 Mon] Haskell bookmarks :PROPERTIES: :CUSTOM_ID: haskell-bookmarks :END: :MODIFIED: [2018-10-18 Thu] :END: - [[https://twitter.com/argumatronic/status/1006583364265152513?s=12][A gentle introduction to profunctors talk]]. - [[https://news.ycombinator.com/item?id=11606290][A Haskell Reading List (Hacker News)]]. - [[http://www.stephendiehl.com/posts/essential_haskell.html][A Haskell Reading List]]. - [[https://news.ycombinator.com/item?id=17818295][Advice for Haskell beginners (2017) (Hacker News)]]. - [[https://lexi-lambda.github.io/blog/2018/02/10/an-opinionated-guide-to-haskell-in-2018/][An opinionated guide to Haskell in 2018]]. - [[https://www.goodreads.com/book/show/25587599-haskell-programming][Haskell Programming: From First Principles]]. - [[https://diogocastro.com/blog/2018/10/17/haskells-kind-system-a-primer/][Haskell's kind system - a primer]]. - [[http://learnyouahaskell.com/higher-order-functions][Higher order functions]]. - [[https://github.com/commercialhaskell/intero][Intero: Complete interactive development program for Haskell]]. - [[http://people.cs.aau.dk/~normark/prog3-03/html/notes/higher-order-fu_themes-intr-section.html][Introduction to higher-order functions]]. - [[https://begriffs.com/posts/2016-05-14-pragmatic-haskell-1.html][Pragmatic Haskell for Beginners, Lecture 1]]. - [[https://hackage.haskell.org/user/RenzoCarbonara][Renzo Carbonara (Hackage)]]. * [2016-04-17 Sun] Haskell notes :PROPERTIES: :CUSTOM_ID: haskell-notes :END: ** Referential transparency An expression consistently evaluating to the same result, regardless of context. ** References - [[http://learnyouahaskell.com/][learnyouahaskell.com]]. - [[https://wiki.haskell.org][wiki.haskell.org]]. * [2016-03-28 Mon] Emacs Objective-C tagging with RTags :PROPERTIES: :CUSTOM_ID: emacs-objective-c-tagging-with-rtags :END: ** Install libclang on Mac #+BEGIN_SRC sh brew install llvm --with-clang #+END_SRC ** Install RTags #+BEGIN_SRC sh git clone --recursive https://github.com/Andersbakken/rtags.git cd rtags cmake -DCMAKE_PREFIX_PATH=/Users/your-user-name/homebrew/opt/llvm -DCMAKE_EXPORT_COMPILE_COMMANDS=1 . make #+END_SRC ** Start RTags daemon #+BEGIN_SRC sh path/to/rtags/bin/rdm 2> /tmp/rdm.log #+END_SRC ** Compilation database *** Install xctool #+BEGIN_SRC sh brew install xctool #+END_SRC *** Generate a compilation database #+BEGIN_SRC sh cd path/to/your/objc-project xctool -sdk iphonesimulator -arch x86_64 -scheme SomeScheme -reporter pretty -reporter json-compilation-database:compile_commands.json clean build #+END_SRC ** Load compilation database #+BEGIN_SRC sh path/to/rtags/bin/rc -J path/to/your/objc-project/compile_commands.json #+END_SRC ** Install RTags Emacs package #+BEGIN_SRC emacs-lisp (use-package rtags :ensure t :config (setq rtags-use-helm t) ;; Optional. Enable if helm fan (I am!). (setq rtags-path "path/to/rtags/bin/")) #+END_SRC ** Ready to go Use any of the rtags interactive commands. For example: #+BEGIN_EXAMPLE M-x rtags-find-symbol #+END_EXAMPLE ** References - [[https://github.com/Andersbakken/rtags#tldr-quickstart][RTags TLDR Quickstart]]. - [[http://syamajala.github.io/c-ide.html][Emacs as C++ IDE]]. * [2016-03-10 Thu] Database bookmarks :PROPERTIES: :CUSTOM_ID: database-bookmarks :END: :MODIFIED: [2016-12-10 Sat] :END: - [[http://grimoire.ca/mysql/choose-something-else][Considering MySQL? Use something else]]. - [[http://www.columbia.edu/~fdc/postal/][Frank's compulsive guide to postal addresses]]. * [2016-03-06 Sun] Python tips backlog :PROPERTIES: :CUSTOM_ID: python-tips-backlog :END: **** TODO [[https://news.ycombinator.com/item?id=11210370][A Better Pip Workflow (Hacker News)]]. * [2016-03-05 Sat] Bruges travel bookmarks :PROPERTIES: :CUSTOM_ID: bruges-travel-bookmarks :END: - [[http://www.assietteblanche.be/][assietteblanche.be]]. - Beer flavored meals at Den Dyver. - [[http://bistrozwarthuis.be][bistrozwarthuis.be]]. - Eat fries in front of the belfry and climb it. - [[http://www.kok-au-vin.be][kok-au-vin.be]]. - [[http://www.kurtspan.be/][kurtspan.be]]. - Minnewater and the old Beguinage. - Old Saint john's Hospital. - Relic of the Holy Blood and City hall. - [[http://www.restomojo.tk][restomojo.tk]]. - [[http://www.thechocolateline.be/en][The Chocolate Line]]. - The Garre, near the Burg and drink their house Tripel. - [[http://www.tomsdiner.be][tomsdiner.be]]. - Try out Straffe Hendrik beer at brewery terrace. - Walk behind Gruuthuse over the little Saint Bonifaas bridge. * [2016-03-02 Wed] Emacs lisp snippets :PROPERTIES: :CUSTOM_ID: emacs-lisp-snippets :END: ** cl-loop for in #+begin_src emacs-lisp :results output (cl-loop for day in '("mon" "tue" "wed" "thu" "fri" "sat" "sun") do (print day)) #+end_src #+RESULTS: #+begin_example "mon" "tue" "wed" "thu" "fri" "sat" "sun" #+end_example ** cl-loop for from to #+begin_src emacs-lisp :results output (cl-loop for x from 1 to 5 do (print x)) #+end_src #+RESULTS: #+begin_example 1 2 3 4 5 #+end_example ** pcase literal matching #+begin_src emacs-lisp (pcase "word" ('word (message "Matched 'word symbol")) ("word" (message "Matched \"word\" string"))) #+end_src #+RESULTS: : Matched "word" string ** Avoid nesting with the help of thread-first and thread-last. #+begin_src emacs-lisp (thread-last "12.....34" (string-remove-prefix "1") (string-remove-suffix "4")) #+end_src #+RESULTS: : 2.....3 ** Find file upwards, up parents, up hierarchy #+BEGIN_SRC emacs-lisp (locate-dominating-file FILE NAME) #+END_SRC ** Find executable in PATH #+BEGIN_SRC emacs-lisp (executable-find COMMAND) #+END_SRC ** Read string with completion (helm/ido/ivy friendly) #+BEGIN_SRC emacs-lisp (completing-read PROMPT COLLECTION &optional PREDICATE REQUIRE-MATCH INITIAL-INPUT HIST DEF INHERIT-INPUT-METHOD) #+END_SRC ** Execute command/process and return list (similar to shell-command-to-string) #+BEGIN_SRC emacs-lisp (process-lines PROGRAM &rest ARGS) #+END_SRC ** Iterating org buffer #+BEGIN_SRC emacs-lisp (org-element-map (org-element-parse-buffer) '(headline link) (lambda (element) (cond ((and (eq (org-element-type element) 'headline) (= (org-element-property :level element) 1)) (print "headline")) ((eq (org-element-type element) 'link) (print "link"))) nil)) #+END_SRC * [2016-02-18 Thu] Some modern Objective-C idioms :PROPERTIES: :CUSTOM_ID: some-modern-objective-c-idioms :END: ** NSNumber literals #+BEGIN_SRC objc NSNumber *number1 = @1024; NSNumber *number2 = @1024.123f; NSNumber *number3 = @'A'; NSNumber *number4 = @YES; NSNumber *number5 = @24ul; // Unsigned long. NSNumber *number6 = @123456ll; // Long Long. NSNumber *number7 = @5050.50; // Float. NSNumber *number8 = @1543; // Integer NSNumber *number9 = @111.456; // Double #+END_SRC ** Array literals #+BEGIN_SRC objc NSArray *names = @[@"John\n", @"Peter\n", @"Jaye\n", @"George\n", @"Max"]; NSArray *mutableNames = [@[@"John\n", @"Peter\n", @"Jaye\n", @"George\n", @"Max"] mutableCopy]; #+END_SRC * [2016-02-16 Tue] Cross-platform development bookmarks :PROPERTIES: :CUSTOM_ID: cross-platform-development-bookmarks :END: - [[https://news.ycombinator.com/item?id=11105027][How to Distribute Binaries for OS X Using Homebrew (Hacker News)]]. * [2016-02-15 Mon] Generating a random MAC address :PROPERTIES: :CUSTOM_ID: generating-a-random-mac-address :END: As some point I had to generate a random MAC address. This is the snippet I used: #+BEGIN_SRC python :results output :exports both import random def randomMAC(): mac = [0x00, 0x16, 0x3e, random.randint(0x00, 0x7f), random.randint(0x00, 0xff), random.randint(0x00, 0xff), ] return ':'.join(map(lambda x: "%02x" % x, mac)) print 'MAC => %s' % randomMAC() #+END_SRC #+RESULTS: : MAC => 00:16:3e:7e:f7:fa * [2016-02-14 Sun] Defined elisp variables matching regexp :PROPERTIES: :CUSTOM_ID: defined-elisp-variables-matching-regexp :END: You can use "M-x /apropos-variable/" to get documentation for variables matching a pattern. For more flexibility, some elisp can help with getting a list of all variables matching a regexp: #+BEGIN_SRC emacs-lisp :exports both (defun ar/variables-matching-pattern (pattern) "Get a list of all variables matching PATTERN." (let ((matched-variables '())) (mapatoms (lambda (symbol) ;; Symbol is variable? (when (and (boundp symbol) (string-match pattern (symbol-name symbol))) (add-to-list 'matched-variables symbol)))) matched-variables)) (let ((variables "")) (mapc (lambda (variable-symbol) (setq variables (concat variables (format "%s => %s\n" (symbol-name variable-symbol) (symbol-value variable-symbol))))) (ar/variables-matching-pattern "^tern-.*")) variables) #+END_SRC #+RESULTS: #+BEGIN_EXAMPLE tern-mode-keymap => (keymap (3 keymap (4 . tern-get-docs) (3 . tern-get-type) (18 . tern-rename-variable)) (27 keymap (44 . tern-pop-find-definition) (67108910 . tern-find-definition-by-name) (46 . tern-find-definition))) tern-update-argument-hints-async => nil tern-known-port => nil tern-mode => nil tern-activity-since-command => -1 tern-project-dir => nil tern-last-point-pos => nil tern-last-completions => nil tern-explicit-port => nil tern-idle-time => 2.5 tern-find-definition-stack => nil tern-last-argument-hints => nil tern-idle-timer => nil tern-server => nil tern-last-docs-url => nil tern-buffer-is-dirty => nil tern-command-generation => 0 tern-flash-timeout => 0.5 tern-update-argument-hints-timer => 500 tern-mode-hook => nil tern-command => (tern) #+END_EXAMPLE * [2016-02-13 Sat] Proselint via Emacs flycheck :PROPERTIES: :CUSTOM_ID: proselint-via-emacs-flycheck :END: Based on [[http://unconj.ca/blog/linting-prose-in-emacs.html][Linting Prose in Emacs]]... Needs proselint installed: #+BEGIN_SRC sh pip install proselint #+END_SRC Also needs a flycheck checker defined: #+BEGIN_SRC emacs-lisp (flycheck-define-checker proselint "A linter for prose." :command ("proselint" source-inplace) :error-patterns ((warning line-start (file-name) ":" line ":" column ": " (id (one-or-more (not (any " ")))) (message) line-end)) :modes (gfm-mode markdown-mode org-mode text-mode)) (add-to-list 'flycheck-checkers 'proselint) #+END_SRC * [2016-02-11 Thu] Generate go struct definition from json file :PROPERTIES: :CUSTOM_ID: generate-go-struct-definition-from-json-file :END: From [[https://github.com/bittersweet/dotfiles/blob/master/notes/go.txt#L3][Generate go struct definition from json file]], and before I forget: #+BEGIN_SRC go curl http://url.tld/file.json | gojson -name=Repository #+END_SRC * [2016-02-11 Thu] Doh! undo last commit (Magit edition) :PROPERTIES: :CUSTOM_ID: doh-undo-last-commit-magit-edition :END: I previously noted [[#doh-undo-last-git-commit][how to undo your last git commit (ie. soft reset)]]. Using Magit: 1. M-x /magit-log-current/. 2. Move point to prior revision. 3. M-x /magit-reset-soft/ (defaults to revision at point). Or if you want a single function: #+BEGIN_SRC emacs-lisp (require 'magit) (defun ar/magit-soft-reset-head~1 () "Soft reset current git repo to HEAD~1." (interactive) (magit-reset-soft "HEAD~1")) #+END_SRC * [2016-02-06 Sat] Redux bookmarks :PROPERTIES: :CUSTOM_ID: redux-bookmarks :END: :MODIFIED: [2018-11-24 Sat] :END: - [[https://medium.com/@spitzwegerich/a-different-way-of-supplying-react-components-with-state-1093f8f79802#.n1ffge76m][A different way of supplying React-components with state]]. - [[https://news.ycombinator.com/item?id=11890229][A SoundCloud client in React and Redux (Hacker News)]]. - [[https://github.com/xgrommx/awesome-redux][Awesome redux]] (collection of libraries in ecosystem). - [[https://news.ycombinator.com/item?id=11886662][Building React Applications with idiomatic redux (Hacker News)]]. - [[https://blog.boldlisting.com/connecting-redux-to-your-api-eac51ad9ff89#.nu7dpwklf][Connecting Redux to your API]]. - [[https://github.com/markerikson/react-redux-links][Curated awesome Redux tutorial and resource links]]. - [[https://github.com/acdlite/redux-actions][Flux Standard Action utilities for Redux]]. - [[http://stackoverflow.com/questions/33992812/how-to-integrate-redux-with-very-large-data-sets-and-indexeddb][How to integrate Redux with very large data-sets and IndexedDB? (Stack Overflow)]]. - [[https://medium.com/@matt.krick/introducing-redux-operations-332ab56e468b#.buk8m7oug][Introducing Redux operations]]. - [[https://blog.madewithlove.be/post/redux/][Managing data flow on the client-side]]. - [[http://redux.js.org/docs/introduction/Motivation.html][Motivation for flux]]. - [[https://gist.github.com/brentvatne/52af349a6b6ef2ee1b06][NavigationExperimental notes]]. - [[https://www.youtube.com/watch?v=76FRrbY18Bs][Preethi Kasireddy - MobX vs Redux: Comparing the Opposing Paradigms]]. - [[https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0#.plqwdhbyo][Presentational and Container Components]]. - [[https://github.com/rackt/react-redux][React-redux official bindings]]. - [[https://egghead.io/courses/react-flux-architecture-es6][React: Flux Architecture (ES6) - Course by @joemaddalone @eggheadio]]. - [[http://lucamezzalira.com/2016/03/08/reactive-programming-with-rxjs/][Reactive Programming with RxJS]]. - [[http://redux.js.org/docs/advanced/AsyncActions.html][Redux async actions]]. - [[https://medium.com/lexical-labs-engineering/redux-best-practices-64d59775802e#.7y43ask6a][Redux best practices]]. - [[http://redux.js.org/docs/introduction/Examples.html#real-world][Redux code examples]]. - [[https://github.com/markerikson/redux-ecosystem-links][Redux ecosystem links]]. - [[https://github.com/acdlite/redux-promise][Redux promise]]. - [[http://stackoverflow.com/questions/33726644/redux-state-persistence-with-a-database][Redux state persistence with a database (State Overflow)]]. - [[https://github.com/gaearon/redux-thunk][Redux thunk]]. - [[http://stackoverflow.com/questions/32949859/redux-opinions-examples-of-how-to-do-backend-persistence/33055146][Redux: Opinions/examples of how to do backend persistence? (Stack Overflow)]]. - [[https://github.com/guangmingzizai/RefluxCocoa][RefluxCocoa: an implementation of Reflux in Objective-C]]. - [[http://jaysoo.ca/2016/02/28/organizing-redux-application/][Rules for structuring (redux) applications ]]. - [[https://medium.com/swlh/the-case-for-flux-379b7d1982c6#.7tcw9qi01][The case for flux]]. - [[http://jlongster.com/Two-Weird-Tricks-with-Redux][Two weird tricks with redux]]. - [[https://github.com/ServiceStackApps/typescript-redux][TypeScript Redux]]. - [[https://medium.com/@lizdenhup/understanding-unidirectional-data-flow-in-react-3e3524c09d8e][Understanding unidirectional data flow in React – Elizabeth Denhup – Medium]]. * [2016-02-06 Sat] Javascript tips backlog :PROPERTIES: :CUSTOM_ID: javascript-tips-backlog :END: :MODIFIED: [2016-02-13 Sat] :END: **** TODO [[https://vinta.ws/code/tern-js-with-atom.html][Tern.js with Atom]]. **** TODO [[https://github.com/sebmarkbage/ecmascript-rest-spread][Object spread syntax proposed for ES7]]. **** TODO if (typeof myvar === 'undefined') ... **** TODO copy object and set with Object.assign({}, state, {property: newValue}). **** TODO Use ES6 computed property syntax. **** TODO ES6 syntax: import * as reducers from './reducers'. * [2016-02-06 Sat] Emacs lisp tips backlog :PROPERTIES: :CUSTOM_ID: emacs-lisp-tips-backlog :END: :MODIFIED: [2018-12-27 Thu] :END: **** TODO [[https://github.com/mola-T/signal][Signal: a library offering enriched hook-like features]]. **** TODO [[http://mbork.pl/2016-05-15_debug-on-whatever][Debugging tips]]. **** TODO [[http://article.gmane.org/gmane.emacs.devel/202535][Examples of Emacs modules]]. **** TODO [[https://gitlab.com/RobertCochran/neato-graph-bar][htop-like CPU and memory graphs for Emacs]]. **** TODO [[https://github.com/mola-T/timp][Timp: multithreading library]]. **** TODO [[http://www.wilfred.me.uk/blog/2016/04/28/effortless-major-mode-development/][Effortless Major Mode Development]]. **** TODO [[https://github.com/tkych/cl-spark][cl-spark implementation of Zach Holman's spark and Gil Gonçalves' vspark with little extension]]. **** TODO [[http://endlessparentheses.com/new-in-emacs-25-1-map-el-library.html][map.el for map-like collections built-in as of 25.1]]. **** TODO [[https://github.com/emacs-mirror/emacs/blob/master/lisp/emacs-lisp/map.el][Standard library for key/value data structures]]. **** TODO [[http://oremacs.com/2015/01/11/pretty-elisp-regex/][Making Elisp regex look nicer]]. **** TODO [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Porting-old-advices.html#Porting-old-advices][Adapting code using the old defadvice]]. **** TODO [[http://endlessparentheses.com/new-on-elpa-and-in-emacs-25-1-seq-el.html][seq.el sequence library built-in as of 25.1]]. **** TODO [[https://github.com/syohex/emacs-parson][Binding of parson JSON parser]]. **** TODO [[http://puntoblogspot.blogspot.co.uk/2016/02/with-this-little-trick-helm-dash-gets.html?m=1][Helm-dash find-as-you-type]]. **** TODO [[http://emacs.stackexchange.com/questions/12121/org-mode-parsing-rich-html-directly-when-pasting][Org mode - Parsing rich HTML directly when pasting? (Stack Overflow)]]. **** TODO From [[https://twitter.com/_wilfredh/status/694643167056916480][@_wilfredh]], use (interactive "*") for commands that edit the buffer, so they show a helpful error if the buffer is read only. * [2016-02-04 Thu] Entering accents in Emacs :PROPERTIES: :CUSTOM_ID: entering-accents-in-emacs :END: Via Irreal's [[http://irreal.org/blog/?p=4945][Entering Accented Characters in Emacs]], a reminder on how to enter accents using *C-x 8*. For example: #+BEGIN_EXAMPLE C-x 8 ' A -> Á #+END_EXAMPLE * [2016-02-04 Thu] Really delete iPhone photos :PROPERTIES: :CUSTOM_ID: really-delete-iphone-photos :END: After deleting photos, go to: #+BEGIN_QUOTE Albums -> Recently Deleted -> Select -> Delete All #+END_QUOTE * [2016-02-03 Wed] Vancouver travel bookmarks :PROPERTIES: :CUSTOM_ID: vancouver-travel-bookmarks :END: :MODIFIED: [2021-11-23 Tue] :END: - [[http://www.myfiveacres.com/travel-inspiration/17-reasons-to-visit-vancouver-this-summer/][17 Reasons To Visit Vancouver This Summer]]. - [[https://www.lonelyplanet.com/amp/articles/best-places-to-visit-in-canada][The 15 most incredible places to visit in Canada]]. * [2016-02-03 Wed] Schnitzel recipe :PROPERTIES: :CUSTOM_ID: schnitzel-recipe :END: Since [[#fischers-london-yes-but][eating at Fischers's]], I've been inclined to make Schnitzel. This is my attempt. ** Ingredients - Salt and ground black pepper. - All-purpose flour. - Eggs (beaten). - Bread crumbs (natural). - Oil. ** Preparation - Flatten the pork/chicken/veal. - Season (salt and pepper). - Heat pan with a generous amount of oil. - Dip into flour -> egg -> bread crumbs. ** Garnish - Anchovies. - Capers. ** Photo [[file:images/schnitzel-recipe/schnitzel.jpg]] * [2016-02-03 Wed] Hot reloading with react and redux :PROPERTIES: :CUSTOM_ID: hot-reloading-with-react-and-redux :END: ** By Robert Knight ([[http://twitter.com/robknight_][@robknight_]]). ** Checkout - [[http://browserify.org][Browserify]]. - [[https://webpack.github.io][Webpack]] (more stable?). - [[https://github.com/gaearon/react-transform-hmr][React-transform-hmr]]. - [[https://github.com/jchansen/reselect][Reselect]]: A redux selector for redux. ** Slides - https://github.com/robertknight/hot-reloading-talk * [2016-02-03 Wed] Converting Unix epoc time to human readable date :PROPERTIES: :CUSTOM_ID: converting-unix-epoc-time-to-human-readable-date :END: Via [[https://twitter.com/climagic][climagic]]'s [[https://twitter.com/climagic/status/694780560221147136][Turn a Unix epoch time back into a human readable date]]: ** GNU #+BEGIN_SRC sh :exports both date -d @192179700 #+END_SRC #+RESULTS: : Tue Feb 3 07:15:00 GMT 1976 ** BSD/OS X #+BEGIN_SRC sh :exports both date -r 192179700 #+END_SRC #+RESULTS: : Tue Feb 3 07:15:00 GMT 1976 * [2016-02-03 Wed] Objective-C bookmarks :PROPERTIES: :CUSTOM_ID: objective-c-bookmarks :END: :MODIFIED: [2016-03-06 Sun] :END: - [[http://www.miqu.me/blog/2015/04/17/adopting-nullability-annotations/][Adopting Nullability Annotation]]. - [[http://www.miqu.me/blog/2015/06/09/adopting-objectivec-generics/][Adopting Objective-C generics]]. - [[https://cocoa.tumblr.com][Cocoa at Tumblr]]. - [[https://github.com/uhub/awesome-objective-c][Curated list of awesome Objective-C frameworks, libraries and software]]. - [[https://www.raywenderlich.com/66395/documenting-in-xcode-with-headerdoc-tutorial][Documenting in Xcode with HeaderDoc Tutorial]]. - [[http://fuckingblocksyntax.com][How Do I Declare A Block in Objective-C?]]. - [[https://www.objc.io/issues/13-architecture/mvvm][Introduction to MVVM]]. - [[https://developer.apple.com/swift/blog/?id=25][Nullability and Objective-C]]. - [[http://oleb.net/][Ole Begemann's page]]. - [[https://github.com/ReactiveCocoa/ReactiveCocoa][ReactiveCocoa]]. - [[https://pewpewthespells.com/blog/xcode_build_system.html][The Xcode Build System]]. - [[http://iosdevtips.co/post/118711491198/avoid-retain-cycles-weak-strong][Tip: Avoid retain cycles without doing the strong to weak dance]]. - [[https://medium.com/@oscarcortes/using-swift-string-enums-in-objective-c-f6683da5b92e#.4526yy6s4][Using Swift String enums in Objective-C]]. * [2016-02-02 Tue] Timesinking bookmarks :PROPERTIES: :CUSTOM_ID: timesinking-bookmarks :END: :MODIFIED: [2019-01-12 Sat] :END: - [[https://www.youtube.com/channel/UCsXVk37bltHxD1rDPwtNM8Q][In a Nutshell channel (YouTube)]]. - [[https://www.reddit.com/r/oddlysatisfying][Oddly Satisfying (Subreddit)]]. - [[https://anvaka.github.io/sayit][Related subreddits based on your comments]]. - [[https://www.reddit.com/r/knolling][To knoll me is to love me (Subreddit)]]. * [2016-02-02 Tue] Suspend and reattach processes :PROPERTIES: :CUSTOM_ID: suspend-and-reattach-processes :END: Via [[https://twitter.com/climagic][climagic]]'s [[https://twitter.com/climagic/status/694242271286431744?refsrc=email&s=11][Suspend and reattach a process to screen]]: #+BEGIN_SRC sh longcmd ; [Ctrl-Z] ; bg ; disown ; screen ; reptyr $( pidof longcmd ) #+END_SRC * [2016-02-02 Tue] Czech Republic travel bookmarks :PROPERTIES: :CUSTOM_ID: czech-republic-travel-bookmarks :END: - [[https://en.wikipedia.org/wiki/Strahov_Monastery][Strahov Monastery]]. * [2016-02-02 Tue] Meditation tips backlog :PROPERTIES: :CUSTOM_ID: meditation-tips-backlog :END: **** TODO [[http://www.workman.com/static/realhappinessebook/][Real Happiness Audio Files]]. **** DONE [[https://www.intelligentlifemagazine.com/content/features/wanting-versus-liking][The science of craving]]. * [2016-02-02 Tue] Append jpegs in a video sequence :PROPERTIES: :CUSTOM_ID: append-jpegs-in-a-video-sequence :END: Via [[https://twitter.com/climagic][climagic]]'s [[https://twitter.com/climagic/status/692821765110767616?refsrc=email&s=11][make slideshow from *.jpg]]: #+BEGIN_SRC sh for p in *.jpg; do ffmpeg -loop_input -f image2 -i $p -t 3 -r 4 -s 1080x720 -f avi - >> slides.avi; done #+END_SRC * [2016-02-02 Tue] Regular expressions bookmarks :PROPERTIES: :CUSTOM_ID: regular-expressions-bookmarks :END: :MODIFIED: [2020-05-02 Sat] :END: - [[https://dev.to/emmawedekind/regex-cheat-sheet-2j2a][Regex Cheat Sheet - DEV Community]]. - [[https://www.janmeppe.com/blog/regex-for-noobs/][Regex For Noobs (like me!) - An Illustrated Guide - Janmeppe.com]]. - [[https://regex101.com/][regex101.com]]. - [[https://regex101.com/][Regex101]]: Online regex tool. - [[https://refrf.shreyasminocha.me/][Regular Expressions for Regular Folk]]. - [[https://rubular.com/][Rubular: a Ruby regular expression editor]]. * [2016-02-02 Tue] Typescript bookmarks :PROPERTIES: :CUSTOM_ID: typescript-bookmarks :END: :MODIFIED: [2019-01-27 Sun] :END: - [[https://blog.mgechev.com/2018/11/19/introduction-bazel-typescript-tutorial/][Building TypeScript Projects with Bazel (Minko Gechev's blog)]]. - [[http://definitelytyped.org][DefinitelyTyped: The repository for high quality TypeScript type definitions]]. - [[https://github.com/ivogabe/gulp-typescript][gulp-typescript]]. - [[https://github.com/Microsoft/TypeScript/wiki/JSX][React/JSX Typescript support]]. - [[https://github.com/palantir/tslint][tslint]]. - [[https://github.com/Asana/typed-react][Typed-react]]. - [[https://news.ycombinator.com/item?id=18975373][TypeScript Tricks: Type Guards (Hacker News)]]. - [[https://github.com/TypeStrong][TypeStrong: TypeScript workflows]]. - [[https://github.com/typings][Typings: The type definition manager for TypeScript]]. - [[https://medium.com/react-native-training/up-and-running-with-react-native-and-typescript-8d398e910a19][Up and Running with React Native and TypeScript]]. * [2016-02-02 Tue] Hiding HTML elements :PROPERTIES: :CUSTOM_ID: hiding-html-elements :END: Hide with [[https://developer.mozilla.org/en-US/docs/Web/CSS/display][display:none]] (exclude from layout) and [[https://developer.mozilla.org/en-US/docs/Web/CSS/visibility][visibility:hidden]] (include in layout). * [2016-02-01 Mon] Echo Emacs keybiding from function name :PROPERTIES: :CUSTOM_ID: echo-emacs-keybiding-from-function-name :END: Picked up via Emacs Redux's [[http://emacsredux.com/blog/2016/02/01/display-the-keybinding-for-a-command-with-substitute-command-keys/][Display the Keybinding for a Command With Substitute-command-keys]], with my own example: #+BEGIN_SRC emacs-lisp :exports both (message (substitute-command-keys "Press \\[ar/ox-html-export] to export org file")) #+END_SRC #+RESULTS: : Press to export org file * [2016-02-01 Mon] Emacs dired for batch byte compilation :PROPERTIES: :CUSTOM_ID: emacs-dired-for-batch-byte-compilation :END: Recently updated org-mode and started seeing an invalid function error: #+BEGIN_QUOTE Error (use-package): ob :config: Invalid function: org-babel-header-args-safe-fn #+END_QUOTE Just learned dired enables you to mark files and byte compile via /M-x dired-do-byte-compile/. * [2016-01-29 Fri] Serializing to JSON on iOS :PROPERTIES: :CUSTOM_ID: serializing-to-json-on-ios :END: #+BEGIN_SRC objc NSDictionary *dictionary = @{ @"key1" : @"val1\n", @"key2" : @"val2\n", @"key3" : @"val3\n", @"key4" : @"val4\n", @"key5" : @"val5\n", @"key6" : @"val6\n", }; NSError *error; NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dictionary options:0 error:&error]; if (error) { // noooooooooo! } NSString *json = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; #+END_SRC * [2016-01-25 Mon] Fischer's London: yes, but... :PROPERTIES: :CUSTOM_ID: fischers-london-yes-but :END: ** Yes Step into a Viennese blast from the past. Beautiful setting and pleasant vibe. Ordered a dirty martini on the rocks, a bottle of Merlot, Käsespätzle (with bacon), and Wiener Schnitzel (with anchovy/capers/egg). All very tasty. ** But... Surprisingly, desserts (Topfenstrudel, Berggasse and coffee) were nothing spectacular. Also not a cheap eat (£50 per person). ** Photos [[file:images/fischers-london-yes-but/fischers-03.JPG]] [[file:images/fischers-london-yes-but/fischers-04.JPG]] [[file:images/fischers-london-yes-but/fischers-05.JPG]] [[file:images/fischers-london-yes-but/fischers-06.JPG]] [[file:images/fischers-london-yes-but/fischers-07.JPG]] [[file:images/fischers-london-yes-but/fischers-08.JPG]] [[file:images/fischers-london-yes-but/fischers-09.JPG]] [[file:images/fischers-london-yes-but/fischers-10.JPG]] [[file:images/fischers-london-yes-but/fischers-11.JPG]] [[file:images/fischers-london-yes-but/fischers-12.JPG]] * [2016-01-25 Mon] Polar travel bookmarks :PROPERTIES: :CUSTOM_ID: polar-travel-bookmarks :END: - [[http://www.quarkexpeditions.com/en][Quark expeditions]]. * [2016-01-24 Sun] Sweden travel bookmarks :PROPERTIES: :CUSTOM_ID: sweden-travel-bookmarks :END: - [[http://www.theworlds50best.com/list/1-50-winners/Faviken][Fäviken restaurant (world's most isolated restaurant)]]. - [[https://theculturetrip.com/europe/sweden/articles/the-most-hipster-hangouts-in-stockholm][Hangouts in Stockholm]]. - Vasa Museum. * [2016-01-20 Wed] Handwriting bookmarks :PROPERTIES: :CUSTOM_ID: handwriting-bookmarks :END: - [[http://briem.net][briem.net]]. - [[http://www.handwritingthatworks.com][Handwriting that works]]. * [2016-01-20 Wed] Chocolate fondant recipe :PROPERTIES: :CUSTOM_ID: chocolate-fondant-recipe :END: My girlfriend recently made a delicious chocolate fondant. Saving the [[http://www.theguardian.com/lifeandstyle/wordofmouth/2011/feb/10/how-cook-perfect-chocolate-fondants][The Guardian's recipe]]: ** Ingredients (2 servings) - 60g unsalted butter, cut into dice, plus extra to grease - 1 tbsp cocoa powder - 60g dark chocolate, broken into pieces - 1 egg and 1 egg yolk - 60g caster sugar - 1 tbsp plain flour ** Preparation 1. Pre-heat the oven to 200C if cooking immediately, and put a baking tray on the middle shelf. Butter the inside of 2 small ramekins or pudding moulds, and then put the cocoa in one and turn it to coat the inside, holding it over the second mould to catch any that escapes. Do the same with the other mould. 2. Put the butter and chocolate into a heatproof bowl set over, but not touching, a pan of simmering water and stir occasionally until melted. Allow to cool slightly. 3. Vigorously whisk together the egg, yolk, sugar and a pinch of salt until pale and fluffy. Gently fold in the melted chocolate and butter, and then the flour. Spoon into the prepared moulds, stopping just shy of the top – at this point the mixture can be refrigerated until needed, or even frozen, as the puddings will not wait around once cooked. 4. Put on to a hot baking tray and cook for 12 minutes (14 if from cold, 16 if frozen) until the tops are set and coming away from the sides of the moulds. Leave to rest for 30 seconds and then serve in the ramekins or turn out on to plates if you're feeling confident – they're great with clotted cream or plain ice cream. * [2016-01-20 Wed] Parenting bookmarks :PROPERTIES: :CUSTOM_ID: parenting-bookmarks :END: :MODIFIED: [2021-07-03 Sat] :END: - [[http://www.janetlansbury.com/2018/07/a-toddlers-do-it-myself-attitude-ends-in-tantrums/][A Toddler's Do-It-Myself Attitude Ends In Tantrums - Janet Lansbury]]. - [[https://news.ycombinator.com/item?id=17023693][Ask HN: Any good collaboratively built documentation on good parenting? (Hacker News)]]. - [[https://news.ycombinator.com/item?id=20069714][Ask HN: I need ideas to impress fifth graders with technology]]. - [[https://news.ycombinator.com/item?id=23711942][Ask HN: Recommend a maths book for a teenager? | Hacker News]]. - [[https://codecombat.com/][CodeCombat - Learn how to code by playing a game]]. - [[https://www.goodreads.com/book/show/32497573-everyone-s-a-aliebn-when-ur-a-aliebn-too][Everyone's a Aliebn When Ur a Aliebn Too by Jomny Sun]]. - [[https://twitter.com/ankitshah/status/1305588478592217088][For parents out there, how much money did you have saved up when you had your first kid?]]. - [[http://blog.growingwithscience.com/][Growing With Science Blog]]. - [[https://conference.michellegale.com/][Home - Mindful Parenting Online Conference]]. - [[https://www.npr.org/sections/goatsandsoda/2019/03/13/685533353/a-playful-way-to-teach-kids-to-control-their-anger][How Inuit Parents Teach Kids To Control Their Anger (NPR)]]. - [[https://news.ycombinator.com/item?id=17435671][How to get kids to pay attention (Hacker News)]]. - [[https://twitter.com/brainpicker/status/1173363871035383808][How to raise a child – 10 rules from young single mom]]. - [[https://www.brainpickings.org/2012/09/13/susan-sontag-10-rules-for-raising-a-child/][How to Raise a Child: 10 Rules from Young Susan Sontag – Brain Pickings]]. - [[https://www.amazon.co.uk/How-Talk-Kids-Will-Listen/dp/1848123094/ref=sr_1_1][How to Talk so Kids Will Listen and Listen so Kids Will Talk]]. - [[https://www.reddit.com/r/UKPersonalFinance/comments/af2z1b/im_becoming_a_dad_for_the_first_time_in_may_what/][I'm becoming a Dad for the first time in May. What are you top finacial tips when becoming a parent? : UKPersonalFinance]]. - [[https://aeon.co/essays/do-people-have-a-moral-duty-to-have-children-if-they-can][Is it OK to have kids?]]. - [[https://letgrow.org/][Let Grow | When Adults Step Back, Kids Step Up.]]. - [[https://www.designmom.com/lets-talk-about-protecting-our-families/][Let's Talk About Protecting Our Families (debunked gun defense arguments)]]. - [[https://blog.codinghorror.com/on-parenthood/][On Parenthood]]. - [[https://www.techwillsaveus.com/][Tech kits for bright sparks (from techwillsaveus)]]. - [[http://www.theglobeandmail.com/life/parenting/the-disintegration-of-the-parent-child-bond/article28191786/][The disintegration of the parent-child bond]]. - [[https://www.designmom.com/][The Intersection of Design & Motherhood | Top Lifestyle Blog | Design Mom]]. - [[https://www.amazon.com/Monster-End-This-Book/dp/0307010856][The Monster at the End of This Book: Jon Stone, Michael Smollin]]. - [[https://twitter.com/biomickwatson/status/1138778734054510592][Things people don't warn you about parenthood]]. - [[http://sachachua.com/blog/2019/03/visual-book-notes-no-drama-discipline-2014/][Visual Book Notes: No-Drama Discipline (2014)]]. - [[https://www.theatlantic.com/family/archive/2018/09/throw-your-childrens-art-away/570379/][Why It's Okay to Throw Your Children's Art Away - The Atlantic]]. * [2016-01-19 Tue] Ippudo London: yes, but... :PROPERTIES: :CUSTOM_ID: ippudo-london-yes-but :END: ** Yes [[http://www.ippudo.co.uk/find_us/][Central St. Giles]] location. Ordered a Kirin Ichiban beer and a Spicy Tonkotsu with a seasoned boiled egg. Awesome medium-spice broth, tasty egg and firm noodles. Got additional noodles for £1.50. ** But... The space feels soulless. Think generic, chain, Pizza Express... ** Photos [[file:images/ippudo-london-yes-but/ipuddo_00.JPG]] [[file:images/ippudo-london-yes-but/ipuddo_01.JPG]] [[file:images/ippudo-london-yes-but/ipuddo_02.JPG]] [[file:images/ippudo-london-yes-but/ipuddo_03.JPG]] [[file:images/ippudo-london-yes-but/ipuddo_04.JPG]] [[file:images/ippudo-london-yes-but/ipuddo_05.JPG]] [[file:images/ippudo-london-yes-but/ipuddo_06.JPG]] [[file:images/ippudo-london-yes-but/ipuddo_07.JPG]] * [2016-01-19 Tue] Added Emacs zone-rainbow :PROPERTIES: :CUSTOM_ID: added-emacs-zone-rainbow :END: [[http://twitter.com/kawabata][kawabata's]] [[https://github.com/kawabata/zone-rainbow][zone-rainbow]] popped up on melpa today. Added to zone-programs. Just because :) #+BEGIN_SRC emacs-lisp (use-package zone-rainbow :ensure t :after zone :config (setq zone-programs (vconcat [zone-rainbow] zone-programs))) #+END_SRC #+ATTR_HTML: :width 75% :height 75% [[file:images/added-emacs-zone-rainbow/zone-rainbow.gif]] * [2016-01-19 Tue] Safari's Web Inspector keyboard shortcuts :PROPERTIES: :CUSTOM_ID: safaris-web-inspector-keyboard-shortcuts :END: Via WebKit's blog, [[https://webkit.org/blog/4038/web-inspector-keyboard-shortcuts/][Web Inspector Keyboard Shortcuts]]: - ⌃⌘Y or ⌘\ continue. - F8 or ⇧⌘; step out. - F7 or ⌘; step in. - F6 or ⌘’ step over. * [2016-01-14 Thu] Copenhagen travel bookmarks :PROPERTIES: :CUSTOM_ID: copenhagen-travel-bookmarks :END: :MODIFIED: [2019-09-01 Sun] :END: - Christiania. - [[http://www.hijadesanchez.dk/][Hija de Sanchez]] restaurant. - [[http://cargocollective.com/marvogben][Marv og Ben]] restaurant. - [[http://mikkeller.dk/location/mikkeller-bar-viktoriagade-copenhagen/][Mikkeller Bar – Mikkeller]]. - Mikkeller Bar. - [[http://www.restaurantschonnemann.dk/][Schonnemann]] restaurant. - Tivoli. - Torvehallerne (food). * [2016-01-12 Tue] Import UIKit for simpler debugging :PROPERTIES: :CUSTOM_ID: import-uikit-for-simpler-debugging :END: I bookmarked [[http://furbo.org/2015/05/11/an-import-ant-change-in-xcode/][An @import-ant Change in Xcode]] and immediately forgot about it. The gist is to import UIKit to simplify inspecting objects during an lldb session: #+BEGIN_EXAMPLE (lldb) expr @import UIKit #+END_EXAMPLE Shorten typing by creating aliases in ~/.lldbinit: #+BEGIN_EXAMPLE command alias uikit expr @import UIKit command alias foundation expr @import Foundation #+END_EXAMPLE * [2016-01-12 Tue] iOS development tips backlog :PROPERTIES: :CUSTOM_ID: ios-development-tips-backlog :END: :MODIFIED: [2016-01-12 Tue] :END: **** DONE [[http://ruenzuo.github.io/static-analysis-on-ios-part-ii/][Static Analysis on iOS - Part II]]. **** DONE [[https://github.com/lukhnos/refactorial/][Clang-based C/C++/Objective-C refactoring toolset (unmaintained)]]. **** DONE [[https://github.com/dsmelov/simsim][SimSim: access to application data folders]]. **** DONE [[https://github.com/supermarin/xcpretty][xcpretty (fast and flexible formatter/prettifier for xcodebuild output)]]. **** DONE [[https://github.com/facebook/xctool][xctool]]. * [2016-01-11 Mon] Basic Emacs keybindings on Linux desktop :PROPERTIES: :CUSTOM_ID: basic-emacs-keybindings-on-linux-desktop :END: Miss C-a, C-e in your browser and other Linux apps? You can enable the GTK Emacs key theme: #+BEGIN_SRC sh $ gsettings set org.gnome.desktop.interface gtk-key-theme "Emacs" #+END_SRC or if on Cinnamon: #+BEGIN_SRC sh $ gsettings set org.cinnamon.desktop.interface gtk-key-theme Emacs #+END_SRC If your desktop environment is not running gnome-settings-daemon, start it with: #+BEGIN_SRC sh $ gnome-settings-daemon #+END_SRC More at [[http://www.jefftk.com/p/emacs-keybindings-in-chrome-without-gnome][Emacs Keybindings in Chrome Without Gnome]] and [[http://promberger.info/linux/2010/02/16/how-to-get-emacs-key-bindings-in-ubuntu/][How to get Emacs key bindings in Ubuntu]]. * [2016-01-08 Fri] Emacs Objective-C completion with Irony :PROPERTIES: :CUSTOM_ID: emacs-objective-c-completion-with-irony :END: ** Install libclang on Mac #+BEGIN_SRC sh brew install llvm --with-clang #+END_SRC ** Configure Emacs #+BEGIN_SRC emacs-lisp (use-package irony :ensure t :config (add-hook 'objc-mode-hook 'irony-mode) (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)) (use-package company-irony :ensure t :config (add-hook 'objc-mode-hook (lambda () (setq-local company-backends '((company-irony))))) (add-hook 'irony-mode-hook 'company-irony-setup-begin-commands)) #+END_SRC ** install irony server Run: #+BEGIN_EXAMPLE M-x irony-install-server #+END_EXAMPLE NOTE: Needs libclang: Install with "brew install llvm --with-clang" By default, irony-install-server did not find libclang on Mac OS. /irony-install-server/ invokes cmake for you. Work around by adding: #+BEGIN_EXAMPLE -DCMAKE_PREFIX_PATH=/Users/your-user-name/homebrew/opt/llvm #+END_EXAMPLE For example: #+BEGIN_EXAMPLE cmake -DCMAKE_PREFIX_PATH=/Users/your-user-name/homebrew/opt/llvm -DCMAKE_INSTALL_PREFIX\=/Users/your-user-name/.emacs.d/irony/ /Users/your-user-name/.emacs.d/elpa/irony-20160106.1223/server && cmake --build . --use-stderr --config Release --target install #+END_EXAMPLE ** Compilation database *** Install xctool #+BEGIN_SRC sh brew install xctool #+END_SRC *** Generate compilation database #+BEGIN_SRC sh xctool -sdk iphonesimulator -arch x86_64 -scheme SomeScheme -reporter pretty -reporter json-compilation-database:compile_commands.json clean build #+END_SRC ** Set Irony's database path #+BEGIN_QUOTE M-x irony-cdb-json-add-compile-commands-path #+END_QUOTE * [2016-01-07 Thu] Finland travel bookmarks :PROPERTIES: :CUSTOM_ID: finland-travel-bookmarks :END: :MODIFIED: [2018-10-13 Sat] :END: - [[http://www.nytimes.com/interactive/2016/07/07/travel/what-to-do-36-hours-helsinki-finland.html?smid=tw-nytimestravel&smtyp=cur][36 Hours in Helsinki]]. - Boat to the Baltics; Tallinn (Estonia). - Helsinki - Suomenlinna (former maritime fortress). - Lapland (husky sledding, reindeer, Santa Claus village). - [[https://www.flickr.com/photos/discounterintelligence/25360452443][Päivä no:23 Reitti no:23 no:12 | Leipomo K.E.Avikainen (try munkkipossu: pig shaped donut)]]. - [[https://www.ragu.fi/][Ragu Ravintola (try panfried fiesh, pulled pork, steak tartare, chocolate mouse)]]. - Rovaniemi for reindeer, dog sled, santaland, artic circle photos. * [2016-01-07 Thu] Northern lights travel bookmarks :PROPERTIES: :CUSTOM_ID: northern-lights-travel-bookmarks :END: :MODIFIED: [2016-01-07 Thu] :END: - Aim for a new moon (eg. 2016-01-10 or 2016-02-08). - Aim for [[http://sci.esa.int/cluster/33272-plasma-regions/?fbodylongid%3D1173][auroral zone]]. - [[http://www.guide-gunnar.no/?ac_id%3D1&ac_parent%3D1&ao_name%3Dforside][Guide Gunnar]] will go distance to ensure you see the lights. - [[http://www.sleddog.se/][Kiruna Sleddog Tours]]. - [[http://www.msm.no/sami-week-tromsoe-2015.287592-242995.html][Tromsø's reindeer racing]]. - [[http://www.visittromso.no/en][Tromsø]]. - [[http://villmarkssenter.no/vinterprogram/hundekj%25C3%25B8ring/][Hundekjøring]]: drive your own sled. - Tromsø whale watching. * [2016-01-06 Wed] Mexico travel bookmarks :PROPERTIES: :CUSTOM_ID: mexico-travel-bookmarks :END: :MODIFIED: [2021-07-05 Mon] :END: - [[https://www.lonelyplanet.com/amp/articles/best-places-to-visit-in-mexico][15 best places to visit in Mexico]]. - [[http://www.corazondepuebla.com.mx/acatepec.html][San Francisco Acatepec]]. * [2016-01-03 Sun] Emacs highlight-symbol-mode :PROPERTIES: :CUSTOM_ID: emacs-highlight-symbol-mode :END: Been a fan of [[https://github.com/fgeller/highlight-thing.el][highlight-thing-mode]]. It automatically highlights all instances of symbol at point. Today, I gave [[https://github.com/nschum/highlight-symbol.el][highlight-symbol]] a try. Similar concept, but also adds the ability to jump to next/previous instances of symbol at point. #+BEGIN_SRC emacs-lisp (use-package highlight-symbol :ensure t :config (set-face-attribute 'highlight-symbol-face nil :background "default" :foreground "#FA009A") (setq highlight-symbol-idle-delay 0) (setq highlight-symbol-on-navigation-p t) (add-hook 'prog-mode-hook #'highlight-symbol-mode) (add-hook 'prog-mode-hook #'highlight-symbol-nav-mode)) #+END_SRC #+ATTR_HTML: :width 75% :height 75% [[file:images/emacs-highlight-symbol-mode/highlight-symbol.gif]] * [2016-01-03 Sun] Gandhi's ever-contemporary wisdom :PROPERTIES: :CUSTOM_ID: gandhis-ever-contemporary-wisdom :END: From [[http://www.amazon.co.uk/Gandhi-Changing-Mohandas-Karamchand-published/dp/B015GRZTP2][Gandhi: Radical Wisdom for a Changing World]]: ** Anger "I do get angry, but I feel angry with myself for it. Full conquest of anger is possible only through self-realization. We should love even those who have the worst opinion of us. This is ahimsa, the rest is only ignorance." ** Bad handwriting "I am now of opinion that children should first be taught the art of drawing before learning how to write. Let the child learn his letters by observation as he does different objectives, such as flowers, birds, etc., and let him learn handwriting only after he has learned to draw objects." ** Conduct of the Ashram "Service without humility is selfishness and egotism." ** Eating "There is a great deal of truth in the saying that man becomes what he eats. The grosser the food, the grosser the body." ** Heart "There are chords in every human heart. If we only know how to strike the right chord, we bring out the music." ** Moral law The law of truth and love. ** Renouncing or forgoing Nishkulanand sings: "Renunciation of objects, without the renunciation of desires, is short-lived, however hard you may try." ** Silence "Man spoils matters much more by speech than by silence." ** Time "Every minute that runs to waste never returns. Yet, knowing this, how much time do we waste?" ** The palate "Turn to the birds and beasts, and what do you find? They never eat merely to please the palate, they never go on eating till their inside is full to overflowing. And yet, we regard ourselves as superior to the animal creation!" ** Vow of Swadeshi "The person who has taken the vow of swadeshi will never use articles which conceivably involve violation of truth in their manufature or on the part of their manufacturers." * [2016-01-02 Sat] Functional programming bookmarks :PROPERTIES: :CUSTOM_ID: functional-programming-bookmarks :END: :MODIFIED: [2019-12-07 Sat] :END: - [[http://adit.io/posts/2013-04-17-functors,_applicatives,_and_monads_in_pictures.html][Functors, Applicatives, And Monads In Pictures]]. - [[http://www.russbishop.net/monoids-monads-and-functors][Functors, Applicatives, and Monads in Plain English]]. - [[http://blog.tomduncalf.com/posts/functional-programming-fundamentals-talk][Tom Ducalf's Programming Fundamentals Talk]]. - [[http://blog.jenkster.com/2015/12/what-is-functional-programming.html][What is functional programming?]] - [[http://blog.jenkster.com/2015/12/which-programming-languages-are-functional.html][Which programming languages are functional?]] - [[https://blog.acolyer.org/2016/09/14/why-functional-programming-matters/][Why Functional Programming Matters]]. * [2016-01-02 Sat] 9 Productivity tips :PROPERTIES: :CUSTOM_ID: 9-productivity-tips :END: From HBR's [[https://hbr.org/2015/12/9-productivity-tips-from-people-who-write-about-productivity][9 Productivity Tips from People Who Write About Productivity]]: 1. Block time away from reactive tasks (email). 2. Business = wasted energy. 3. Exercise, sleep, and 90 minute work bursts. 4. Incomplete tasks prompt healthy thinking out of context. 5. Time off or stepping back is invaluable. 6. Genuinely help were most successful/enjoyable. 7. Plan for saying no while highlighting priority and seeking feedback. 8. Measure important behavior change. 9. Make time now (automate, simplify, etc.). * [2016-01-01 Fri] First meal of 2016 :PROPERTIES: :CUSTOM_ID: first-meal-of-2016 :END: ** Pancakes - 1 teaspoon of salt. - 1.5 cups of milk. - 2 cups of flour. - 2 eggs. - 2 tablespoons sugar. - 4 tablespoons of melted butter. - 6 teaspoons of baking powder. Makes 10/11 pancakes. [[file:images/first-meal-of-2016/shortstack.jpg]] * [2016-01-01 Fri] Last meal of 2015 :PROPERTIES: :CUSTOM_ID: last-meal-of-2015 :END: For our last meal of 2015, I contributed dal and rotis. This is my first attempt at making either one of these. Both recipes based on Anupy Singla's [[http://www.amazon.co.uk/Indian-Everyone-Anupy-Singla/dp/1572841621][Indian for Everyone]]. ** Dal Makhani (Buttered black lentils) [[file:images/last-meal-of-2015/dal-grid.png]] [[file:images/last-meal-of-2015/dal.jpg]] ** Roti-Chapati-Phulka [[file:images/last-meal-of-2015/roti-grid.png]] [[file:images/last-meal-of-2015/roti.jpg]] * [2015-12-30 Wed] Find in $PATH with type and which :PROPERTIES: :CUSTOM_ID: find-in-path-with-type-and-which :END: I typically use /which/ to figure out the first binary found in $PATH: #+BEGIN_SRC sh :results output :exports both which -a emacsclient #+END_SRC #+RESULTS: : /Users/user/homebrew/bin/emacsclient : /usr/bin/emacsclient I always forget about /type/ though: #+BEGIN_SRC sh :results output :exports both type -a emacsclient #+END_SRC #+RESULTS: : emacsclient is /Users/user/homebrew/bin/emacsclient : emacsclient is /usr/bin/emacsclient * [2015-12-30 Wed] npm basics :PROPERTIES: :CUSTOM_ID: npm-basics :END: ** Global vs local package installation location #+BEGIN_QUOTE {prefix}/lib/node_modules #+END_QUOTE vs #+BEGIN_QUOTE path/to/project/node_modules #+END_QUOTE ** View npm config #+BEGIN_SRC sh :results output :exports both npm config list #+END_SRC #+RESULTS: : ; cli configs : user-agent = "npm/2.14.2 node/v4.0.0 darwin x64" : : ; node bin location = /Users/user/.nvm/versions/node/v4.0.0/bin/node : ; cwd = /Users/user/stuff/active/blog : ; HOME = /Users/user : ; 'npm config ls -l' to show all defaults. : ** Get config value #+BEGIN_SRC sh :results output :exports both npm config get prefix #+END_SRC #+RESULTS: : /Users/user/.nvm/versions/node/v4.0.0 ** Set config value #+BEGIN_SRC sh npm config set prefix=$HOME/some/location #+END_SRC ** Install package globally #+BEGIN_SRC sh node install --global #+END_SRC or #+BEGIN_SRC sh node install -g #+END_SRC ** List global packages #+BEGIN_SRC sh :results output :exports both npm list --global #+END_SRC You can also use --depth=0 to make less verbose. #+RESULTS: #+BEGIN_EXAMPLE /Users/user/.nvm/versions/node/v4.0.0/lib ├─┬ babel-eslint@4.1.3 │ ├── acorn-to-esprima@1.0.4 │ ├─┬ babel-core@5.8.25 │ │ ├── babel-plugin-constant-folding@1.0.1 │ │ ├── babel-plugin-dead-code-elimination@1.0.2 ... #+END_EXAMPLE ** Install local package #+BEGIN_SRC sh npm install --save #+END_SRC --save will add dependency to your package.json. ** package.json See [[https://docs.npmjs.com/getting-started/using-a-package.json][using a package.json]]. ** Uninstall package #+BEGIN_SRC sh npm uninstall #+END_SRC ** Install package at version #+BEGIN_SRC sh npm install @1.7.0 #+END_SRC ** Search packages #+BEGIN_SRC sh npm search linter #+END_SRC ** Online documentation Online documentation is great so far. More at [[https://docs.npmjs.com][docs.npmjs.com]]. * [2015-12-25 Fri] Clojure bookmarks :PROPERTIES: :CUSTOM_ID: clojure-bookmarks :END: :MODIFIED: [2023-05-05 Fri] :END: - [[https://www.youtube.com/watch][ Clojure in Emacs from absolute zero ]]. - [[http://swannodette.github.io/2015/12/23/year-in-review/][2015 in review]]. - [[http://www.clojurestacks.com/misc/2018/05/06/a-call-for-clojure-stacks.html][A call for Clojure stacks · Clojure Stacks]]. - [[https://github.com/nrepl/nrepl][GitHub - nrepl/nrepl: A Clojure network REPL that provides a server and client, along with some common APIs of use to IDEs and other tools that may need to evaluate Clojure code in remote environments.]]. * [2015-12-21 Mon] Mac OS X tips backlog :PROPERTIES: :CUSTOM_ID: mac-os-x-tips-backlog :END: :MODIFIED: [2016-03-06 Sun] :END: **** TODO [[http://tracesof.net/uebersicht/][Uebersicht: Keep an eye on what is happening on your machine and in the World]]. **** DONE [[https://github.com/koekeishiya/kwm][Kwm: Tiling window manager with focus follows mouse for OSX]]. #+BEGIN_SRC sh cp ~/homebrew/Cellar/kwm/1.1.3/homebrew.mxcl.kwm.plist ~/Library/LaunchAgents/ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.kwm.plist #+END_SRC **** DONE Turn off shadows with [[https://github.com/ocodo/ShadowToggle][ShadowToggle]]. **** DONE [[http://www.derlien.com][Disk Inventory X]]: disk usage utility for Mac. * [2015-12-20 Sun] Search bash history with Emacs helm :PROPERTIES: :CUSTOM_ID: search-bash-history-with-emacs-helm :END: Following up from [[#change-emacs-shells-cwd-with-helm-projectile][changing CWD with helm projectile]], here's a way to search your bash history with helm: #+ATTR_HTML: :width 75% :height 75% [[file:images/search-bash-history-with-emacs-helm/helm-bash-history.gif]] #+BEGIN_SRC emacs-lisp (defun ar/helm-helm (title candidates on-select-function) "Helm with TITLE CANDIDATES and ON-SELECT-FUNCTION." (helm :sources `((name . ,title) (candidates . ,candidates) (action . ,on-select-function)) :buffer "*helm-exec*" :candidate-number-limit 10000)) (defun ar/shell-send-command (command) "Send COMMAND to shell mode." (assert (string-equal mode-name "Shell") nil "Not in Shell mode") (goto-char (point-max)) (comint-kill-input) (insert command) (comint-send-input)) (defun ar/helm-shell-search-history () "Narrow down bash history with helm." (interactive) (assert (string-equal mode-name "Shell") nil "Not in Shell mode") (ar/helm-helm "bash history" (with-temp-buffer (insert-file-contents "~/.bash_history") (reverse (delete-dups (split-string (buffer-string) "\n")))) #'ar/shell-send-command)) #+END_SRC Bonus: Replace existing M-r binding to use ar/helm-shell-search-history. #+BEGIN_SRC emacs-lisp (bind-key "M-r" #'ar/helm-shell-search-history shell-mode-map) #+END_SRC * [2015-12-19 Sat] Medicine bookmarks :PROPERTIES: :CUSTOM_ID: medicine-bookmarks :END: - [[https://sciencebasedmedicine.org/][Science-Based Medicine – Exploring issues and controversies in science and technology]]. * [2015-12-19 Sat] View DICOM files from your X-ray :PROPERTIES: :CUSTOM_ID: view-dicom-files-from-your-x-ray :END: Got a CD with my chest X-ray from the hospital. Was expecting a pdf or an image of sorts, but the CD content was rather different. For starters, it was targeted at Windows users (AUTORUN.INF, MediaViewerLauncher.EXE and a bunch of DLLs): #+BEGIN_SRC text $ find . -exec file --mime-type '{}' \; ./AUTORUN.INF: text/plain ./DICOMDIR: application/dicom ./MediaViewerLauncher.EXE: application/octet-stream ... ./Libraries/BASEPRINTER.DLL: application/octet-stream ./Libraries/CDDATABURNER.DLL: application/octet-stream ./Libraries/COM.DLL: application/octet-stream ... ./Libraries/ACE.DLL: application/octet-stream ./Libraries/ACE_SSL.DLL: application/octet-stream ./Libraries/ATL90.DLL: application/octet-stream ... ./DICOM/PAT_0000: application/x-directory ./DICOM/PAT_0000/STD_0000/SER_0000/OBJ_0001/IM_0001: application/dicom ./DICOM/PAT_0000/STD_0000/SER_0001/OBJ_0001/ED_0001: application/dicom ./DICOM/PAT_0000/STD_0000/SER_0002/OBJ_0001/ED_0001: application/dicom ./Worklist/ClinicalInfo/067eccde-b299-e511-9114-005056ad3afe.mht: text/html ./Worklist/Report/067eccde-b299-e511-9114-005056ad3afe.mht: text/html ./Worklist/Worklist.wl: application/octet-stream #+END_SRC I'm on a Mac, so most of these files were not useful to me. The more interesting files were IM_0001 and ED_0001 with "application/dicom" MIME type. [[https://en.wikipedia.org/wiki/DICOM][DICOM]] files stand for Digital Imaging and Communications in Medicine. How to view these on a Mac? [[http://www.osirix-viewer.com/Downloads.html][OsiriX viewer]] is an option. OsiriX, though on the heavy side (100.7MB download), it rendered the X-ray successfully. [[file:images/view-dicom-files-from-your-x-ray/2015-12-03-osirix-x-ray-small.png]] Unsurprisingly, ImageMagick's [[http://www.imagemagick.org/script/convert.php][convert]] utility also handles DICOM files. Converting to PNG worked well. #+BEGIN_SRC sh $ convert ./DICOM/PAT_0000/STD_0000/SER_0001/OBJ_0001/ED_0001 ED_0001.png #+END_SRC [[file:images/view-dicom-files-from-your-x-ray/2015-12-03-imagemagick-x-ray-small.png]] DICOM files also hold patient's metadata and optional reports. The file format is [[http://cabiatl.com/mricro/dicom/index.html][well known]]. OsiriX gives you access to it, but a few lines of python can also extract it for you. First install the [[https://github.com/darcymason/pydicom][pydicom]] package: #+BEGIN_SRC sh $ sudo pip install pydicom #+END_SRC Running the python interpreter is enough to peak at the metadata: #+BEGIN_SRC python >>> import dicom >>> ds = dicom.read_file("./DICOM/PAT_0000/STD_0000/SER_0000/OBJ_0001/IM_0001") >>> ds #+END_SRC #+BEGIN_SRC text (0008, 0000) Group Length UL: 400 (0008, 0005) Specific Character Set CS: 'ISO_IR 100' (0008, 0016) SOP Class UID UI: Computed Radiography Image Storage (0008, 0020) Study Date DA: '20151203' (0008, 0021) Series Date DA: '20151203' (0008, 0023) Content Date DA: '20151203' (0008, 0030) Study Time TM: '120519.000000' (0008, 0031) Series Time TM: '120520.000000' (0008, 0033) Content Time TM: '120643.000000' (0008, 0060) Modality CS: 'CR' (0008, 0070) Manufacturer LO: 'Canon Inc.' ... #+END_SRC There were other DICOM files with a report: #+BEGIN_SRC python >>> import dicom >>> ds = dicom.read_file("./DICOM/PAT_0000/STD_0000/SER_0001/OBJ_0001/ED_0001") >>> ds #+END_SRC #+BEGIN_SRC text (0008, 0005) Specific Character Set CS: 'ISO_IR 100' (0008, 0016) SOP Class UID UI: Encapsulated PDF Storage ... (0042, 0012) MIME Type of Encapsulated Document LO: 'application/pdf' #+END_SRC [[http://dcmtk.org/dcmtk.php.en][DCMTK]] is another alternative tool to extract DICOM metadata. The source is available and can be built: #+BEGIN_SRC sh $ tar xf dcmtk-3.6.0.tar.gz $ cd dcmtk-3.6.0 $ cmake . $ make #+END_SRC Or installed via homebrew: #+BEGIN_SRC sh $ brew install dcmtk #+END_SRC DCMTK includes dcmdump. You can use it to dump DICOM files: #+BEGIN_SRC sh $ dcmdata/apps/dcmdump DICOM/PAT_0000/STD_0000/SER_0000/OBJ_0001/IM_0001 #+END_SRC #+BEGIN_SRC text # Dicom-File-Format # Dicom-Meta-Information-Header # Used TransferSyntax: Little Endian Explicit (0002,0000) UL 192 # 4, 1 FileMetaInformationGroupLength (0002,0001) OB 01\00 # 2, 1 FileMetaInformationVersion (0002,0002) UI =ComputedRadiographyImageStorage # 26, 1 MediaStorageSOPClassUID (0002,0003) UI [1.2.392.200046.100.2.1.1.42667.20151203120519.1.1.1] # 52, 1 MediaStorageSOPInstanceUID (0002,0010) UI =LittleEndianExplicit # 20, 1 TransferSyntaxUID (0002,0012) UI [1.3.46.670589.42.1.4.4.5] # 24, 1 ImplementationClassUID (0002,0013) SH [PhilipsISPACS445] # 16, 1 ImplementationVersionName ... #+END_SRC Of interest, David Clunie's [[http://www.dclunie.com/][Medical Image Format Site]]. * [2015-12-18 Fri] Tip: GOOGLETRANSLATE your Spreadsheet :PROPERTIES: :CUSTOM_ID: tip-googletranslate-your-spreadsheet :END: Examples from [[https://support.google.com/docs/answer/3093331][reference]]: #+BEGIN_SRC text =GOOGLETRANSLATE("Hello World\n","en\n","es") =GOOGLETRANSLATE(A2,B2,C2) =GOOGLETRANSLATE(A2) #+END_SRC * [2015-12-18 Fri] Organize your data with camlistore :PROPERTIES: :CUSTOM_ID: organize-your-data-with-camlistore :END: Checking out [[https://camlistore.org][camlistore]] to organize all sorts of data. [[https://www.scaleway.com/imagehub/camlistore/][Scaleway]] enables you to deploy camlistore servers. * [2015-12-17 Thu] Maps dev bookmarks :PROPERTIES: :CUSTOM_ID: maps-dev-bookmarks :END: :MODIFIED: [2021-07-11 Sun] :END: - [[https://news.ycombinator.com/item?id=26918259][A new way to make maps with OpenStreetMap | Hacker News]]. - [[https://www.mapzen.com/data/borders/][borders: Country, region and city boundary data from OpenStreetMap, served monthly (mapzen.com)]]. - [[https://www.inderapotheke.de/blog/farewell-google-maps][Farewell, Google Maps (In der Apotheke)]]. - [[https://hamberg.no/erlend/posts/2015-10-22-geocoding.html][Fast, Offline, Reverse Geocoding; or, in Which Polygon am I?]]. - [[https://news.ycombinator.com/item?id=22252330][Free OpenStreetMap tile library: watercolor, black and white, terrain]]. - [[https://github.com/ue4plugins/StreetMap/blob/master/README.md][Import OpenStreetMap XML data into your Unreal Engine 4]]. - [[https://www.locationtech.org][Location Tech]]. - [[https://wiki.openstreetmap.org/wiki/Map_Features#Amenity][Map's POI categories]]. - [[https://www.mapbox.com/][Mapbox]]. - [[http://maperitive.net/][Maperitive (offline maps)]]. - [[https://mapzen.com][Mapzen]]. - [[https://medium.com/tag/mapping][Medium's mapping tag]]. - [[https://news.ycombinator.com/item?id=18390425][Migrating away from Google Maps and cutting costs by 99% (Hacker News)]]. - [[https://openaddresses.io/][Open Addresses]]. - [[https://openstreetcam.org/map/][OpenStreetCam]]. - [[https://news.ycombinator.com/item?id=23722133][Openstreetmap, a global map for worldwide insight | Hacker News]]. - [[https://www.openstreetmap.org/user/mvexel/diary/39274][OpenStreetMap: Introducing OpenStreetView]]. - [[https://news.ycombinator.com/item?id=27543012][Organicmaps: Android and iOS offline maps app for travelers, tourists, hikers...]]. - [[http://wiki.openstreetmap.org/wiki/Planet.osm][OSM data in one file]]. - [[http://wiki.openstreetmap.org/wiki/OSM_on_Paper][OSM on paper]]. - [[http://download.osmand.net/rawindexes/][OSM raw indices]]. - [[https://news.ycombinator.com/item?id=17952361][Pigeon Maps – Maps in React with no external dependencies (Hacker News)]]. - [[http://news.spatialdev.com/portable-open-street-map/][Portable OSM]]. - [[https://news.ycombinator.com/item?id=27781895][Show HN: Tilemaker – DIY vector tiles from OpenStreetMap data | Hacker News]]. - [[https://developer.mapquest.com/documentation/static-map-api/v5/][Static Map API - Overview | MapQuest API Documentation]]. - [[http://www.mostlymaths.net/2015/06/using-qgis-to-create-custom-map.html][Using QGIS to create a custom map]]. - [[https://news.ycombinator.com/item?id=25615394][Why Openstreetmap’s product fails to compete with Google Maps | Hacker News]]. - [[http://thematicmapping.org/downloads/world_borders.php][World Borders Dataset (thematicmapping.org)]]. * [2015-12-17 Thu] Use ImageMagick to convert image to grayscale :PROPERTIES: :CUSTOM_ID: use-imagemagick-to-convert-image-to-grayscale :END: Another ImageMagick one-liner I'll likely forget. #+BEGIN_SRC sh mogrify -type Grayscale image.png #+END_SRC * [2015-12-14 Mon] Drill down Emacs dired with dired-subtree :PROPERTIES: :CUSTOM_ID: drill-down-emacs-dired-with-dired-subtree :END: JCS, from [[http://irreal.org/blog][Irreal]], recently [[http://irreal.org/blog/?p%3D4777][highlighted]] fuco's [[https://github.com/Fuco1/dired-hacks][dired-hacks]]. [[https://github.com/Fuco1/dired-hacks/blob/master/dired-subtree.el][dired-subtree]] is super handy for drilling subdirectories down. Bound and to toggle and cycle subtrees. #+BEGIN_SRC emacs-lisp (use-package dired-subtree :ensure t :after dired :config (bind-key "" #'dired-subtree-toggle dired-mode-map) (bind-key "" #'dired-subtree-cycle dired-mode-map)) #+END_SRC #+ATTR_HTML: :width 75% :height 75% [[file:images/drill-down-emacs-dired-with-dired-subtree/dired-subtree.gif]] * [2015-12-14 Mon] GPG (GnuPG) examples :PROPERTIES: :CUSTOM_ID: gpg-examples :END: ** Generate key #+begin_src sh gpg --full-generate-key #+end_src ** Export private key #+BEGIN_SRC sh gpg --export-secret-key -a > #+END_SRC ** Import key #+BEGIN_SRC sh gpg --import < #+END_SRC ** Delete public key #+BEGIN_SRC sh gpg --delete-keys #+END_SRC ** Delete private key #+BEGIN_SRC sh gpg --delete-secret-keys #+END_SRC ** Edit key #+BEGIN_SRC sh gpg --edit-key gpg> uid (lists IDs) gpg> uid 2 (marks ID) gpg> deluid (deletes marked ID) Really remove this user ID? (y/N) y #+END_SRC ** Change passphrase of the secret key #+BEGIN_SRC sh gpg --edit-key Your-Key-ID-Here gpg> passwd gpg> save #+END_SRC ** References - [[http://blog.ghostinthemachines.com/2015/03/01/how-to-use-gpg-command-line/][How To Use GPG on the Command Line (Ghost in the Machines)]]. - [[https://www.cyberciti.biz/faq/linux-unix-gpg-change-passphrase-command/][GPG Change Passphrase Secret Key Password Command - nixCraft]]. - [[https://www.gnupg.org/gph/en/manual.html][The GNU Privacy handbook]]. * [2015-12-14 Mon] CSS bookmarks :PROPERTIES: :CUSTOM_ID: css-bookmarks :END: :MODIFIED: [2020-04-05 Sun] :END: - [[https://jrl.ninja/etc/1/][58 bytes of css to look great nearly everywhere]]. - [[https://csslayout.io/][CSS Layout]]. - [[https://news.ycombinator.com/item?id%3D10731360][CSS Protips: A collection of tips to help take your CSS skills pro (Hacker News)]]. - [[https://github.com/AllThingsSmitty/css-protips][CSS Protips: A collection of tips to help take your CSS skills pro]]. - [[http://cssguidelin.es][CSS style guide]]. - [[https://css-tricks.com/][CSS-Tricks]]. - [[https://github.com/jamztang/CSStickyHeaderFlowLayout][CSStickyHeaderFlowLayout]]. - [[http://dynamicsjs.com/][Dynamics.js: JavaScript library to create physics-based CSS animations]]. - [[http://flexboxfroggy.com/][Flexbox Froggy, a game for writing CSS code]]. - [[https://news.ycombinator.com/item?id%3D9405284][Howtocenterincss.com (Hacker News)]]. - [[http://howtocenterincss.com/][Howtocenterincss.com]]. - [[https://developers.google.com/speed/docs/insights/OptimizeCSSDelivery][Optimize CSS delivery (Google Developers)]]. - [[https://jgthms.com/web-design-in-4-minutes/][Web Design in 4 minutes (minimal css rules)]]. * [2015-12-12 Sat] Resume partial downloads with ssh and rsync :PROPERTIES: :CUSTOM_ID: resume-partial-downloads-with-ssh-and-rsync :END: #+BEGIN_SRC sh rsync --rsync-path=/usr/local/bin/rsync \ --partial \ --progress \ --rsh=ssh \ john@host:/path/to/file \ path/to/partial/file #+END_SRC * [2015-12-12 Sat] Emacs text faces :PROPERTIES: :CUSTOM_ID: emacs-text-faces :END: - Text faces = Text styles. - Face attributes: font, height, weight, slant, foreground/background color, and underlining or overlining. - Font lock mode automatically assigns faces to text. - M-x list-faces-display: Shows faces defined. - M-x helm-colors: Also handy. - Unspecified attributes are taken from 'default' face. * [2015-12-08 Tue] Preview HTML pages on github :PROPERTIES: :CUSTOM_ID: preview-html-pages-on-github :END: Prepend with http://htmlpreview.github.io/?. For example: http://htmlpreview.github.io/?https://github.com/xenodium/xenodium.github.io/blob/master/index.html * [2015-12-07 Mon] Flutter setup :PROPERTIES: :CUSTOM_ID: flutter-setup :END: Based on [[http://flutter.io/getting-started/][Getting Started with Flutter]]. #+BEGIN_SRC sh $ curl -O https://storage.googleapis.com/dart-archive/channels/stable/release/1.13.0/sdk/dartsdk-macos-x64-release.zip $ unzip dartsdk-macos-x64-release.zip $ export PATH=`pwd`/dart-sdk/bin:$PATH #+END_SRC Verify with: #+BEGIN_SRC sh $ pub --version #+END_SRC * [2015-12-07 Mon] Playing with Dart's analysis server :PROPERTIES: :CUSTOM_ID: playing-with-darts-analysis-server :END: Dart SDK ships with an [[https://github.com/dart-lang/sdk/tree/master/pkg/analysis_server][analysis server]]. Very handy if you'd like to write a completion plugin for your favorite editor. The API is well [[http://htmlpreview.github.io/?https://github.com/dart-lang/sdk/blob/master/pkg/analysis_server/doc/api.html][documented]]. Of interest, there's [[https://github.com/tomsontom/dartedit/blob/master/bundles/at.bestsolution.dart.server.api/src-gen/at/bestsolution/dart/server/api/internal/local/LocalDartServer.java][LocalDartServer.java]], part of [[https://github.com/tomsontom/dartedit/blob/master/bundles/at.bestsolution.dart.server.api/src-gen/at/bestsolution/dart/server/api/internal/local/LocalDartServer.java][dartedit]]. #+BEGIN_SRC sh $ dart path/to/bin/snapshots/analysis_server.dart.snapshot --sdk=path/to/dart-sdk #+END_SRC NOTE: The server reads requests from standard input. Either escape or execute the following as one-liner json requests. #+BEGIN_SRC json { "id": "1\n", "method": "analysis.setAnalysisRoots\n", "params": { "included": [ "path/to/your/dart/project" ], "excluded": [] } } #+END_SRC #+BEGIN_SRC json { "id": "3\n", "method": "completion.getSuggestions\n", "params": { "file": "path/to/some/file.dart\n", "offset": 673 } } #+END_SRC * [2015-12-07 Mon] Dart bookmarks :PROPERTIES: :CUSTOM_ID: dart-bookmarks :END: :MODIFIED: [2015-12-08 Tue] :END: - [[http://tomsondev.bestsolution.at/2015/08/25/access-dart-analysis-server-from-java/][Access Dart Analysis server from Java]]. - [[http://htmlpreview.github.io/?https://github.com/dart-lang/sdk/blob/master/pkg/analysis_server/doc/api.html][Analysis server API]]. - [[https://www.dartlang.org/tools/][Dart tools]]. * [2015-12-06 Sun] Flutter bookmarks :PROPERTIES: :CUSTOM_ID: flutter-bookmarks :END: :MODIFIED: [2019-01-27 Sun] :END: - [[https://www.youtube.com/watch?list%3DPLOU2XLYxmsIIQorIS8gagUiMau9S84vZV&v%3DPnIWl33YMwA][Eric Seidel introduces Sky, Dart Developer Summit 2015 (YouTube)]]. - [[https://www.didierboelens.com/2019/01/futures---isolates---event-loop/][Flutter - Futures - Isolates - Event Loop]]. - [[https://news.ycombinator.com/item?id=18958747][Flutter: Futures, Isolates, Event Loop (Hacker News)]]. - [[https://medium.com/asos-techblog/flutter-vs-react-native-for-ios-android-app-development-c41b4e038db9][Flutter: the good, the bad and the ugly – The ASOS Tech Blog – Medium]]. * [2015-12-06 Sun] Swift bookmarks :PROPERTIES: :CUSTOM_ID: swift-bookmarks :END: :MODIFIED: [2022-09-11 Sun] :END: - [[https://www.uraimo.com/2016/01/06/10-Swift-One-Liners-To-Impress-Your-Friends/][10 Swift One Liners To Impress Your Friends]]. - [[https://binarapps.com/blog/5-secrets-of-swift-api-design][5 secrets of Swift API design]]. - [[https://www.swiftbysundell.com/articles/5-small-but-significant-improvements-in-swift-5-1/][5 small but significant improvements in Swift 5.1 | Swift by Sundell]]. - [[https://forums.swift.org/t/state-messing-with-initializer-flow/25276/10][@State messing with initializer flow - Using Swift - Swift Forums]]. - [[https://github.com/CosmicMind/Material][A beautiful graphics framework for Material Design in Swift]]. - [[https://github.com/airbnb/MagazineLayout][A collection view layout capable of laying out views in vertically scrolling grids and lists (AirBnB)]]. - [[https://wwdcbysundell.com/2019/diffable-data-sources-first-look/][A first look at the new diffable data sources for table views and collection view]]. - [[https://news.ycombinator.com/item?id=20908452][A Technology Freelancer's Guide to Starting a Worker Cooperative]]. - [[https://medium.com/@eneko/aes256-cbc-file-encryption-from-the-command-line-with-swift-cd1f88f2e1ec][AES256-CBC File Encryption from the Command Line with Swift]]. - [[https://talk.objc.io/episodes][All Episodes · Swift Talk · objc.io]]. - [[https://www.objc.io/books/app-architecture/][App Architecture (objc.io)]]. - [[https://www.swiftbysundell.com/posts/asyncawait-in-swift-unit-tests][Async/await in Swift unit tests]]. - [[https://www.swiftbysundell.com/articles/avoiding-race-conditions-in-swift/][Avoiding race conditions in Swift | Swift by Sundell]]. - [[https://github.com/Awesome-Server-Side-Swift/TheList][Awesome server side swift]]. - [[https://github.com/hsavit1/Awesome-Swift-Education][Awesome-Swift-Education]]. - [[https://www.swiftbysundell.com/posts/building-dsls-in-swift][Building DSLs in Swift (Swift by Sundell)]]. - [[https://davedelong.com/blog/2018/07/25/conditional-compilation-in-swift-part-1/][Conditional Compilation in Swift, Part 1 (Dave DeLong)]]. - [[https://www.swiftbysundell.com/posts/constructing-urls-in-swift][Constructing URLs in Swift]]. - [[https://www.hackingwithswift.com/read/4/2/creating-a-simple-browser-with-wkwebview][Creating a simple browser with WKWebView in Swift]]. - [[https://github.com/danielmartin/swift-info][Curated Swift 5 documentation and reference in GNU Info format]]. - [[https://forums.swift.org/t/debugging-sourcekit-lsp-using-lldb/28328/14][Debugging sourcekit-lsp using LLDB - LLDB - Swift Forums]]. - [[https://www.swiftbysundell.com/articles/deciding-whether-to-adopt-new-swift-technologies/][Deciding whether to adopt new Swift technologies | Swift by Sundell]]. - [[https://theswiftdev.com/deep-dive-into-swift-frameworks/][Deep dive into Swift frameworks - The.Swift.Dev.]]. - [[https://github.com/krzysztofzablocki/Difference][Difference: diff between 2 Swift object instances]]. - [[https://www.swiftbysundell.com/articles/encapsulating-configuration-code-in-swift/][Encapsulating configuration code in Swift | Swift by Sundell]]. - [[https://talk.objc.io/episodes/S01E125-building-a-responsive-layout][Episode 125 – Building a Layout Library: Building a Responsive Layout · Swift Talk · objc.io]]. - [[https://swiftunboxed.com/protocols/equatable/][Equatable - Swift Unboxed]]. - [[https://nshipster.com/formatter/][Formatting everything in swift (lovation, dates, time)]]. - [[https://www.polpiella.dev/from-nsregular-expression-to-swift-regex][From NSRegularExpression to SwiftRegex]]. - [[https://github.com/mpangburn/FunctionKit/blob/master/README.md][FunctionKit/README.md at master · mpangburn/FunctionKit · GitHub]]. - [[http://rshankar.com/get-your-current-address-in-swift/][Get your current address in Swift – Ravi Shankar]]. - [[https://kinderas.com/technology/2014/6/7/getting-started-with-wkwebview-using-swift-in-ios-8][Getting started with WKWebView using Swift in iOS 8]]. - [[https://grokswift.com/uitextfield][Getting to know UITextField]]. - [[https://github.com/almassapargali/LocationPicker][GitHub - almassapargali/LocationPicker (Swift)]]. - [[https://github.com/anas-p/ImagePicker][GitHub - anas-p/ImagePicker: UIImagePickerController for camera and photo library]]. - [[https://github.com/burczyk/XcodeSwiftSnippets][GitHub - burczyk/XcodeSwiftSnippets: Swift 4 code snippets for Xcode]]. - [[https://github.com/DevLiuSir/CircleProgressBar][GitHub - DevLiuSir/CircleProgressBar: This is a simple animation circle progress bar]]. - [[https://github.com/hyperoslo/Cache][GitHub - hyperoslo/Cache: Nothing but Cache.]]. - [[https://github.com/liuliu/dflat][GitHub - liuliu/dflat: Structured Data Store for Mobile]]. - [[https://github.com/phynet/iOS-URL-Schemes][GitHub - phynet/iOS-URL-Schemes: iOS URL list schemes (Settings)]]. - [[https://github.com/Raizlabs/BonMot][GitHub - Raizlabs/BonMot: Beautiful, easy attributed strings in Swift]]. - [[https://github.com/raywenderlich/swift-algorithm-club][GitHub - raywenderlich/swift-algorithm-club: Swift Algorithm Club]]. - [[https://github.com/saoudrizwan/Disk][GitHub - saoudrizwan/Disk: Delightful framework for iOS to easily persist strcts, images, and data]]. - [[https://github.com/swift-embedded/swift-embedded][GitHub - swift-embedded/swift-embedded: Swift for Embedded Systems ]]. - [[https://github.com/zhuorantan/LocationPicker][GitHub - zhuorantan/LocationPicke (Swift)]]. - [[https://medium.com/better-programming/how-to-add-compiled-frameworks-in-swift-package-manager-f0cdbde84fc7][How to Add Compiled Frameworks in Swift Package Manager]]. - [[http://browniefed.com/blog/2015/11/28/react-native-how-to-bridge-a-swift-view/][How to bridge a Swift View]]. - [[https://www.hackingwithswift.com/example-code/cryptokit/how-to-calculate-the-sha-hash-of-a-string-or-data-instance][How to calculate the SHA hash of a String or Data instance]]. - [[https://whatdidilearn.info/2018/07/29/how-to-capture-regex-group-values-in-swift.html][How to capture Regex group values in Swift | What did I learn]]. - [[https://www.hackingwithswift.com/example-code/networking/how-to-check-for-internet-connectivity-using-nwpathmonitor][How to check for internet connectivity using NWPathMonitor]]. - [[https://www.hackingwithswift.com/example-code/games/how-to-create-a-random-terrain-tile-map-using-sktilemapnode-and-gkperlinnoisesource][How to create a random terrain tile map using SKTileMapNode and GKPerlinNoiseSource]]. - [[https://www.hackingwithswift.com/example-code/system/how-to-run-an-external-program-using-process][How to run an external program using Process]]. - [[http://www.globalnerdy.com/2020/05/28/how-to-work-with-dates-and-times-in-swift-5-part-4-adding-swift-syntactic-magic/][How to work with dates and times in Swift 5, part 4: Adding Swift syntactic sugar]]. - [[https://twitter.com/olebegemann/status/1004458683428950018?s=12][I made a “What’s new in Swift 4.2” playground]]. - [[https://stackoverflow.com/questions/3554244/uiimagepngrepresentation-issues-images-rotated-by-90-degrees][iphone - UIImagePNGRepresentation issues? / Images rotated by 90 degrees]]. - [[https://www.bignerdranch.com/blog/it-looks-like-youre-still-trying-to-use-a-framework/][It Looks Like You're Still Trying to Use/Create a Swift Framework]]. - [[https://www.youtube.com/watch?v=XJreRR0cC3E][Jason Zurita - Compositional UI Styling in Swift - YouTube]]. - [[https://khanlou.com/2016/07/implementing-dictionary-in-swift/][Khanlou | Implementing Dictionary In Swift]]. - [[https://medium.com/@PavelGnatyuk/large-title-and-search-in-ios-11-514d5e020cee][Large Title and Search in iOS 11 – Pavel Gnatyuk – Medium]]. - [[https://github.com/hyperoslo/Lightbox][Lightbox is a convenient and easy to use image viewer for your iOS app]]. - [[https://github.com/zhuorantan/LocationPicker][Location picker: A ready for use and fully customizable location picker for your app]]. - [[https://steipete.com/posts/logging-in-swift/][Logging in Swift | steipete's blog]]. - [[https://www.raywenderlich.com/731-macos-development-for-beginners-part-1][macOS Swift Development for Beginners: Part 1]]. - [[https://twitter.com/MartinLasek/status/1256349442472505344][Martin Lasek on Twitter: "Handling prices in Swift."]]. - [[https://oleb.net/2018/objc-swift-transition/][Migrating an Objective-C class to Swift: a piecemeal approach – Ole Begemann]]. - [[https://theswiftdev.com/migrating-from-cocoapods-to-swift-package-manager/][Migrating from CocoaPods to Swift Package Manager - The.Swift.Dev.]]. - [[https://medium.com/thecreateschool/migrating-from-swift-4-to-swift-5-2f425b99436b][Migrating from Swift 4 to Swift 5 – The Create School – Medium]]. - [[https://ericasadun.com/2018/12/14/more-fun-with-swift-5-string-interpolation-radix-formatting/][More fun with Swift 5 String Interpolation: Radix (Erica Sadun)]]. - [[https://github.com/netguru/swift-style-guide][Netguru's Swift Style Guide]]. - [[https://nshipster.com/never/][Never: Eliminating Impossible States in Swift Generic Types - NSHipster]]. - [[https://lukakerr.github.io/swift/nswindow-styles][NSWindow Styles | lukakerr.github.io]]. - [[https://medium.com/ios-os-x-development/optionals-in-swift-for-newbies-7199a30707d5][Optionals in Swift for newbies]]. - [[https://github.com/mxcl/Path.swift][Path.swift: Delightful, robust, cross-platform and chainable file-pathing functions]]. - [[https://www.bignerdranch.com/blog/pro-pattern-matching-in-swift/][Pro Pattern-Matching in Swift - Digital product development agency | Big Nerd Ranch]]. - [[https://nshipster.com/swift-regular-expressions/][Regular Expressions in Swift (groups) - NSHipster]]. - [[https://zacwood.me/2018/09/09/simple-networking-swift/][Simple networking in Swift]]. - [[https://www.swiftbysundell.com/posts/slot-based-ui-development-in-swift][Slot-based UI development in Swift (Sundell)]]. - [[https://www.donnywals.com/splitting-a-json-object-into-an-enum-and-an-associated-object-with-codable/][Splitting a JSON object into an enum and an associated object with Codable]]. - [[https://swiftbysundell.com/articles/splitting-up-swift-types/][Splitting up Swift types | Swift by Sundell]]. - [[https://github.com/seorenn/SRChoco][SRChoco: Seorenn's Development Libraries for OS X and iOS (github)]]. - [[https://twitter.com/steipete/status/1281578201165320192][String(string[currentIndex])]]. - [[https://stackoverflow.com/questions/43797913/how-to-authenticate-a-grpc-call-for-the-assistant-sdk][Swift - How to authenticate a gRPC call for the Assistant SDK?]]. - [[https://ericasadun.com/2018/12/16/swift-5-interpolation-part-3-dates-and-number-formatters/][Swift 5 Interpolation Part 3: Dates and Number Formatters (Erica Sadun)]]. - [[https://nshipster.com/vscode/][Swift Development with Visual Studio Code - NSHipster]]. - [[http://www.h4labs.com/dev/ios/swift.html][Swift Resources]]. - [[https://github.com/mxcl/swift-sh][swift sh adds automatic dependency loading in scripts]]. - [[https://pragprog.com/book/esswift2/swift-style-second-edition][Swift Style, Second Edition: An Opinionated Guide to an Opinionated Language by Erica Sadun (The Pragmatic Bookshelf)]]. - [[https://www.objc.io/blog/2018/10/02/using-appkit-from-the-command-line/][Swift Tip: Using AppKit from the Command-line · objc.io]]. - [[https://swift.org/blog/argument-parser/][Swift.org - Announcing ArgumentParser]]. - [[https://swift.org/documentation/api-design-guidelines/][Swift.org - API Design Guidelines]]. - [[https://github.com/apple/swift/blob/master/docs/ErrorHandlingRationale.rst][swift/ErrorHandlingRationale.rst at master · apple/swift · GitHub]]. - [[https://github.com/LeonardoCardoso/SwiftLinkPreview][SwiftLinkPreview: Link Previewer for iOS, macOS, watchOS and tvOS]]. - [[http://swiftmonthly.com/][SwiftMothly]]. - [[https://www.hackingwithswift.com/articles/136/the-complete-guide-to-optionals-in-swift][The Complete Guide to Optionals in Swift – Hacking with Swift]]. - [[https://www.youtube.com/user/TheSwiftLanguage][The Shift Language (YouTube)]]. - [[https://swiftpm.co/][The SwiftPM Library, a place to find packages for Swift]]. - [[https://twitter.com/scottberrevoets/status/1151228835947401216][Today marks 4 years since shipping the first release of the rewrite of the Lyft app in Swift]]. - [[https://troz.net/][TrozWare blogs on Swift]]. - [[https://medium.com/the-traveled-ios-developers-guide/uilayoutguide-6b3b552b1890][UILayoutGuide – The Traveled iOS Developer’s Guide – Medium]]. - [[https://swiftrocks.com/understanding-dispatchqueues.html][Understanding DispatchQueues - SwiftRocks]]. - [[https://www.hackingwithswift.com/quick-start/understanding-swift][Understanding Swift - free quick start tutorials for Swift developers (hackingwithswift)]]. - [[https://aozsky.com/swift/swift_ide][Use Neovim as Swift IDE - The Go Blog]]. - [[https://www.swiftbysundell.com/posts/using-errors-as-control-flow-in-swift][Using errors as control flow in Swif (Sundell)]]. - [[https://medium.com/@PhiJay/why-swift-enums-with-associated-values-cannot-have-a-raw-value-21e41d5ec11][Why Swift Enums with Associated Values Cannot Have a Raw Value]]. - [[https://nshipster.com/wkwebview][WKWebView (NSHipster)]]. - [[https://www.slideshare.net/SommerPanage1/writing-your-app-swiftly/SommerPanage1/writing-your-app-swiftly][Writing Your App Swiftly]]. * [2015-11-30 Mon] Installing Emacs spaceline :PROPERTIES: :CUSTOM_ID: installing-emacs-spaceline :END: Gave [[https://github.com/TheBB/spaceline/][Spaceline]] a try. [[https://github.com/syl20bnr/spacemacs][Spacemacs]]'s powerline theme. Setup was super simple (Thanks [[https://github.com/TheBB][Eivind Fonn]] and [[https://github.com/syl20bnr/spacemacs][Sylvain Benner]]): #+BEGIN_SRC emacs-lisp (use-package spaceline :ensure t :config (use-package spaceline-config :config (spaceline-toggle-minor-modes-off) (spaceline-toggle-buffer-encoding-off) (spaceline-toggle-buffer-encoding-abbrev-off) (setq powerline-default-separator 'rounded) (setq spaceline-highlight-face-func 'spaceline-highlight-face-evil-state) (spaceline-define-segment line-column "The current line and column numbers." "l:%l c:%2c") (spaceline-define-segment time "The current time." (format-time-string "%H:%M")) (spaceline-define-segment date "The current date." (format-time-string "%h %d")) (spaceline-toggle-time-on) (spaceline-emacs-theme 'date 'time)) #+END_SRC #+ATTR_HTML: :width 75% :height 75% [[file:images/installing-emacs-spaceline/spaceline.png]] * [2015-11-29 Sun] package.el incomprehensible buffer :PROPERTIES: :CUSTOM_ID: package-el-incomprehensible-buffer :END: Came across "incomprehensible buffer" error in package.el. [[http://osdir.com/ml/general/2015-11/msg22232.html][Workaround patch]]: #+BEGIN_SRC emacs-lisp --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1161,6 +1161,7 @@ package--with-work-buffer (let* ((url (concat ,url-1 ,file)) (callback (lambda (status) (let ((b (current-buffer))) + (goto-char (point-min)) (unwind-protect (wrap-errors (when-let ((er (plist-get status :error))) (error "Error retrieving: %s %S" url er)) #+END_SRC * [2015-11-29 Sun] Leading bookmarks :PROPERTIES: :CUSTOM_ID: leading-bookmarks :END: :MODIFIED: [2021-06-26 Sat] :END: - [[https://news.ycombinator.com/item?id=22969533][Agile's early evangelists wouldn't mind watching Agile die]]. - [[https://news.ycombinator.com/item?id=27414443][An incomplete list of skills senior engineers need, beyond coding | Hacker News]]. - [[https://news.ycombinator.com/item?id%3D10395046][Ask HN: How to Be a Good Technical Lead? (Hacker News)]]. - [[https://twitter.com/DanielleMorrill/status/1321092574837383168][Books on leveling up as a manager]]. - [[https://twitter.com/bcantrill/status/1216491216356823040][Bryan Cantrill on Twitter: "So, my thoughts on engineering performance management..."]]. - [[https://twitter.com/dan_abramov/status/1203486500731719681][Dan Abramov: What is your favorite book about management... (twitter)]]. - [[https://hbr.org/2015/10/do-you-have-a-managers-mindset][Do You Have a Manager’s Mindset?]]. - [[https://medium.com/@kentcdodds/first-timers-only-78281ea47455#.hj28umxei][First Timers Only: A suggestion to Open Source project maintainers]]. - [[https://hbr.org/2015/08/how-to-give-tough-feedback-that-helps-people-grow][How to Give Tough Feedback That Helps People Grow]]. - [[https://news.ycombinator.com/item?id=19485559][Interviews with developers who became managers (Hacker News)]]. - [[https://hbr.org/2016/01/secrets-of-the-superbosses][Secrets of the Superbosses]]. - [[https://hbr.org/2015/10/shifting-from-star-performer-to-star-manager][Shifting from Star Performer to Star Manager]]. - [[http://www.joelonsoftware.com/articles/fog0000000043.html?__s=5ww3bdbkavuhrw1fhfpp][The Joel Test: 12 Steps to Better Code]]. - [[http://whilefalse.blogspot.co.uk/2015/11/the-manager-as-debugger.html?m=1][The Manager as Debugger]]. - [[https://www.amazon.com/Managers-Path-Leaders-Navigating-Growth/dp/1491973897][The Manager's Path: A Guide for Tech Leaders Navigating Growth and Change]]. * [2015-11-29 Sun] Online reading backlog :PROPERTIES: :CUSTOM_ID: online-reading-backlog :END: :MODIFIED: [2016-05-21 Sat] :END: **** TODO [[http://phrack.org/issues/69/1.html][Phrack 69]]. **** TODO [[https://hbr.org/2015/10/a-simple-formula-for-changing-our-behavior?utm_campaign=harvardbiz&utm_source=twitter&utm_medium=social][A Simple Formula for Changing Our Behavior]]. **** TODO [[https://hbr.org/2013/11/be-grateful-more-often][Be Grateful More Often]]. **** TODO [[http://heydave.org/post/24286720323/gtd-sucks-for-creative-work-heres-an-alternative][GTD sucks for creative work]]. **** TODO [[http://continuations.com/post/131372549150/land-capital-attention-this-time-it-is-the-same][Land, Capital, Attention: This Time it Is the Same]]. **** TODO [[http://www.gatesnotes.com/Books/Mindset-The-New-Psychology-of-Success][Mindset: What You Believe Affects What You Achieve (Gates Notes)]]. **** TODO [[http://www.theatlantic.com/business/archive/2015/10/get-rid-borders-completely/409501/?single_page%3Dtrue][The Case for Getting Rid of Borders—Completely]]. **** TODO [[https://blog.todoist.com/2015/11/30/ultimate-guide-personal-productivity-methods/][The Ultimate Guide to Personal Productivity Methods]]. **** TODO [[http://www.gatesnotes.com/Books/Thing-Explainer][Thing Explainer: A Basic Guide for Curious Minds (Gates Notes)]]. **** TODO [[https://www.ted.com/talks/amy_cuddy_your_body_language_shapes_who_you_are?language%3Den][Your body language shapes who you are]]. * [2015-11-28 Sat] Travel lifestyle bookmarks :PROPERTIES: :CUSTOM_ID: travel-lifestyle-bookmarks :END: :MODIFIED: [2021-11-23 Tue] :END: - [[https://twitter.com/getterhiss/status/1325835494773592071][1991 VW Vanagon Westfalia campervan]]. - [[http://fourhourworkweek.com/2010/02/25/rolf-potts-vagabonding-travel/][5 Travel Lessons You Can Use at Home]]. - [[https://www.your-rv-lifestyle.com/travel-tips.html][50 Best Travel Tips from 10 Years of Travel - Your RV Lifestyle]]. - [[https://news.ycombinator.com/item?id=26284635][A new chapter – full-time working from a van in a forest | Hacker News]]. - [[https://liveworkplaytravel.com/bali-digital-nomad-guide-live-in-bali-as-a-digital-nomad/][Bali Digital Nomad Guide - How To Live In Bali As A Digital Nomad]]. - [[https://medium.com/ohmygeorge-blog/bootstrapping-in-bangkok-is-the-best-option-c70e98f2b781#.2qbxef7oa][Bootstrapping in Bangkok is the best option]]. - [[http://www.goruck.com/en][goruck bag]]. - [[https://www.washingtonpost.com/travel/tips/dos-donts-in-flight-grooming/][Grooming on airplanes: What's acceptable? - The Washington Post]]. - [[https://jamesstuber.com/long-term-travel-costs/][How Much Does it Cost to Drop Everything and Travel Asia for 3 Months?]]. - [[https://www.quora.com/I-am-a-US-citizen-and-I-am-thinking-of-retiring-in-Thailand-What-are-the-pros-and-cons-and-is-it-advisable][I am a US citizen and I am thinking of retiring in Thailand.]]. - [[https://uncorneredmarket.com/planning-travel-covid19/][Lessons in Planning and Travel During COVID-19 – Uncornered Market]]. - [[https://expertvagabond.com/best-travel-tips/][My 30 Best Travel Tips After 8 Years Traveling The World • Expert Vagabond]]. - [[https://www.quora.com/My-partner-I-want-to-backpack-around-as-much-of-the-world-as-we-can-for-6-12-months-What-surprises-did-you-learn-on-the-way-I-should-plan-for][My partner & I want to backpack around as much of the world as we can for 6-12 months. What surprises did you learn on the way I should plan for?]]. - [[http://nomadlist.io/?hn][NomadList]]: Best cities to work from remotely. - [[http://www.oecdbetterlifeindex.org/topics/life-satisfaction/][OECD Better Life Index]]. - [[https://blog.calebjay.com/posts/taxman-prices/][onlinetaxman.com Prices]]. - [[https://servas.org/][Peace and understanding through travel and hosting | Servas Online]]. - [[http://www.justanotherbackpacker.com/round-the-world-trip-20172018-the-costs/][Round The World Trip 2017/2018: The Costs - Just Another Backpacker]]. - [[https://news.ycombinator.com/item?id=11890991][Show HN: I made a database of remote companies (Hacker News)]]. - [[https://news.ycombinator.com/item?id=28167358][Show HN: Nomad Visa – Working remotely? Explore your visa options | Hacker News]]. - [[http://www.tombihn.com][tom bihn bags]]. - [[https://www.travistranslator.com/product-category/translators/][Travis translators]]. - [[http://waveuptravel.com][waveUPtravel]]. - [[https://www.quora.com/What-are-the-best-ways-to-earn-money-while-traveling-around-the-world][What are the best ways to earn money while traveling around the world? (Quora)]]. - [[https://twitter.com/twostraws/status/1336613071347982336][where to emigrate to?]]. - [[https://blog.calebjay.com/posts/why-taiwan/][Why You Should Remote Work in Taiwan]]. * [2015-11-26 Thu] SQL bookmarks :PROPERTIES: :CUSTOM_ID: sql-bookmarks :END: :MODIFIED: [2019-02-12 Tue] :END: - [[https://www.pgcli.com/launching-litecli.html][Launching LiteCLI]]. - [[https://modern-sql.com/use-case/literate-sql][Literate SQL]]. - [[https://news.ycombinator.com/item?id=18335723][Show HN: SQL Trainer – Learn SQL by doing live data exercises (Hacker News)]]. - [[https://dev.to/helenanders26/sql-series-from-a-to-z-2pk9][SQL Series: From A to Z - DEV Community]]. - [[https://simonwillison.net/2018/Oct/4/datasette-ideas/][The interesting ideas in Datasette]]. - [[https://dev.to/geshan/you-can-do-it-in-sql-stop-writing-extra-code-for-it-lok][You Can Do it in SQL, Stop Writing Extra Code for it - DEV Community]]. * [2015-11-26 Thu] Unix/Linux tools bookmarks :PROPERTIES: :CUSTOM_ID: unix-linux-tools-bookmarks :END: :MODIFIED: [2021-11-23 Tue] :END: - [[https://forums.freebsd.org/threads/small-guide-on-using-mtree.61113/][(small) Guide on using mtree (The FreeBSD Forums)]]. - [[http://www.thegeekstuff.com/2012/04/curl-examples/][15 Practical Linux cURL Command Examples]]. - [[https://linuxhint.com/20_awk_examples/][20 awk examples – Linux Hint]]. - [[https://www.cyberciti.biz/open-source/7-awesome-open-source-analytics-weblog-analysis-softwares/][7 Awesome Open Source Analytics Software For Linux and Unix - nixCraft]]. - [[https://news.ycombinator.com/item?id=12137576][A practical proposal for migrating to safe long sessions on the web (Hacker News)]]. - [[https://news.ycombinator.com/item?id=12140477][A practical security guide for web developers (Hacker News)]]. - [[https://news.ycombinator.com/item?id=12364077][A Unix Utility to Know About: lsof (2009) (Hacker News)]]. - [[https://gist.github.com/rtfpessoa/7a745be31e89673b8fc7][agnoster.bash]]. - [[https://huxiaoxing.com/tools/an-elegant-way-of-managing-dotfiles][An Elegant Way of Managing Dotfiles]]. - [[https://news.ycombinator.com/item?id=16612580][Announcing gRPC Support in Nginx (Hacker News)]]. - [[http://www.figlet.org][ASCII art text with figlet]]. - [[https://autotools.io/index.html][Autotools Mythbuster]]. - [[http://www.faqs.org/faqs/computer-lang/awk/faq/][awk FAQ]]. - [[http://ferd.ca/awk-in-20-minutes.html][awk in 20 minutes]]. - [[https://blog.balthazar-rouberol.com/text-processing-in-the-shell][Balthazar – Text processing in the shell]]. - [[https://linuxhint.com/bash_parameter_expansion/][Bash Parameter Expansion (Linux Hint)]]. - [[https://linuxhint.com/bash_pipe_tutorial/][Bash pipe tutorial (Linux Hint)]]. - [[https://linuxhint.com/bash_until_loops/][Bash Until Loops (Linux Hint)]]. - [[https://joshrollinswrites.com/help-desk-head-desk/basic-ssh-security/][Basic SSH Security (The Art of Not Asking Why)]]. - [[http://www.unixwiz.net/techtips/chroot-practices.html][Best Practices for UNIX chroot]]. - [[http://johnbokma.com/blog/2019/05/13/blacklisting-domains-with-postfix.html][Blacklisting domains with Postfix - John Bokma]]. - [[http://www.grymoire.com/Unix/Awk.html][Bruce Barnett's awk tutorial]]. - [[http://www.grymoire.com/Unix/sed.html][Bruce Barnett's sed tutorial]]. - [[https://github.com/skorokithakis/catt][Cast All The Things]]. - [[https://remysharp.com/2018/08/23/cli-improved][CLI: improved (better cli alternatives)]]. - [[https://news.ycombinator.com/item?id=17874718][CLI: Improved, better CLI alternatives (Hacker News)]]. - [[https://github.com/learnbyexample/Command-line-text-processing][Command-line-text-processing: From finding text to search and replace, from sorting to beautifying text and more]]. - [[http://kkovacs.eu/cool-but-obscure-unix-tools#][Cool but obscure unix tools at kkovacs.eu]]. - [[https://catonmat.net/cookbooks/curl][Curl Cookbook]]. - [[https://jvns.ca/blog/2019/08/27/curl-exercises/][curl exercises (Julia Evans)]]. - [[https://linuxhint.com/curl_bash_examples/][Curl in Bash Scripts by Example (Linux Hint)]]. - [[https://news.ycombinator.com/item?id=11213213][Curl vs Wget (Hacker News)]]. - [[https://dualuse.io/blog/curryfinger/][CURRYFINGER - SNI & Host header spoofing utility - DUALUSE]]. - [[https://gchq.github.io/CyberChef/][CyberChef]]. - [[https://www.romanzolotarev.com/openbsd/bioctl-crypto.html][Encrypt disk with bioctl(8) and CRYPTO - Roman Zolotarev]]. - [[http://puntoblogspot.blogspot.co.uk/2016/01/entr-suckless-inotify-tools.html?m=1][entr runs commands when a file changes]]. - [[https://wizardzines.com/networking-tools-poster/][Every Linux networking tool I know (zine)]]. - [[https://github.com/clvv/fasd][fasd a command-line productivity booster]]. - [[https://linuxhint.com/length_of_string_bash/][Find Length of String in Bash (Linux Hint)]]. - [[https://news.ycombinator.com/item?id=18967249][For the Love of Pipes (Hacker News)]]. - [[http://git-annex.branchable.com/assistant/][git-annex]]. - [[https://github.com/antonmedv/fx/][GitHub - antonmedv/fx: Command-line tool and terminal JSON viewer]]. - [[https://github.com/atorstling/origin][GitHub - atorstling/origin: Track down the origin of a command]]. - [[https://github.com/insanum/gcalcli][GitHub - insanum/gcalcli: Google Calendar Command Line Interface]]. - [[https://github.com/raboof/nethogs][GitHub - raboof/nethogs: Linux 'net top' tool]]. - [[https://linuxhint.com/trim_string_bash/][How to trim string in bash (Linux Hint)]]. - [[https://linuxhint.com/array_awk_command/][How to use array in awk command (Linux Hint)]]. - [[https://www.digitalocean.com/community/tutorials/how-to-use-bash-s-job-control-to-manage-foreground-and-background-processes][How To Use Bash's Job Control to Manage Foreground and Background Processes]]. - [[https://linuxhint.com/conditional_statement_awk_command/][How to use conditional statement in awk command (Linux Hint)]]. - [[https://linuxhint.com/dd_command_linux-2/][How to Use dd Command on Linux (Linux Hint)]]. - [[https://linuxhint.com/for_loop_awk_command/][How to use for loop in awk command (Linux Hint)]]. - [[https://news.ycombinator.com/item?id=22082585][HTTP static server one-liners | Hacker News]]. - [[https://github.com/jkbrzt/httpie][httpie: Command line HTTP client, a user-friendly curl alternative]]. - [[https://linuxhint.com/iptables_for_beginners/][Iptables for beginners (Linux Hint)]]. - [[https://sneak.berlin/20191011/stupid-unix-tricks/][Jeffrey Paul: Stupid Unix Tricks (Yubikey ssh on macOS)]]. - [[https://blog.jessfraz.com/post/for-the-love-of-pipes/][Jessie Frazelle's Blog: For the Love of Pipes]]. - [[https://jvns.ca/zines/][Julia Evans's zines (unix tools)]]. - [[https://kiramclean.com/blog/how-to-set-up-your-own-nextcloud-server/][Kira McLean | How To Set Up Your Own Nextcloud Server]]. - [[https://twitter.com/beorn__/status/1281504590073073666][LD_DEBUG awesomeness (using ls)]]. - [[http://irreal.org/blog/?p=7323][Learn a Little AWK (Irreal)]]. - [[https://linuxhint.com/linux_cp_command/][Linux cp Command (Linux Hint)]]. - [[http://bryan-murdock.blogspot.co.uk/2015/12/linux-environment-management.html][Linux environment management]]. - [[https://linuxhint.com/linux_grep_command/][Linux grep Command (Linux Hint)]]. - [[https://linuxhint.com/linux_lsof_command/][Linux lsof Command (Linux Hint)]]. - [[http://www.slideshare.net/brendangregg/scale2015-linux-perfprofiling][Linux profiling at Netflix]]. - [[https://linuxhint.com/linux_tar_command-2/][Linux tar Command (Linux Hint)]]. - [[https://linuxhint.com/linux_tr_command/][Linux tr Command (Linux Hint)]]. - [[https://kitten-technologies.co.uk/project/magic-pipes/doc/trunk/README.wiki][Magic Pipes: suite of tools to construct powerful Unix shell pipelines that operate on structured data]]. - [[http://stackoverflow.com/questions/3519939/make-curl-follow-redirects][Make cURL follow redirects]]. - [[https://github.com/idcrook/i-dotfiles/blob/master/INSTALL-macos.md][Managing macOS dot files with stow]]. - [[http://mbork.pl/2019-03-11_Name-based_UUID_generation][Marcin Borkowski: 2019-03-11 Name-based UUID generation]]. - [[https://news.ycombinator.com/item?id=18922030][More than you really wanted to know about Patch (Hacker News)]]. - [[https://news.ycombinator.com/item?id=11909543][My First 10 Minutes on a Server (Hacker News)]]. - [[https://www.keycdn.com/support/nginx-vs-apache][Nginx vs Apache]]. - [[https://linuxhint.com/nmap_alternatives/][Nmap Alternatives (Linux Hint)]]. - [[https://linuxhint.com/nmap_basics_tutorial/][NMAP basics Tutorial (Linux Hint)]]. - [[https://linuxhint.com/nmap_flags/][nmap flags and what they do (Linux Hint)]]. - [[https://linuxhint.com/nmap_scan_ip_ranges/][Nmap: scan IP ranges (Linux Hint)]]. - [[https://github.com/phw/peek][Peek: Simple animated GIF screen recorder with an easy to use interface]]. - [[https://news.ycombinator.com/item?id=18992930][Practical Linux Hardening Guide (Hacker News)]]. - [[https://rclone.org/][Rclone (mount many cloud services locally)]]. - [[https://justine.lol/redbean/index.html][redbean]]. - [[https://iridakos.com/how-to/2019/05/16/remove-duplicate-lines-preserving-order-linux.html][Remove duplicate lines from files keeping the original order]]. - [[https://www.philipdaniels.com/blog/2019/ripgrep-cheatsheet/][Ripgrep Cheatsheet • Phil's Blog]]. - [[https://news.ycombinator.com/item?id=18291302][Show HN: Ultimate Plumber – a tool for writing Linux pipes with live preview (Hacker News)]]. - [[https://github.com/p-gen/smenu][smenu is a selection filter just like sed is an editing filter]]. - [[http://www.softether.org][SoftEther VPN]]. - [[https://blog.0xbadc0de.be/archives/300][SSH: Best practices]]. - [[http://irreal.org/blog/?p=7184][Text Manipulation with Command Line Utilities]]. - [[https://github.com/trimstray/the-book-of-secret-knowledge][the-book-of-secret-knowledge: A collection of inspiring lists, manuals, cheatsheets, blogs, hacks, one-liners, cli/web tools, and more]]. - [[https://github.com/calebmadrigal/trackerjacker/blob/master/README.md][trackerjacker/README.md at master · calebmadrigal/trackerjacker · GitHub]]. - [[https://devarea.com/understanding-awk-practical-guide/][Understanding Awk (Practical Guide)]]. - [[https://www.cis.upenn.edu/~bcpierce/unison/][Unison File Synchronizer]]. - [[https://www.reddit.com/r/linux/comments/mi80x/give_me_that_one_command_you_wish_you_knew_years/][Unix commands you wish you knew years ago (Reddit)]]. - [[http://unixmages.com/ufbm.pdf][Unix for the Beginning Mage]]. - [[https://github.com/snovvcrash/usbrip][usbrip: Simple CLI forensics tool for tracking USB device artifacts (history of USB events) on GNU/Linux]]. - [[http://brandon.invergo.net/news/2012-05-26-using-gnu-stow-to-manage-your-dotfiles.html][Using gnu stow to manage your dotfiles]]. - [[https://magic-wormhole.readthedocs.io/en/latest/welcome.html#example][Welcome & Magic-Wormhole]]. - [[https://www.semicomplete.com/projects/xdotool/][xdotool - fake keyboard/mouse input, window management, and more - semicomplete]]. - xmllint --format. - [[https://lucasfcosta.com/2019/04/07/streams-introduction.html][Your terminal is not a terminal: An Introduction to Streams]]. - [[https://dotfiles.github.io/][Your unofficial guide to dotfiles on GitHub]]. * [2015-11-26 Thu] Couchbase React Native bookmarks :PROPERTIES: :CUSTOM_ID: couchbase-react-native-bookmarks :END: :MODIFIED: [2017-04-23 Sun] :END: - [[https://groups.google.com/forum/#!forum/mobile-couchbase][Couchbase Mobile discussion group]]. - [[http://developer.couchbase.com/documentation/mobile/current/develop/guides/couchbase-lite/native-api/index.html][Couchbase Mobile Native API]]. - [[http://developer.couchbase.com/mobile/][Couchbase Mobile]]. - [[https://github.com/couchbase/sync_gateway][Couchbase sync gateway]]. - [[http://blog.couchbase.com/2015/november/getting-started-with-react-native-android-and-couchbase-lite][Getting Started with React Native Android and Couchbase Lite]]. * [2015-11-26 Thu] Installing Emacs 25 devel on Mac OS X :PROPERTIES: :CUSTOM_ID: installing-emacs-on-mac-os-x :END: ** Stable #+BEGIN_SRC sh brew update brew install emacs --HEAD --use-git-head --with-cocoa --with-srgb --with-gnutls brew linkapps emacs #+END_SRC ** Development #+BEGIN_SRC sh brew update brew install emacs --devel --with-cocoa --with-srgb --with-gnutls brew linkapps emacs then #+END_SRC Had problems loading seq. Removed byte-compiled packages: #+BEGIN_SRC sh $ find ~/.emacs.d/elpa -iname *.elc -exec rm '{}' \; #+END_SRC * [2015-11-25 Wed] Diagram tools bookmarks :PROPERTIES: :CUSTOM_ID: diagram-tools-bookmarks :END: :MODIFIED: [2020-06-13 Sat] :END: - [[https://www.worthe-it.co.za/programming/2017/09/19/quick-introduction-to-graphviz.html][A Quick Introduction to Graphviz]]. - [[https://ncona.com/2020/06/create-diagrams-with-code-using-graphviz/][Create diagrams with code using Graphviz – ncona.com – Learning about computers]]. - [[https://www.diagram.codes/][Diagram.Codes]]. - [[https://www.draw.io/][Flowchart Maker & Online Diagram Software]]. - [[http://graphviz.it/][Graphviz it! - fiddle with diagrams]]. - [[http://soc.if.usp.br/manual/graphviz/html/info/shapes.html][Graphviz node shapes]]. - [[https://www.planttext.com/][PlantText UML Editor]]. - [[https://news.ycombinator.com/item][Svgbob: Convert your ASCII diagram scribbles into happy little SVG]]. - [[http://www.texample.net/tikz/examples/tag/graphs/][TeXample.net (TeX examples)]]. - [[https://twitter.com/maybekatz/status/1137254612468154370][What do you like using for software architecture diagrams? (twitter)]]. * [2015-11-24 Tue] Licensing bookmarks :PROPERTIES: :CUSTOM_ID: licensing-bookmarks :END: - [[http://choosealicense.com/][choosealicense.com]] (Choosing an open source license doesn’t need to be scary). - [[https://github.com/github/choosealicense.com][choosealicense.com (github)]]. - [[https://tldrlegal.com/][tldrlegal.com]] (Software Licenses in Plain English). * [2015-11-23 Mon] Synology bookmarks :PROPERTIES: :CUSTOM_ID: synology-bookmarks :END: :MODIFIED: [2020-08-03 Mon] :END: - [[https://synoguide.com/2016/04/21/backup-your-files-to-an-external-drive-or-a-shared-file-dsm-6-0/][Backup your files to an external drive or a shared file DSM 6.0 – Synoguide]]. - [[https://www.makeuseof.com/tag/ext4-btrfs-making-switch-linux/][Ext4 vs. Btrfs: Why We're Making The Switch {Linux}]]. - [[https://bpmsg.com/how-to-make-your-synology-disk-station-nas-more-secure/][How to make your Synology Disk station (NAS) more secure? – BPMSG]]. - [[https://www.techrepublic.com/article/how-to-use-the-files-app-to-connect-to-a-network-server-from-your-iphone-or-ipad/][How to use the Files app to connect to a network server from your iPhone]]. - [[https://joshdick.net/2014/04/12/configuring_ssh_and_scp_sftp_on_dsm_5.0_for_synology_diskstations.html][Josh Dick » Configuring SSH and SCP/SFTP on DSM 5.0 for Synology DiskStations]]. - [[https://www.chainsawonatireswing.com/2012/01/16/log-in-to-a-synology-diskstation-using-ssh-keys-as-a-user-other-than-root/][Log in to a Synology DiskStation using SSH keys as a user other than root]]. - [[http://blog.markusbordihn.de/2012/02/encryption-of-synology-diskstation-how.html][Look into Synology's file encryption]]. - [[https://arstechnica.com/civis/viewtopic.php?t=1273997][RAID5 vs SHR - Ars Technica OpenForum]]. - [[https://www.reddit.com/r/synology/comments/73f7tb/please_confirm_that_i_chose_the_right_option_shr1/][reddit: Please confirm that I chose the right option (SHR1 with DS718+)]]. - [[https://synoguide.com/2014/07/30/reset-admin-password-synology/][Reset your Admin password in your Synology – Synoguide]]. * [2015-11-22 Sun] Backup bookmarks :PROPERTIES: :CUSTOM_ID: backup-bookmarks :END: - [[http://www.amazon.com/gp/product/B00O0M5QK8][HGST Deskstar NAS 3.5-Inch 6TB 7200RPM SATA III 128MB Cache Internal Hard Drive (0S03839)]]. - [[https://www.stavros.io/posts/holy-grail-backups/][I found the Holy Grail of backups]]. - [[http://www.amazon.com/gp/product/B00CQ35GYE][Kingston Technology 4GB 1600MHz DDR3L PC3-12800 1.35V Non-ECC CL11 SODIMM Intel Laptop Memory KVR16LS11/4]]. - [[https://news.ycombinator.com/item?id=19482280][Show HN: Baxx – Unix-friendly backup service (Hacker News)]]. - [[http://www.amazon.com/gp/product/B00P3RPMEO/ref%3Das_li_ss_tl?psc%3D1&redirect%3Dtrue&ref_%3Doh_aui_detailpage_o01_s00&linkCode%3Dsl1&tag%3Dnatfrie-20&linkId%3D9867e6a1134b8c16fb39bd06c39bf1ef][Synology Disk Station 8-Bay (Diskless) Network Attached Storage (NAS) (DS1815+)]]. - [[http://www.tarsnap.com/][Tarsnap: online backups for the truly paranoid]]. * [2015-11-22 Sun] Making hummus :PROPERTIES: :CUSTOM_ID: making-hummus :END: Made hummus, based on [[http://www.deliciousistanbul.com/blog/2013/04/28/5-secrets-to-perfect-hummus/][Delicious Istanbul's]] [[http://www.deliciousistanbul.com/blog/2013/04/28/5-secrets-to-perfect-hummus/][5 Secrets to Perfect Hummus]] ([[https://web.archive.org/web/20160829162734/deliciousistanbul.com/blog/2013/04/28/5-secrets-to-perfect-hummus/][wayback machine]]) post. - 160 g dry chickpeas. - 4 cloves garlic minced. - 1 tsp fine sea salt. - 1 1/2 tbsp lemon juice. - 1/4 tsp ground cumin. - 6 tbsp tahini paste. - 2/3 cup cooking water. - Extra virgin olive oil, for serving. - Red pepper flakes, for serving. - Zahter mixture, for serving. 1. Soak chickpeas overnight. 2. Discard water and rinse chickpeas. 3. Cook in low heat (about 5 cups water) for 1.5 hours for until soft (but keeping shape.) Check if can be mashed with thumnb. 4. Save cooking water. 5. Peal chickpeas (optional). 6. Blend ingredients until silky paste. Taste and add lemon/salt/cooking water. Keeps in fridge for 3-4 days. Freeze otherwise. [[file:images/making-hummus/hummus-01.jpg]] [[file:images/making-hummus/hummus-02.jpg]] [[file:images/making-hummus/hummus-03.jpg]] [[file:images/making-hummus/hummus-04.jpg]] [[file:images/making-hummus/hummus-05.jpg]] [[file:images/making-hummus/hummus-06.jpg]] [[file:images/making-hummus/hummus-07.jpg]] [[file:images/making-hummus/hummus-08.jpg]] [[file:images/making-hummus/hummus-09.jpg]] * [2015-11-22 Sun] Nara travel bookmarks :PROPERTIES: :CUSTOM_ID: nara-travel-bookmarks :END: - [[https://en.wikipedia.org/wiki/K%25C5%258Dfuku-ji][Kōfuku-ji]]. - [[https://en.wikipedia.org/wiki/T%C5%8Ddai-ji][Nara Buddha temple]]. * [2015-11-21 Sat] Kubernetes bookmarks :PROPERTIES: :CUSTOM_ID: kubernetes-bookmarks :END: :MODIFIED: [2019-10-22 Tue] :END: - [[https://news.ycombinator.com/item?id=17462043][A Tutorial Introduction to Kubernetes (Hacker News)]]. - [[https://news.ycombinator.com/item?id=11216020][Borg, Omega, Kubernetes: Lessons learned from container management over a decade (Hacker News)]]. - [[http://fabric8.io/][Fabric8 is an integrated open source DevOps and Integration Platform (Kubernetes or OpenShift)]]. - [[https://github.com/artsy/hokusai][hokusai: Artsy's Docker / Kubernetes CLI and Workflow]]. - [[https://news.ycombinator.com/item?id=14452819][Kubernetes by Example | Hacker News]]. - [[https://news.ycombinator.com/item?id%3D10438273][Swarm vs. Fleet vs. Kubernetes vs. Mesos (Hacker News)]]. - [[https://news.ycombinator.com/item?id%3D10438273][Swarm vs. Fleet vs. Kubernetes vs. Mesos]]. - [[https://codefresh.io/howtos/local-k8s-draft-skaffold-garden/][The ultimate guide for local development on Kubernetes]]. * [2015-11-21 Sat] Docker bookmarks :PROPERTIES: :CUSTOM_ID: docker-bookmarks :END: :MODIFIED: [2021-01-03 Sun] :END: - [[https://news.ycombinator.com/item?id=25619319 ][Dockerfile Best Practices | Hacker News]]. - [[https://linuxhint.com/beginners_guide_docker_compose/][A Beginner’s Guide To Docker Compose – Linux Hint]]. - [[https://news.ycombinator.com/item?id=22964972][Basic Docker Commands for Beginners | Hacker News]]. - [[https://news.ycombinator.com/item?id%3D10890233][Docker for Beginners (Hacker News)]]. - [[http://prakhar.me/docker-curriculum/][Docker for Beginners]]. - [[https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes][How To Remove Docker Images, Containers, and Volumes | DigitalOcean]]. - [[https://news.ycombinator.com/item?id%3D10969052][Simplifying Docker on OS X (Hacker News)]]. - [[https://twitter.com/b0rk/status/1237528379097616388][What problems have you run into in practice when using containers?]]. * [2015-11-21 Sat] Angular bookmarks :PROPERTIES: :CUSTOM_ID: angular-bookmarks :END: - [[https://egghead.io/technologies/angular2][Egghead.io's Angular 2 lessons]]. * [2015-11-21 Sat] Mac OS bookmarks :PROPERTIES: :CUSTOM_ID: mac-os-bookmarks :END: :MODIFIED: [2018-09-30 Sun] :END: - [[https://github.com/jrus/cocoa-text-system][Customizing the Cocoa Text System (github)]]. - [[http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html][Customizing the Cocoa Text System (~/Library/KeyBindings/DefaultKeyBinding.dict)]]. - [[https://github.com/ttscoff/KeyBindings][GitHub - ttscoff/KeyBindings: DefaultKeybindings.dict for Mac OS X]]. - [[https://developer.apple.com/documentation/appkit/nsstandardkeybindingresponding?language=objc][NSResponder (useful for DefaultKeyBinding.dict)]]. - [[https://www.daisydiskapp.com/][DaisyDisk]] (what's taking up your disk space). - [[https://8thlight.com/blog/colin-jones/2015/11/06/dtrace-even-better-than-strace-for-osx.html][DTrace: {even better than} strace for OS X | 8th Light]]. - [[http://flummox-engineering.blogspot.com/2014/06/getting-absolute-path-in-bash-in-osx.html][Getting absolute path in Bash in OSX]]. - [[https://github.com/fitztrev/shuttle][GitHub - fitztrev/shuttle: A simple SSH shortcut menu for macOS]]. - [[http://csrc.nist.gov/publications/drafts/800-179/sp800_179_draft.pdf][Guide to Securing Apple OS X]]. - [[http://www.hammerspoon.org][Hammerspoon]]. - [[http://www.manpagez.com/man/8/kextstat/][kextstat]]. - [[https://objective-see.com/products/kextviewr.html][KextViewr: View all modules on that are loaded in the OS kernel]]. - [[https://www.obdev.at/products/littlesnitch/index.html][Little Snitch]]. - [[https://www.raywenderlich.com/151741/macos-development-beginners-part-1][macOS Development for Beginners: Part 1]]. - [[https://www.raywenderlich.com/151746/macos-development-beginners-part-2][macOS Development for Beginners: Part 2]]. - [[https://www.raywenderlich.com/151748/macos-development-beginners-part-3][macOS Development for Beginners: Part 3]]. - [[https://pspdfkit.com/blog/2018/porting-ios-apps-to-mac-marzipan-iosmac-uikit-appkit/][Marzipan: Porting iOS Apps to the Mac (Inside PSPDFKit)]]. - [[https://github.com/kasper/phoenix][Phoenix: A lightweight macOS window and app manager scriptable with JavaScript]]. - [[https://subler.org/][Subler: Mac OS X app created to mux and tag mp4 files]]. - [[https://apple.stackexchange.com/questions/82/which-os-x-applications-do-you-find-indispensable/][Which OS X Applications do you find indispensable? (Stack Exchange)]]. * [2015-11-21 Sat] easy_install->pip->conda :PROPERTIES: :CUSTOM_ID: easy_install-pip-conda :END: Spotted [[http://conda.pydata.org/docs/index.html][Conda]] package manager. It handles python installations, in addition to package management. There's also a package index provided by [[https://binstar.org/][Binstar]]. Installed [[http://conda.pydata.org/miniconda.html][Miniconda]], the bare bones Conda environment. Can't find a python package in Binstar? Here's a post on [[http://www.peterbronez.com/Using%2520PyPi%2520Packages%2520with%2520Conda][Using PyPi Packages with Conda]]. If that fails, you can try pip from your Conda python environment. * [2015-11-16 Mon] Traditional music bookmarks :PROPERTIES: :CUSTOM_ID: traditional-music-bookmarks :END: :MODIFIED: [2015-11-17 Tue] :END: - [[http://asianclassicalmp3.org/][Cliff Sloane's asian classical music in mp3 format]]. - [[http://oriental-traditional-music.blogspot.in][Oriental traditional music]]. - [[https://www.youtube.com/watch?v%3D4PVGmjYypGU&feature%3Dyoutu.be][Shruti Box comparison]]. * [2015-11-04 Wed] Recover from an unresponsive Emacs :PROPERTIES: :CUSTOM_ID: recover-from-an-unresponsive-emacs :END: [[https://twitter.com/_wilfredh][Wilfred Hughes]] has a handy [[https://twitter.com/_wilfredh/status/659499112677642242?refsrc%3Demail&s%3D11][tip]] to bail you out of a hung Emacs instance: #+BEGIN_SRC sh pkill -SIGUSR2 emacs #+END_SRC ps. Not had a chance to try it, but next time it happens... * [2015-10-25 Sun] Training for under 50 min 10k run :PROPERTIES: :CUSTOM_ID: training-for-under-50-min-10k-run :END: Not much training time for an under 50 minute 10k run, but here's an attempt (based on time-to-run's [[http://www.time-to-run.com/training/10k/sub50.htm][sub-50]]): | Mon | Tue | Wed | Thu | Fri | Sat | Sun | |----------+----------+--------------+----------+--------------+----------+-------------| | /Oct 26/ | /Oct 27/ | /Oct 28/ | /Oct 29/ | /Oct 30/ | /Oct 31/ | /Nov 1/ | | | | 60 min | 30 min | 2k @ 4.55/k | rest | 105 min | | | | | | 2 min rest | | | | | | ✔ | | (repeat x 3) | | | |----------+----------+--------------+----------+--------------+----------+-------------| | /Nov 2/ | /Nov 3/ | /Nov 4/ | /Nov 5/ | /Nov 6/ | /Nov 7/ | /Nov 8/ | | 30 min | 30 min | 1k @ 4.50/k | 30 min | 30 min | rest | 5k @ 4.55/k | | | | 90 sec rest | | | | | | | | (repeat x 5) | | | | | |----------+----------+--------------+----------+--------------+----------+-------------| | /Nov 9/ | /Nov 10/ | /Nov 11/ | /Nov 12/ | /Nov 13/ | /Nov 14/ | /Nov 15/ | | 10k easy | 30 min | 1k @ 4.55/k | 30 min | 30 min | rest | race day | | | | 1 min easy | | | | | | | | (repeat x 3) | | | | | |----------+----------+--------------+----------+--------------+----------+-------------| * [2015-10-25 Sun] Reading a running training plan :PROPERTIES: :CUSTOM_ID: reading-a-running-training-plan :END: A sample from [[http://lsanderstri.com/2014/10/15/kona-part-2/][Kona Part 2's]] comments: #+BEGIN_EXAMPLE 2.5 w/u to 4x(1.25@11.5 w/0.25R@7) to 3x(3.75@10.5 w/0.5R@7) to 2.5 c/d. #+END_EXAMPLE Is read from left to right as: #+BEGIN_EXAMPLE 2.5 mile warm up to four times through 1.25 miles at 11.5 miles per hour with 0.25 miles recovery at 7 miles per hour to three times through 3.75 miles at 10.5 miles per hour with 0.5 miles recovery at 7 miles per hour to 2.5 miles cool down. #+END_EXAMPLE * [2015-10-23 Fri] Find binary in PATH using python :PROPERTIES: :CUSTOM_ID: find-binary-in-path-using-python :END: #+BEGIN_SRC python :results output :exports both import distutils.spawn print distutils.spawn.find_executable('git') #+END_SRC #+RESULTS: : /usr/bin/git * [2015-10-22 Thu] Indonesia travel bookmarks :PROPERTIES: :CUSTOM_ID: indonesia-travel-bookmarks :END: :MODIFIED: [2021-01-02 Sat] :END: - [[https://duckduckgo.com/?q%3Dborobudur%2Bindonesia&t%3Dffab&iax%3D1&ia%3Dimages][Borobudur]]. - [[https://backpackalmanac.com/2018/05/14/hiking-padar-island-in-komodo-national-park-indonesia/][Hiking Padar Island in Komodo National Park (Indonesia) | The Backpack Almanac]]. - [[https://en.wikipedia.org/wiki/Rumah_Gadang][Rumah Gadang]]. * [2015-10-22 Thu] Malaysia travel bookmarks :PROPERTIES: :CUSTOM_ID: malaysia-travel-bookmarks :END: :MODIFIED: [2018-05-13 Sun] :END: - [[http://www.tripadvisor.co.uk/Restaurant_Review-g298570-d1164708-Reviews-Coliseum_Cafe-Kuala_Lumpur_Wilayah_Persekutuan.html][Coliseum Cafe, Kuala Lupur]]. - [[https://migrationology.com/kek-lok-si-temple-penang/][How to Visit Penang's Kek Lok Si Temple (and What to Eat)]]. * [2015-10-22 Thu] Mongolia travel bookmarks :PROPERTIES: :CUSTOM_ID: mongolia-travel-bookmarks :END: :MODIFIED: [2017-07-21 Fri] :END: - [[http://www.lonelyplanet.com/mongolia/travel-tips-and-articles/beyond-the-dunes-road-tripping-mongolias-gobi-desert][Beyond the dunes: road-tripping Mongolia's Gobi Desert]]. - [[https://twitter.com/archpics/status/881270695614967808][Terra cotta warriors at Mount Khan, Inner Mongolia]]. * [2015-10-22 Thu] Running bookmarks :PROPERTIES: :CUSTOM_ID: running-bookmarks :END: :MODIFIED: [2018-12-28 Fri] :END: - [[https://forums.runnersworld.co.uk/discussion/164225/10k-in-under-50-mins][10k in under 50 mins — Runner's World UK Forum]]. - [[http://www.dcrainmaker.com/2015/11/garmin-fr230-fr235-review.html][Garmin Forerunner 230 & 235 In-Depth Review (DC Rainmaker)]]. - [[http://barefootrunning.fas.harvard.edu/6FAQ.html][Harvard's Running barefoot or in minimal footwear FAQ]]. - [[https://therunningbug.com/fitness/tips-and-advice/how-to-run-a-sub-50-10k-race][How to run a sub-50 10K - The Running Bug]]. - [[http://www.npr.org/sections/13.7/2016/09/14/493803246/is-running-good-or-bad-for-your-health][Is Running Good Or Bad For Your Health?]]. - [[http://www.chaser.me.uk][Mornington Chasers running club]]. - [[https://entries.opentrack.run/][Open track: Race Management System]]. - [[http://ironrosey.com/blog-posts/review-newton-gravity-iv-motion-iv/][Review : Newton Gravity IV & Motion IV | Ramblings of an IronRose]]. - [[https://www.theraceorganiser.com/listed-races/][The Race Organiser]]. - [[http://www.time-to-run.com/training/10k/sub50.htm][Training towards a sub 50 minute 10K]]. * [2015-10-22 Thu] Media player bookmarks :PROPERTIES: :CUSTOM_ID: media-player-bookmarks :END: :MODIFIED: [2019-05-01 Wed] :END: - [[https://cmus.github.io][cmus, a small, fast and powerful console music player for Unix-like OS]]. - [[https://github.com/mps-youtube/mps-youtube][mps-youtube]]. - [[https://mpv.io/][mpv (a fork of mplayer2 and MPlayer)]]. - [[https://sandilands.info/sgordon/multimedia-on-linux-command-line][Multimedia on Linux Command Line: wget, PdfTK, ffmpeg, flac, SoX]]. - [[https://plex.tv/][PLEX]] (stream your media everywhere). - [[https://news.ycombinator.com/item][Soul – A language and IDE for audio coding ]]. * [2015-10-17 Sat] Get Emacs to gather links in posts :PROPERTIES: :CUSTOM_ID: get-emacs-to-gather-links-in-posts :END: Comments in posts can be a great source of recommendations. Here's a way to extract post links using Emacs and [[http://github.com/zweifisch/enlive][enlive]]. #+ATTR_HTML: :width 75% :height 75% [[file:images/get-emacs-to-gather-urls-in-posts/emacs-enlive-url-fetch.gif]] #+BEGIN_SRC emacs-lisp (require 'enlive) ;; https://github.com/zweifisch/enlive (require 'org) (defun ar/input-clipboard-url-or-prompt () "Return a URL from clipboard or prompt user for one." (let* ((clipboard (current-kill 0)) (url (if (string-match "^https?://" clipboard) clipboard (read-string "URL: ")))) (unless (string-match "^https?://" url) (error "Not a URL")) url)) (defun ar/url-fetch-anchor-elements (url) "Fetch anchor elements in URL as list of alist: \((title . \"my title\") (url . \"http://some.location.com\"))." (let ((elements (enlive-query-all (enlive-fetch url) [a]))) (mapcar (lambda (element) `((title . ,(enlive-text element)) (url . ,(enlive-attr element 'href)))) elements))) (defun ar/url-view-links-at () "View external links in HTML from prompted URL or clipboard." (interactive) (with-current-buffer (get-buffer-create "*links*") (org-mode) (view-mode -1) (erase-buffer) (mapc (lambda (anchor) (let-alist anchor (when (and .url (string-match "^http" .url)) (insert (org-make-link-string .url .title) "\n")))) (ar/url-fetch-anchor-elements (ar/input-clipboard-url-or-prompt))) (delete-duplicate-lines (point-min) (point-max)) (goto-char (point-min)) (toggle-truncate-lines +1) (view-mode +1) (switch-to-buffer (current-buffer)))) #+END_SRC UPDATE(2019-04-13): Refreshed post with latest code from my [[https://github.com/xenodium/dotsies/blob/9cf32157c5fec140218898dfcb11e74f623fec6c/emacs/ar/ar-url.el#L35][init]]. Thanks to [[https://twitter.com/sjig][Gijs]] for pinging. * [2015-10-16 Fri] UX toolbox bookmarks :PROPERTIES: :CUSTOM_ID: ux-toolbox-bookmarks :END: :MODIFIED: [2020-10-25 Sun] :END: - [[https://affinity.serif.com/en-gb/ui-design-software/][Affinity Designer: the perfect tool for UI and UX design]]. - [[https://affinity.serif.com/en-us/publisher/][Affinity Publisher – Professional Desktop Publishing Software]]. - [[https://www.youtube.com/watch?v=lWz9G95ITuk&feature=youtu.be&utm_source=designernews][Build a static site with Material Design Lite]]. - [[http://eye-dropper.kepi.cz/][Eye dropper Chrome extension (pick colors in browser)]]. - [[https://coolors.co/1a181b-5d4d66-703d89-9e2bd8-a304f2][Generate - Coolors.co]]. - [[https://news.ycombinator.com/item?id=17869229][Google, but for colors (Hacker News)]]. - [[https://nodesign.dev/][Nodesign.dev | Design less develop more.]]. - [[https://www.paintcodeapp.com][PaintCode - Turn your drawings into Objective-C or Swift drawing code]]. - [[http://paletton.com/#uid=30n190kr6u-blKMk5ypvBoeFHhn][Paletton - The Color Scheme Designer]]. - [[http://www.myfonts.com/WhatTheFont/][WhatTheFont! (find out font names)]]. * [2015-10-08 Thu] Change Emacs shell's CWD with helm projectile :PROPERTIES: :CUSTOM_ID: change-emacs-shells-cwd-with-helm-projectile :END: If using Emacs shell and helm projectile, you can wire these up to quickly change your current working directory. #+ATTR_HTML: :width 75% :height 75% [[file:images/change-emacs-shells-cwd-with-helm-projectile/change-cwd-with-helm-projectile.gif]] #+BEGIN_SRC emacs-lisp (require 'helm-projectile) (defun ar/shell-cd (dir-path) "Like shell-pop--cd-to-cwd-shell, but without recentering." (unless (string-equal mode-name "Shell") (error "Not in Shell mode")) (message mode-name) (goto-char (point-max)) (comint-kill-input) (insert (concat "cd " (shell-quote-argument dir-path))) (let ((comint-process-echoes t)) (comint-send-input))) (defun ar/helm-projectile-shell-cd () "Change shell current working directory using helm projectile." (interactive) (unless (string-equal mode-name "Shell") (error "Not in Shell mode")) (let ((helm-dir-source (copy-tree helm-source-projectile-directories-list))) (add-to-list 'helm-dir-source '(action . ar/shell-cd)) (add-to-list 'helm-dir-source '(keymap . nil)) (add-to-list 'helm-dir-source '(header-line . "cd to directory...")) (helm :sources helm-dir-source :buffer "*helm-dirs*" :candidate-number-limit 10000))) #+END_SRC * [2015-10-07 Wed] Thermostat reset on Bosch WKD28350GB :PROPERTIES: :CUSTOM_ID: thermostat-reset-on-bosch-wkd28350gb :END: My Bosch washer/dryer (WKD28350GB) stopped drying recently. Resetting the dryer's thermostat red breaker did the trick. [[file:images/thermostat-reset-on-bosch-wkd28350gb/WKD28350GB-01.jpg]] [[file:images/thermostat-reset-on-bosch-wkd28350gb/WKD28350GB-02.jpg]] [[file:images/thermostat-reset-on-bosch-wkd28350gb/WKD28350GB-03.jpg]] [[file:images/thermostat-reset-on-bosch-wkd28350gb/WKD28350GB-04.jpg]] Edit: Similar post [[https://www.diynot.com/diy/threads/bosch-wkd28350gb-washer-dryer-no-heat-when-drying.466138/][here]]. * [2015-10-05 Mon] Javascript fetch node sample :PROPERTIES: :CUSTOM_ID: javascript-fetch-node-sample :END: Playing with node and fetch: #+BEGIN_SRC js // Requisite: npm install node-fetch --save // Save to fetch-demo.js // Run: node fetch-demo.js var fetch = require('node-fetch'); fetch("http://xenodium.com/data/javascript-fetch-node-sample/message.json\n", { method: 'GET', timeout: 5000 }).then(function(response) { return response.json(); }).then(function(response) { console.log('subject: ' + response.subject); console.log('body: ' + response.body); }).catch(function(reason) { console.log(reason); }); #+END_SRC * [2015-10-01 Thu] Extract dominant colors in images :PROPERTIES: :CUSTOM_ID: extract-dominant-colors-in-images :END: There's a handy [[https://news.ycombinator.com/item?id%3D10309441][HN post]] pointing to Javier López's [[http://javier.io/blog/en/2015/09/30/using-imagemagick-and-kmeans-to-find-dominant-colors-in-images.html][Using imagemagick, awk and kmeans to find dominant colors in images]]. A comment also highlights [[https://github.com/andrewgleave/color-extract][color-extract,]] written in Go. * [2015-09-28 Mon] Find a word with regex and WordNet :PROPERTIES: :CUSTOM_ID: find-a-word-with-regex-and-wordnet :END: Recently wanted to come up with a random keyword. Querying [[http://wordnet.princeton.edu/][WordNet]] and a regular expression did the job. Installed WordNet on Mac: #+BEGIN_SRC sh $ brew install wordnet #+END_SRC Want a word ending in "esome"? #+BEGIN_SRC sh $ wn esome -grepn -grepv -grepa -grepr | egrep -o -e "\w*esome\b" | sort | uniq adventuresome awesome blithesome bunglesome cuddlesome esome fivesome gruesome lithesome lonesome lovesome meddlesome mettlesome nettlesome threesome tiresome torturesome troublesome unwholesome venturesome wholesome #+END_SRC * [2015-09-26 Sat] Soundcloud's Go best practices (GopherCon 2014) :PROPERTIES: :CUSTOM_ID: soundclouds-go-best-practices-gophercon-2014 :END: Having watched the [[https://www.youtube.com/watch?v%3DY1-RLAl7iOI][video]], some takeaways: ** Single GOPATH *** $GOPATH/src/github.com/soundcloud/foo ** Repo structure *** github.com/soundcloud/whatever **** README.md **** Makefile **** main.go **** support.go **** foo ***** foo.go ***** bar.go **** whatever-server ***** main.go **** wharever-worker ***** main.go ** Formatting and style *** Use gofmt. *** Google's codereview [[https://github.com/golang/go/wiki/CodeReviewComments][guidelines]]. *** Avoid named return parameters. *** Avoid make and new (unless you know sizes). *** Use struct{} for sentinel values: sets, signal chans. **** Conveys no information in it this part. **** Instead of empty interface. **** instead of boolean. *** Break long lines at parameters **** No need to compact. **** Keep trailing coma in last argument. *** Flags #+BEGIN_SRC go func main() { var ( foo = flags.String("foo\n", "doch\n", "...") bar = flat.Int("bar\n", 34, "...") ) flag.Parse() // ... } #+END_SRC *** Logging **** package log **** Telemetry **** Push model (gets expensive over time) ***** Graphite ***** Statsd ***** AirBrake **** Pull model (chosen) ***** expvar ***** Prometheus *** Testing **** package testing ***** Unit tests ***** reflect.DeepEqual **** Integration ***** Use flags for starting services ***** // +build integration *** Code validation **** On Save ***** Go fmt ***** Go import (go fmt++) **** On Build ***** Go vet ***** Golint ***** Go test **** On Deploy ***** go test -tags=integration **** GoCov? *** Dependency management **** Unimportant projects ***** go get -d (and hope) **** Important ***** VENDOR (ie. copy into your repo) ****** Git submodules (no!). ****** Git subtrees (seem OK). ****** Tool (godep?). ****** Build ****** For binaries (use _vendor subdir) * [2015-09-23 Wed] Sync pip with Mac OS updates :PROPERTIES: :CUSTOM_ID: sync-pip-with-mac-os-updates :END: My pip installation recently broke after a Mac OS update. #+BEGIN_EXAMPLE $ pip Traceback (most recent call last): File "/usr/local/bin/pip\n", line 5, in from pkg_resources import load_entry_point File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py\n", line 2793, in working_set.require(__requires__) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py\n", line 673, in require needed = self.resolve(parse_requirements(requirements)) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py\n", line 576, in resolve raise DistributionNotFound(req) pkg_resources.DistributionNotFound: pip==1.1 #+END_EXAMPLE Updating my pip installation fixes the break: #+BEGIN_SRC sh $ sudo easy_install -U pip #+END_SRC * [2015-09-20 Sun] Chinatown treats review :PROPERTIES: :CUSTOM_ID: chinatown-treats-review :END: ** Recommended? yep There's a corner in Chinatown hosting some truly superb treats. If you get caught in the rush between Newport court and Newport place, you'd likely fail to notice some the awesome street food stands. [[file:images/chinatown-treats/chinatown.jpg]] [[file:images/chinatown-treats/newport-court.jpg]] ** Chilly squid I've walked past this place many times and never noticed it. They serve a handful of items, but the grilled chilly squid skewers caught my attention. They're grilled, brushed with chilly sauce and finished with sprinkled sesame and cumin seeds. Super tasty. [[file:images/chinatown-treats/squid-stand.jpg]] [[file:images/chinatown-treats/chilly-squid-1.jpg]] [[file:images/chinatown-treats/chilly-squid-2.jpg]] ** Pancake + Crisp + Egg + Hot chillies = Jiān Bǐng 煎餅 I first had these delicious breakfast savory pancakes at a Beijing street food stall. Never expected to randomly find Jiān Bǐng in London. It's a crepe with an additional egg spread, hoisin sauce, chilly sauce, hot chillies, topped with spring onions and coriander, all wrapping a wonderfully crispy bread cracker. And.. it's awesome. [[file:images/chinatown-treats/pancake-3.jpg]] ** Tai Yaki Chinatown Bakery is hard to miss. Pedestrian traffic slows down as we all fall under the spell of the Tai Yaki machine. This wonderful assembly line produces fish-shaped sweet waffles filled with custard. They are the perfect dessert after some savory street snacks. You can get a bag of 4 for £2. [[file:images/chinatown-treats/fish-1.jpg]] [[file:images/chinatown-treats/fish-4.jpg]] ** All near each other All these delights are within a stone's throw away from each other. #+ATTR_HTML: :width 75% :height 75% [[file:images/chinatown-treats/pano.png]] ** Useful? Was this post useful to you? do [[https://twitter.com/xenodium/status/646101779281801216][reply]]! ** Better suggestion? London is full of overhyped, gimmicky, and unnecessarily expensive restaurants. Very few deliver truly awesome food (even those expensive ones). Got suggestions? I'd love to hear from you [[https://twitter.com/xenodium][@xenodium]]. * [2015-09-18 Fri] React bookmarks :PROPERTIES: :CUSTOM_ID: react-bookmarks :END: :MODIFIED: [2018-07-12 Thu] :END: - [[https://medium.com/dailyjs/11-mistakes-ive-made-during-react-native-redux-app-development-8544e2be9a9][11 mistakes I’ve made during React Native / Redux app development]]. - [[https://news.ycombinator.com/item?id=10962784][9 things every React.js beginner should know (Hacker News)]]. - [[https://camjackson.net/post/9-things-every-reactjs-beginner-should-know][9 things every React.js beginner should know]]. - [[https://css-tricks.com/snippets/css/a-guide-to-flexbox/][A Complete Guide to Flexbox]]. - [[https://github.com/wix/react-native-navigation][A complete native navigation solution for React Native with optional redux support - nav bars, tabs, drawer, modals]]. - [[http://mrn.js.org/][A Material Design style React Native component library]]. - [[https://github.com/syrusakbary/react-native-refresher/blob/master/README.md][A pull to refresh ListView for React Native]]. - [[http://nerds.airbnb.com/facebook-react-native/][Adam Wolf's React Native talk]]. - [[http://moduscreate.com/aligning-children-using-flexbox-in-react-native/][Aligning Children using Flexbox in React Native]]. - [[https://egghead.io/lessons/react-applying-basic-styles-in-react-native][Applying baisc styles in react native (video)]]. - [[https://egghead.io/lessons/react-applying-basic-styles-in-react-native][Applying Basic Styles in React Native]]. - [[https://twitter.com/floydophone/status/649786438330945536][Avoid premature fluxing]]. - [[https://github.com/enaqx/awesome-react/][Awesome React: a collection of awesome things regarding React ecosystem]]. - [[https://github.com/babel/babel-eslint][babel-eslint]]. - [[https://medium.com/infinite-red/beginner-s-guide-to-using-cocoapods-with-react-native-46cb4d372995#.i87ebbwl0][Beginner’s Guide to Using CocoaPods with React Native]]. - [[https://medium.com/delivery-com-engineering/react-native-in-an-existing-ios-app-delivered-874ba95a3c52#.kin2ke23s][Beyong React Native's "getting started guide"]]. - [[http://blog.bonnieeisenman.com/][Bonnie Eisenman's blog (some react)]]. - [[https://corbt.com/posts/2015/12/22/breaking-up-heavy-processing-in-react-native.html][Breaking up Heavy Processing in React Native (Blog post)]]. - [[https://www.youtube.com/watch?v=cI9bDvDEsYE][Brent Vatne - Building li.st for Android with Exponent and React Native at react-europe 2016]]. - [[http://tadeuzagallo.com/blog/react-native-bridge/][Bridging in React Native: An in-depth look into React Native's core]]. - [[http://tech.taskrabbit.com/blog/2015/10/18/building-react-native-apps/][Building React Native Apps]]. - [[http://makeitopen.com/tutorials/building-the-f8-app][Bulding the F8 app]]. - [[https://github.com/adamterlson/cairn][Cairn: a tiny library for React Native replacing default styling syntax]]. - [[https://medium.com/the-exponent-log/coding-apps-with-react-native-at-exponent-7a5922da27bf#.udrk6kz05][Coding Apps with React Native at Exponent]]. - [[http://codewinds.com/blog/2015-04-02-emacs-flycheck-eslint-jsx.html][Configuring Emacs to use eslint and babel with flycheck for javascript and React.js JSX]]. - [[https://github.com/markerikson/react-redux-links][Curated tutorial and resource links I've collected on React, Redux, ES6, and more]]. - [[https://www.youtube.com/watch?v=xsSnOQynTHs][Dan Abramov - Live React: Hot Reloading with Time Travel at react-europe 2015]]. - [[https://medium.com/@shaheenghiassy/deep-diving-react-native-debugging-ea406ed3a691][Deep Diving React Native Debugging]]. - [[http://ilikekillnerds.com/2015/02/developing-react-js-components-using-es6/][Developing React.js Components Using ES6]]. - [[https://github.com/rebeccahughes/react-native-device-info][Device Information for React Native iOS and Android]]. - [[https://engineering.hexacta.com/didact-learning-how-react-works-by-building-it-from-scratch-51007984e5c5][Didact: a DIY guide to build your own React – Hexacta Engineering]]. - [[http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/][ECMAScript 5 Strict Mode, JSON, and More]]. - [[https://github.com/Intellicode/eslint-plugin-react-native][ESLint plugin for React Native]]. - [[https://github.com/gcazaciuc/eslint-plugin-flowtype][eslint-plugin-flowtype]]. - [[https://exponentjs.com/][Exponentjs]]. - [[https://github.com/coodoo/flowery][Flowery: prettifies the result generated by Facebook Flow]]. - [[http://blog.krawaller.se/img/flux-diagram.png][Flux diagram]]. - [[https://egghead.io/series/getting-started-with-redux][Getting Started with Redux (30 lessons)]]. - [[https://gist.github.com/joshdover/235714771d94509a83609b16d232014a][Idiomatic React Testing Patterns]]. - [[https://github.com/facebook/react-native/commit/1303e6d0392e8bc4da1198c98fc8cd7ad488b81c][Implement XHR timeout for Android and IOS natively]]. - [[https://github.com/facebook/react-native/commit/e4c53c28aea7e067e48f5c8c0100c7cafc031b06][Improved shadow performance on iOS]]. - [[https://news.ycombinator.com/item?id=11093275][Learn Raw React – No JSX, No Flux, No ES6, No Webpack (Hacker News)]]. - [[https://github.com/DianQK/LearnRxSwift/blob/master/README.md][LearnRxSwift]]. - [[https://github.com/facebook/react-native/issues/499#issuecomment-128836161][ListView rendering issue]]. - [[https://github.com/marcshilling/react-native-image-picker][Native image/photo picker for react native]]. - [[https://www.youtube.com/watch?v=dOSwHABLvdM][Native react navigation in every platform]]. - [[https://github.com/geirman/offlineMovies][OfflineMovies: retrieves movies from an api and caches the result offline]]. - [[https://corbt.com/posts/2015/09/16/one-day-with-react-native-for-android.html][One day with React Native for Android]]. - [[https://www.youtube.com/watch?v%3Dfh_Y4mPivuM][Optimizing React Native views (Screencast)]]. - [[https://www.youtube.com/watch?v=fh_Y4mPivuM][Optimizing React Native views (Screencast)]]. - [[https://facebook.github.io/react/docs/context.html][Passing info automatically through a tree]]. - [[https://medium.com/@sharathprabhal/progressive-image-loading-in-react-native-ecc88e724343#.ffudiaxf3][Progressive image loading]]. - [[http://reactscript.com/categories/layout/][React and React Native Layout Components - ReactScript]]. - [[https://github.com/kriasoft/react-component-starter][React Component Starter Kit]]. - [[http://iamdustan.com/2016/01/18/react-custom-renderers/][React Custom Renderers (Blog post)]]. - [[https://facebook.github.io/react/contributing/design-principles.html][React Design Principles]]. - [[https://github.com/naoufal/react-native-accordion][React Native accordion]]. - [[https://github.com/mastermoo/react-native-action-button][React Native action button]]. - [[https://medium.com/react-weekly/react-native-and-typescript-ad57b7413ead#.w5lky7jol][React Native and Typescript]]. - [[http://browniefed.com/blog/2015/08/01/react-native-animated-listview-row-swipe/][React Native Animated ScrollView Row Swipe Actions]]. - [[http://zaicheng.me/2016/06/20/react-native-initial-setup/][React Native App initial setup]]. - [[https://medium.com/delivery-com-engineering/react-native-in-an-existing-ios-app-dynamic-routing-7013e03fa9ad#.cyv7v7oez][React Native in an Existing iOS App: Dynamic Routing]]. - [[https://github.com/ericvicenti/react-native-community/][React Native in the Github Community]]. - [[http://moduscreate.com/react-native-layout-system/][React Native Layout System]]. - [[https://github.com/lelandrichardson/react-native-maps][React Native Mapview component for iOS + Android]]. - [[https://github.com/react-native-material-design/react-native-material-design][React Native Material Design (react-native-material-design)]]. - [[https://github.com/xinthink/react-native-material-kit][React Native Material Design (xinthink)]]. - [[http://us10.campaign-archive2.com/?u%3Ddb0dd948e2b729ee62625b1a8&id%3Dfbfe8b6010&e%3Dc7b5ce9f56][React Native Newsletter - Issue #24]]. - [[http://us10.campaign-archive2.com/?u%3Ddb0dd948e2b729ee62625b1a8&id%3D674b414994&e%3Dc7b5ce9f56][React Native Newsletter - Issue #25]]. - [[https://github.com/rnpm/rnpm][React Native Package Manager (rnpn)]]. - [[https://rnplay.org/][React Native Playground]]. - [[http://npm.taobao.org/package/react-native-scrollable-decorator][React Native scrollable decorator]]. - [[https://github.com/marty-wang/react-native-toolkit][React Native Toolkit (navigation examples)]]. - [[http://www.raywenderlich.com/99473/introducing-react-native-building-apps-javascript][React Native Tutorial: Building Apps with JavaScript]]. - [[https://medium.com/@Jpoliachik/react-native-s-layoutanimation-is-awesome-4a4d317afd3e#.97zx978rl][React Native’s LayoutAnimation is Awesome]]. - [[http://aeflash.com/2015-02/react-tips-and-best-practices.html][React Tips and Best Practices]]. - [[https://news.ycombinator.com/item?id=14144142][React-Move – Animate anything in React (Hacker News)]]. - [[https://github.com/lwansbrough/react-native-camera][react-native-camera: A Camera component for React Native]]. - [[https://github.com/aksonov/react-native-redux-router][react-native-redux-router (replace push/pop screens with easy syntax)]]. - [[http://www.reactjsprogram.com/][React.js Program: A project based, linear approach to learning React.js and the React.js ecosystem]]. - [[https://react.parts/native][react.parts/native feed]]. - [[https://www.youtube.com/watch?v=dwP1TNXE6fc][Reactive Programming Overview]]. - [[https://github.com/aerofs/react-native-auto-updater][ReactNativeAutoUpdater]]. - [[https://github.com/rackt/redux][Redux: Predictable state container for JavaScript apps]]. - [[http://jlongster.com/Removing-User-Interface-Complexity,-or-Why-React-is-Awesome][Removing User Interface Complexity, or Why React is Awesome]]. - [[https://medium.com/@elieslama/responsive-design-in-react-native-876ea9cd72a8#.cjpedynak][Responsive Design in React Native]]. - [[https://rnplay.org/][rnplay.org: Test and share React Native code samples]]. - [[https://github.com/bartonhammond/snowflake][Snowflake (React iOS/Android + Redux + Jest testable + parse.com + bitrise.io)]]. - [[http://hharnisc.github.io/2015/04/15/react-native-and-meteor.html][Some Thoughts On Gluing React Native and Meteor (Blog post)]]. - [[http://www.schibsted.pl/2015/10/testing-react-native-components-with-jest/][Testing react Native with jest]]. - [[https://www.firebase.com/blog/2016-01-20-tutorial-firebase-react-native.html][The beginners guide to React Native and Firebase (Blog post)]]. - [[https://medium.com/swlh/the-case-for-flux-379b7d1982c6#.109lf7s2a][The Case for Flux]]. - [[https://github.com/Reactive-Extensions/RxJS][The Reactive Extensions for JavaScript]]. - [[http://www.reactivemanifesto.org/][The reactive manifesto]]. - [[https://facebook.github.io/react/docs/thinking-in-react.html][Thinking in React]]. - [[https://getsiphon.com/blog/2016/01/20/future-of-app-development/][Thoughts on the future of mobile app development (Blog post)]]. - [[https://medium.com/the-react-native-log/tips-for-styling-your-react-native-apps-3f61608655eb#.tg2qh13vd][Tips for styling your React Native apps]]. - [[http://stanleycyang.github.io/technology/reactjs/native/ios/2015/10/04/react-native-tutorial-with-navigation-and-animation.html][Tutorial: Handcrafting an iOS Application with React Native (and lots of love)]]. - [[https://medium.com/@jcfrancisco/unit-testing-react-native-components-a-firsthand-guide-cea561df242b#.arff9dygw][Unit Testing React Native Components: A Firsthand Guide]]. - [[https://medium.com/infinite-red/using-redux-saga-to-simplify-your-growing-react-native-codebase-2b8036f650de#.382a5inf8][Using redux-saga To Simplify Your Growing React Native Codebase]]. - [[https://medium.com/shoutem/ways-to-pass-objects-between-native-and-javascript-in-react-native-c3dcae7bf4f5][Ways to pass objects between native and JavaScript in React Native]]. - [[http://blog.zmxv.com/2015/09/what-i-learned-from-building-react.html][What I learned from building with React]]. - [[https://www.youtube.com/watch?v=QQRDcYsN4xs][Why React Native is Better than Native for Your Mobile Application]]. - [[http://addyosmani.com/writing-modular-js/][Writing Modular JavaScript With AMD, CommonJS & ES Harmony]]. - [[https://github.com/johnmastro/react-snippets.el][Yasnippets for React]]. * [2015-09-16 Wed] Chinese rice vinegar :PROPERTIES: :CUSTOM_ID: chinese-rice-vinegar :END: Note to self to buy [[http://www.amazon.co.uk/dp/B00OG3L7N6/ref%3Dsr_1_1?ie%3DUTF8&qid%3D1442442376&sr%3D8-1&][Gold Plum Chinkiang Vinegar]]. Awesome with dim sum. [[file:images/chinese-rice-vinegar/chinkiang-vinegar.jpg]] * [2015-09-13 Sun] Use ImageMagick to batch-resize images :PROPERTIES: :CUSTOM_ID: use-imagemagick-to-batch-resize-images :END: Using percentage: #+BEGIN_SRC sh $ mogrify -resize 10% *.png #+END_SRC Using dimensions: #+BEGIN_SRC sh $ mogrify -resize 120x120 *.png #+END_SRC Lots of other alternatives from ImageMagick's [[http://www.imagemagick.org/script/command-line-processing.php#geometry][documentation]]: | -resize | scale% | | -resize | scale-x%xscale-y% | | -resize | width | | -resize | xheight | | -resize | widthxheight | | -resize | widthxheight^ | | -resize | widthxheight! | | -resize | widthxheight> | | -resize | widthxheight< | | -resize | area@ | Fix image aspect ratios for Instagram: #+BEGIN_SRC sh $ mogrify -resize 1080x1350 -gravity center -extent 1080 *.jpg #+END_SRC * [2015-09-08 Tue] Lucky 7 review :PROPERTIES: :CUSTOM_ID: lucky-7-review :END: ** Recommended? yep [[http://www.lucky7london.co.uk][Lucky 7]] is a small nostalgic American diner on Westbourne Park road. I like the vibe, the space, and the unpretentious waiting staff. I go to Lucky 7 often enough, originally for the buttermilk pancakes, but the list of favorites on the menu keeps growing. [[file:images/lucky-7-review/lucky-7-menu-board.jpg]] [[file:images/lucky-7-review/lucky-7-staff.jpg]] Smileys by [[https://openclipart.org/detail/219291/smile][w.dyer]]. ** Buttermilk Banana pancakes These are my favorite pancakes in London by far. Banana buttermilk pancakes and a few free coffee refills usually sort me out until dinner time. Add a side of bacon if extra hungry. You probably don't need it though. [[file:images/lucky-7-review/lucky-7-coffee.jpg]] [[file:images/lucky-7-review/lucky-7-pancakes.jpg]] ** Reuben sandwich The reuben has been on Lucky 7's specials menu for months now. Not had many of these in London, but compared to The Brass Rail's, this reuben was a clear winner. The sandwich is huge and comes with fries. My girlfriend and I struggled to finish one between the two of us. file:images/lucky-7-review/lucky-7-reuben-fries.jpg file:images/lucky-7-review/lucky-7-reuben-cross-section.jpg ** Vanilla milkshake (add malt!) This milkshake hits the spot every time, but it's filling. You almost have to decide between the shake and an actual meal. If you must have it, add malt. Sorry, no picture. ** Huevos Rancheros This is a breakfast dish I can equally make (better?) at home, but Lucky 7 wins hands down every time I'm feeling particularly lazy. Sorry, no picture. ** Useful? Was this post useful to you? do [[https://twitter.com/xenodium/status/643139264302186497][reply]]! ** Better suggestion? London is full of overhyped, gimmicky, and unnecessarily expensive restaurants. Very few deliver truly awesome food (even those expensive ones). Got suggestions? I'd love to hear from you [[https://twitter.com/xenodium][@xenodium]]. * [2015-09-02 Wed] Sierra Leone travel bookmarks :PROPERTIES: :CUSTOM_ID: sierra-leone-travel-bookmarks :END: - [[http://www.sierraleonemarathon.com/][Sierra Leone marathon]]. - [[http://www.street-child.co.uk/][Street Child charity]]. * [2015-09-02 Wed] London travel bookmarks :PROPERTIES: :CUSTOM_ID: london-travel-bookmarks :END: :MODIFIED: [2020-01-19 Sun] :END: - [[http://www.chgt.org.uk][Chiswick House & Gardens]]. - [[https://www.heathrobinsonmuseum.org][Heath Robinson Museum]]. - [[http://www.londonlibrary.co.uk/][London Library (book your free tour)]]. - [[https://en.wikipedia.org/wiki/Quaker_Gardens,_Islington][Quaker gardens]], Islington. - [[http://www.sohotheatre.com/][Soho Theatre]] (not tried yet). - [[https://www.cntraveller.com/gallery/best-brunch-london][The best brunch London 2020 | CN Traveller]]. - [[https://www.cntraveller.com/gallery/the-most-beautiful-restaurants-in-london][The most beautiful restaurants in London for 2020 | CN Traveller]]. * [2015-08-23 Sun] Use ImageMagick to auto-orient images :PROPERTIES: :CUSTOM_ID: use-imagemagick-to-auto-orient-images :END: Recently needed to rotate images based on EXIF metadata. ImageMagick to the rescue: #+BEGIN_SRC sh $ for i in *.png; do convert -auto-orient "$i" "$i"; done #+END_SRC * [2015-08-23 Sun] Bengali Macher Jhol :PROPERTIES: :CUSTOM_ID: bengali-macher-jhol :END: My friend Sakhya brought me the wonderful [[http://www.nitamehta.com/Cookbook-of-Regional-Cuisines-of-India-%2528Veg-%2B-Non-Veg%2529_431.html][Cookbook of Regional Cuisines of India]]. After improvisations and substitutions, here's my attempt at making Bengali Machcher Jhol: [[file:images/bengali-machcher-jhol/bengali-machcher-jhol-00.png]] [[file:images/bengali-machcher-jhol/bengali-machcher-jhol-01.png]] [[file:images/bengali-machcher-jhol/bengali-machcher-jhol-02.png]] [[file:images/bengali-machcher-jhol/bengali-machcher-jhol-03.png]] [[file:images/bengali-machcher-jhol/bengali-machcher-jhol-04.png]] [[file:images/bengali-machcher-jhol/bengali-machcher-jhol-05.png]] * [2015-08-22 Sat] New habits for 2015 :PROPERTIES: :CUSTOM_ID: new-habits-for-2015 :END: - 20 min morning meditations. - [[http://www.ted.com/talks/terry_moore_how_to_tie_your_shoes][A better way to tie your shoes]]. - Cold showers (all of them!). - Keys, wallet, phone, badge, and headphones live together. - Listen to audio books. - Morning runs. - Nightly flossing. * [2015-08-22 Sat] Meditation retreats bookmarks :PROPERTIES: :CUSTOM_ID: meditation-retreats-bookmarks :END: :MODIFIED: [2020-08-02 Sun] :END: - [[http://www.lonelyplanet.com/travel-tips-and-articles/best-places-to-seek-silence][Best places to seek silence]]. - [[http://www.dhanakosa.com/retreat/2015/opening-life-0][Opening to life @ Dhanakosa Buddhist Retreat Centre]]. - [[http://www.samyeling.org/][Samye Ling (Tibetan- buddhist monastery)]]. - [[https://www.dhamma.org/en-US/index][Vipassana Meditation (centers across world)]]. * [2018-07-08 Sun] Human memory bookmarks :PROPERTIES: :CUSTOM_ID: human-memory-bookmarks :END: :MODIFIED: [2020-03-11 Wed] :END: - [[http://augmentingcognition.com/ltm.html][Augmenting Long-term Memory (Michael Nielsen)]]. - [[http://www.ludism.org/mentat/][Ludism's memory techniques]]. - [[https://news.ycombinator.com/item?id=22492381][Using Anki to remember what you read | Hacker News]]. - [[https://news.ycombinator.com/item?id=22492381][Using Anki to remember what you read | Hacker News]]. * [2015-08-22 Sat] Mindfulness/meditation bookmarks :PROPERTIES: :CUSTOM_ID: meditation-bookmarks :END: :MODIFIED: [2023-05-08 Mon] :END: - [[https://www.10percenthappier.com/][10% Happier: Mindfulness Meditation Courses with Dan Harris and Joseph Goldstein]]. - [[https://en.wikipedia.org/wiki/Aimless_wandering][Aimless Wandering]]. - [[http://www.nytimes.com/2016/06/05/opinion/sunday/are-you-in-despair-thats-good.html][Are You in Despair? That’s Good (NY Times)]]. - [[http://lesswrong.com/lw/3w3/how_to_beat_procrastination/][Beating procrastination]]. - [[http://theenergyproject.com/blog/take-back-your-life-ten-steps][Best 10 life changes]]. - [[https://www.drweil.com/health-wellness/body-mind-spirit/stress-anxiety/breathing-three-exercises/][Breathing Exercise: Three To Try | 4-7-8 Breath (Andrew Weil, M.D.)]]. - [[http://theoryengine.org/life/contemplative-practice-that-isnt-meditating/][Contemplative Practice That Isn’t Meditating]]. - [[https://dayoneapp.com/][Day One - The award-winning journal app for iPhone, iPad, and Mac.]]. - [[https://www.youtube.com/watch?v%3DZ8LOhZmuVaE&feature%3Dyoutu.be][Developing Lotus Flexibility - Preparing Yoga Padmasana Sitting Position, part 1 (YouTube)]]. - [[http://franticworld.com/free-meditations-from-mindfulness/][Free meditations from Mindfulness | Mindfulness: Finding Peace in a Frantic World]]. - [[https://hbr.org/2014/02/how-to-make-yourself-work-when-you-just-dont-want-to/][How to Make Yourself Work When You Just Don’t Want To]]. - [[http://www.tricycle.com/blog/how-sit-zen-and-stretching-excercises-full-lotus][How to sit Zen]]. - [[http://jonathanfoust.libsyn.com/webpage][Jonathan Foust's talks]]. - [[http://buddhistinspiration.blogspot.com/2011/12/well-see-zen-story.html][Kalyanamittas: We'll See - A Zen Story]]. - [[http://www.theguardian.com/lifeandstyle/2011/jan/22/meditation-centres-uk][Meditation centres around the UK]]. - [[https://twitter.com/g_s_bhogal/status/1225561131122597896][MEGATHREAD TIME: In 40 tweets I will describe 40 power powerful concepts for understanding the world]]. - [[http://www.memrise.com/blog/][Memreise's blog]]. - [[https://medium.com/@yegg/mental-models-i-find-repeatedly-useful-936f1cc405d][Mental Models I Find Repeatedly Useful - Gabriel Weinberg (Medium)]]. - [[https://medium.com/@yegg/mental-models-i-find-repeatedly-useful-936f1cc405d#.g0gjbdp8z][Mental Models I Find Repeatedly Useful]]. - [[https://www.mindbodyattention.com/][Mind Body Attention — thinking, moving, and meditating]]. - [[https://thebuddhistcentre.com/text/mindfulness-breathing][Mindfulness breathing]]. - [[https://hbr.org/2014/12/mindfulness-mitigates-biases-you-may-not-know-you-have][Mindfulness Mitigates Biases You May Not Know You Have]]. - [[https://www.youtube.com/watch][Nam Myoho Renge Kyo]]. - [[https://news.ycombinator.com/item?id=21861986][Ram Dass has died (Hacker News)]]. - [[https://www.smilingmind.com.au/smiling-mind-app][Smiling Mind free apps]]. - [[https://news.ycombinator.com/item?id=13019767][The Challenge of Consciousness (Hacker News)]]. - [[https://news.ycombinator.com/item?id=21036927][The effect of meditation on brain structure (2012) | Hacker News]]. - [[http://theenergyproject.com/blog][The Energy Project blog]]. * [2015-08-22 Sat] Learning bookmarks :PROPERTIES: :CUSTOM_ID: learning-bookmarks :END: :MODIFIED: [2016-12-10 Sat] :END: - [[http://www.quora.com/What-are-the-best-YouTube-channels-for-learning-growth-and-development][Best YouTube channels for learning (Quora)]]. - [[https://www.supermemo.com/en/articles/20rules][Effective learning: Twenty rules of formulating knowledge]]. - [[https://news.ycombinator.com/item?id=7826745][HN's comments on learning languages]]. - [[https://news.ycombinator.com/item?id=6522901][HN's comments on memory]]. - [[http://fourhourworkweek.com/2012/12/11/how-to-play-the-guitar/][How to Finally Play the Guitar: 80/20 Guitar and Minimalist Music]]. - [[http://betterexplained.com/articles/adept-method/][Learn Difficult Concepts with the ADEPT Method]]. - [[https://www.youtube.com/playlist?list=PL2FF649D0C4407B30][Learning to learn]]. - [[http://betterexplained.com/articles/intuition-isnt-optional/][Learning to Learn: Intuition Isn’t Optional | BetterExplained]]. - [[http://fourhourworkweek.com/2009/07/30/speed-reading-and-accelerated-learning/][Scientific Speed Reading: How to Read 300% Faster in 20 Minutes]]. * [2015-08-22 Sat] Bundi travel bookmarks :PROPERTIES: :CUSTOM_ID: bundi-travel-bookmarks :END: - Bundi Haveli (accomodation). - Hadoti Palace (accomodation). - Haveli Braj Bhushan Ji ki (accomodation). - Haveli Katkoun Guest House (accomodation). - Kasera Paradise (accomodation). * [2015-08-14 Fri] Upgrading PL30 headphones :PROPERTIES: :CUSTOM_ID: upgrading-pl30-headphones :END: I've loved my [[http://www.amazon.com/Soundmagic-PL30-In-Ear-Headphones/dp/B001MQ3CCO][Soundmagic PL30 in-ear headphones]]. They're relatively inexpensive, comfortable, and great for exercising (they stay in). Audio quality and bass have been good enough (I don't need much). Unfortunately, I've had two pairs of PL30's and both stopped working after a year or two. I'm replacing the last pair with [[http://www.amazon.co.uk/RHA-MA750-Isolating-In-Ear-Headphone-Black/dp/B00ELAM8LE][RHA's MA750]] (an upgrade, me hopes). Other contenders considered: [[http://www.amazon.co.uk/Etymotic-Research-Portable-iPhone-Earphones-Black/dp/B000XPG2QI][Etymotic Research HF5]], and [[http://www.amazon.co.uk/Shure-SE215-In-Ear-Isolating-Earphones-Clear/dp/B004U9NH3E][Shure SE215]]. Also considered bluetooth alternatives like [[http://www.amazon.com/JayBird-BlueBuds-Sport-Bluetooth-Headphones/dp/B00AIRUOI8?][JayBird BlueBuds X]] and [[http://www.amazon.co.uk/Plantronics-BackBeat-Wireless-Earbuds-Frustration-Black/dp/B00DZTHW9U][Plantronics BackBeat GO 2]]. I'm somewhat nervous to pay more for a pair of headphones. Let's hope they don't meet the same unfortunate fate. We'll see. * [2015-08-13 Thu] Quotes :PROPERTIES: :CUSTOM_ID: quotes :END: - [[https://twitter.com/stevemagness/status/633778359156125696?refsrc%3Demail&s%3D11]["Being good at something is about being curious enough to explore things to a level where most people give up."]] - "The world is a book and those who do not travel read only one page." - Augustine of Hippo. - "National identity is not your only identity." - Xiaolu Guo? - [[https://news.ycombinator.com/item?id=27696310]["Choose your words carefully. Words are cheap, but their effect can be expensive."]] * [2015-08-13 Thu] Bhutan travel bookmarks :PROPERTIES: :CUSTOM_ID: bhutan-travel-bookmarks :END: - [[http://www.tigersnestbhutan.com/][Taktsang (Tiger’s Nest) Monastery]]. * [2015-08-12 Wed] Cooking bookmarks :PROPERTIES: :CUSTOM_ID: cooking-bookmarks :END: :MODIFIED: [2020-12-23 Wed] :END: - [[https://food.ndtv.com/lists/10-best-indian-breakfast-recipes-696080][14 Best Indian Breakfast Recipes | Easy Indian Breakfast Recipes - NDTV Food]]. - [[http://drinks.seriouseats.com/2013/05/25-essential-cocktails-everyone-should-know-cocktail-101-easy-mixed-drink-recipes-classic-cocktail-guide.html][25 Cocktails Everyone Should Know]]. - [[https://www.amazon.com/Taylor-Precision-Products-Stainless-11-Pound/dp/B002SXV8G2/ref=sr_1_1?s=home-garden&ie=UTF8&qid=1481553229&sr=1-1-spons&keywords=Taylor+Precision+stainless+steel&psc=1][Amazon.com: Taylor Precision Products Stainless Steel Kitchen Scale]]. - [[https://www.seriouseats.com/recipes/2012/07/basic-new-york-style-pizza-dough.html][Basic New York-Style Pizza Dough Recipe | Serious Eats]]. - [[http://www.world-of-crepes.com/cast-iron-fry-pans.html][Cast Iron Fry Pans]]. - [[https://www.quora.com/How-is-authentic-fried-rice-prepared/answer/ChienLing-Koo-1/share][ChienLing Koo's answer to How is authentic fried rice prepared? (Quora)]]. - [[https://cooking.nytimes.com/recipes/1018717-eggs-kejriwal][Eggs Kejriwal Recipe - NYT Cooking]]. - [[https://www.youtube.com/watch?v=-suTmUX4Vbk][Equipment Review: Best Carbon-Steel Skillets (YouTube)]]. - [[http://www.seriouseats.com/2010/06/how-to-buy-season-clean-maintain-cast-iron-pans.html][Equipment: How to Buy, Season, and Maintain Cast Iron Cookware]]. - [[https://www.quora.com/How-do-Chinese-restaurants-get-their-beef-to-be-so-tender-Like-beef-in-black-bean-sauce-or-Mongolian-beef-etc-It-almost-falls-apart-in-the-mouth][How do Chinese restaurants get their beef to be so tender?]]. - [[https://www.youtube.com/watch?v=KLGSLCaksdY#action=share][How To Cook With Cast Iron (YouTube)]]. - [[https://getpocket.com/explore/item/how-to-make-french-onion-soup][How To Make French Onion Soup]]. - [[https://www.amazon.co.uk/Imperia-Italian-Double-Cutter-Machine/dp/B0001IXA0I][Imperia Italian Double Cutter Pasta Machine]]. - [[https://www.digitaltrends.com/home/steaming-hard-boiled-eggs/][It's Not Rocket Science, Steaming Hard-Boiled Eggs Makes Peeling Easier (Digital trends)]]. - [[http://www.varasanos.com/PizzaRecipe.htm][Jeff Varasano's NY Pizza Recipe]]. - [[https://www.amazon.co.uk/Marcato-machine-Chrome-Silver-Wellness/dp/B0009U5OSO/][Marcato Atlas 150 pasta machine Chrome, Silver Wellness]]. - [[https://www.thecuriouschickpea.com/masoor-dal-tadka/][Masoor Dal Tadka - Indian Red Lentil Dal]]. - [[http://ohsheglows.com/2013/01/24/my-favourite-homemade-almond-milk-step-by-step-photos/][My Favourite Homemade Almond Milk + Step By Step Photos]]. - [[http://cooking.nytimes.com/][New York Times cooking]]. - [[http://www.womenshealthmag.co.uk/nutrition/recipes/2321/pho-tai-lan-hanoi-style-flash-fried-steak-garlic-soup/][Pho Tai Lan (Hanoi style flash-fried steak & garlic soup)]]. - [[https://www.pizzamaking.com/pizza-recipes.html][Pizza Recipes - PizzaMaking.com]]. - [[https://www.portlandfarmersmarket.org/cookbook/][Portland Farmers Market » Cookbook]]. - [[https://www.fixfeastflair.com/home/2015/2/9/swedish-cardamom-rolls-kardemummabullar-recipe][Swedish Cardamom Rolls (Kardemummabullar) — Fix Feast Flair]]. - [[http://www.amazon.com/The-Ringer-Cleaner-Stainless-Chainmail/dp/B00FKBR1ZG][The Ringer Cast Iron Cleaner XL 8x6 Inch Stainless Steel Chainmail (Amazon)]]. - [[http://www.seriouseats.com/2014/11/the-truth-about-cast-iron.html][The Truth About Cast Iron Pans: 7 Myths That Need To Go Away]]. - [[http://www.cooksillustrated.com/how_tos/5820-the-ultimate-way-to-season-cast-iron][The ultimate way to season cast iron]]. - [[https://www.quora.com/Why-do-steaks-at-high-end-restaurants-taste-so-different-from-other-steaks][Why do steaks at high end restaurants taste so different from other steaks? (Quora)]]. * [2015-08-11 Tue] 9 week half-marathon training :PROPERTIES: :CUSTOM_ID: 9-week-half-marathon-training :END: While reading [[https://zenhabitsbook.s3.amazonaws.com/Zen%2520Habits%2520book.pdf][Zen Habits: Mastering the Art of Change]], I comitted to running half marathon in mid-October. That's roughly two months from now. Here's a 9 week training schedule: | WEEK | MON | TUE | WED | THU | FRI | SAT | SUN | |------+------+------+------+-------+------+------+-------| | 1 | Rest | 5 Km | 5 Km | Cycle | Rest | 5 Km | 7 Km | | 2 | Rest | 5 Km | 5 Km | Cycle | Rest | 5 Km | 8 Km | | 3 | Rest | 7 Km | 5 Km | Cycle | Rest | 5 Km | 10 Km | | 4 | Rest | 8 Km | 5 Km | Cycle | Rest | 5 Km | 12 Km | | 5 | Rest | 8 Km | Rest | 8 Km | Rest | 5 Km | 14 Km | | 6 | Rest | 8 Km | Rest | 8 Km | Rest | 6 Km | 16 Km | | 7 | Rest | 8 Km | 8 Km | 8 Km | Rest | 8 Km | 19 Km | | 8 | Rest | 8 Km | Rest | 12 Km | Rest | 8 Km | 16 Km | | 9 | Rest | 8 Km | Rest | 5 Km | 5 Km | Rest | Race | |------+------+------+------+-------+------+------+-------| My times: | WEEK | MON | TUE | WED | THU | FRI | SAT | SUN | |------+------+-------+-------+-------------+-------+-------+---------| | 1 | Rest | ✘ | 29:04 | ✔ | Rest | 26:36 | 38:40 | | 2 | Rest | 29:11 | 28:50 | ✔ | Rest | 27:07 | 44:55 | | 3 | Rest | 40:46 | 26:29 | ✔ | Rest | ✘ | 57:01 | | 4 | Rest | 46:46 | ✘ | ✘ | Rest | 30:08 | 1:12:10 | | 5 | Rest | 46:59 | Rest | 44:46 | Rest | 24:50 | 1:25:24 | | 6 | Rest | 50:02 | Rest | 46:24 | Rest | ✘ | 1:37:39 | | 7 | Rest | 46:54 | 46:41 | 46:42 | Rest | ✘ | 1:57:57 | | 8 | Rest | 45:28 | Rest | 48:13 (8km) | Rest | 43:56 | ✘ | | 9 | Rest | 44:24 | Rest | 27:12 | 26:09 | Rest | 1:58:28 | |------+------+-------+-------+-------------+-------+-------+---------| * [2015-08-11 Tue] Shanghai travel bookmarks :PROPERTIES: :CUSTOM_ID: shanghai-travel-bookmarks :END: :MODIFIED: [2015-11-29 Sun] :END: - [[http://www.nytimes.com/2013/12/01/travel/36-hours-in-shanghai.html][36 Hours in Shanghai]]. - Shanghai Xiaolongbao at [[http://www.yelp.com/biz/shanghai-dumpling-house-edison-2][Dumpling House Edison (on Rt 27)]]. - [[https://goo.gl/maps/FQmSF][Tianzi Fang street art (Google maps)]]. - [[http://tianzifang.cn/][Tianzi Fang street art]]. - [[https://goo.gl/maps/Ngqwk][Town God's Temple]], street Food! - [[https://en.wikipedia.org/wiki/Yu_Garden][Yu Garden/Huxinting Teahouse]]. - 佳家 for 小龙包. - 小样 (Little Yang's) for 生煎包 (sheng jian bao). Fried soup filled dumplings. Think skin crunchy bottom texture. * [2015-08-10 Mon] Singapore job board bookmarks :PROPERTIES: :CUSTOM_ID: singapore-job-board-bookmarks :END: :MODIFIED: [2015-08-10 Mon] :END: - [[https://angel.co/singapore/jobs][Angel.co (Singapore Startup Jobs)]]. - [[http://e27.co/jobs][e27]]. - [[http://www.startupjobs.asia/][Startupjobs.asia]]. - [[https://twitter.com/NataliePis/status/1130811744027316224][Those who relocated to Europe for a tech position: where did you find your job?]]. * [2015-08-08 Sat] Germany travel bookmarks :PROPERTIES: :CUSTOM_ID: germany-travel-bookmarks :END: :MODIFIED: [2020-04-10 Fri] :END: - [[https://en.wikipedia.org/wiki/Azalea_and_Rhododendron_Park_Kromlau][Azalea and Rhododendron Park Kromlau]]. - [[https://zerokspot.com/weblog/2020/04/05/post-lockdown-bucketlist/][Having a post-lockdown bucket list - zerokspot.com]]. - [[http://www.7stern.at/de-de/][Home - 7STERN Bräu]]. - [[https://kerriescupoftea.blogspot.co.uk/2014/10/lai-fufu-in-munich-germany.html][Kerrie's Cup of Tea: lai fufu in Munich Germany]]. - [[https://www.laifufu.de/][Laifufu Teesalon - Teezeremonie - Tee - Oolong - München - Laifufu Teesalon]]. - [[https://www.sudhaus.at/][SUDHAUS — Brauerei & Restaurant (try beef tartar. also pizza?)]]. * [2015-08-08 Sat] Menorca travel bookmarks :PROPERTIES: :CUSTOM_ID: menorca-travel-bookmarks :END: - [[https://www.flickr.com/photos/paul_stephenson/4282369223/][Cala Macarella, Menorca]]. - [[https://en.wikipedia.org/wiki/Punta_Nati_Lighthouse][Punta Nati]]. - [[http://www.lonelyplanet.com/spain/balearic-islands/menorca/activities/driving-offroading/scooter-rental-menorca][Scooter rental in Menorca]]. * [2015-08-08 Sat] Travel tools bookmarks :PROPERTIES: :CUSTOM_ID: travel-tools-bookmarks :END: :MODIFIED: [2019-01-04 Fri] :END: - [[http://www.cool-cities.com/][Cool cities, a visual city guide]]. - [[https://www.producthunt.com/tech/detour-2-0][Detour 2.0]]. - [[https://play.google.com/store/apps/details?id%3Dco.dojoapp.dojo&hl%3Den_GB][Dojo: Best stuff to do in London]]. - [[http://www.escapethecity.org][escapethecity.org]]. - [[https://everplaces.com][Find the best places to sleep, eat and play]]. - [[http://www.hostelworld.com][hostelworld.com]]. - [[http://ezroadtrips.com/blogs/2015/03/How-To-Travel-The-World-Without-Money.html][How to travel the world without money]]. - [[https://indie.bootsnall.com/][Indie: a simple, powerful way to buy multi-stop flights]]. - [[http://app.internationalsos.com][International SOS Assistance App]]. - [[https://izi.travel/en][IziTravel: audio guides and city/museum tours]]. - [[http://www.jetsetter.com][Jet Setter]]. - [[http://us.louisvuitton.com/eng-us/men/books/city-guides][Louis Vuitton city guide]]. - [[http://mapiac.com/travel-map/][Mapiac: discover hidden wonders]]. - [[http://www.roadsharing.com][roadsharing.com]]. - [[https://tripcast.co/][Tripcast]]. - [[https://www.triposo.com/][Triposo]]. - [[https://www.vayable.com/][Vayable (find a new experience)]]. - [[https://www.visahq.com/citizens/][Visa Requirements by Citizenship]]. - [[https://www.quora.com/What-is-the-best-website-or-app-to-use-for-trip-planning-and-why][What is the best website or app to use for trip planning, and why? (Quora)]]. - [[https://www.quora.com/What-travel-hacks-have-saved-you-a-lot-of-money][What travel hacks have saved you a lot of money? (Quora)]]. - [[http://www.wwoof.net][wwoof.net (Worldwide Opportunities on Organic Farms)]]. * [2015-08-08 Sat] Philippines travel bookmarks :PROPERTIES: :CUSTOM_ID: philippines-travel-bookmarks :END: :MODIFIED: [2019-04-14 Sun] :END: - [[https://rachfeed.com/5-unique-tourist-spots-philippines/][5 Unique Tourist Spots in the Philippines - RachFeed]]. - [[http://www.lonelyplanet.com/philippines/travel-tips-and-articles/the-philippines-for-beginners-7-first-timer-fails-to-avoid-on-your-trip][7 first-timer fails]]. - [[https://en.wikipedia.org/wiki/Palawan_%28island%29][Palawan (island)]]. - [[http://www.lonelyplanet.com/philippines/travel-tips-and-articles/77222][The best beaches of the Philippines]]. * [2015-07-23 Thu] Add site-specific browsers to your workflow :PROPERTIES: :CUSTOM_ID: add-site-specific-browsers-to-your-workflow :END: There are three browser tabs continously used in my workflow: GMail, Google Calendar, and Google Play Music. I normally have many more tabs open, but these three I access periodically. As the number of open tabs increases, and I fail to cleanup, getting back to my usual three gets a little trickier. So far, I've kept each of these services open in separate windows. But that doesn't always work. Click on any link in your inbox and you're back to playing cleanup. This is where [[https://en.wikipedia.org/wiki/Site-specific_browser][site-specific browsers]] (SSB) can help. [[https://github.com/dmarmor/epichrome][Epichrome]] enables you to build Chrome-based SSBs (on Mac OSX). Build an SSB for the usual suspects and easily jump to them using the app switcher. #+ATTR_HTML: :width 75% :height 75% [[file:images/add-site-specific-browsers-to-your-workflow/switcher-small.png]] More at [[https://github.com/dmarmor/osx-chrome-ssb-gui/][OSX Chrome SSB]] and [[http://www.quora.com/Is-there-a-way-to-use-Chrome-as-a-site-specific-browser][Quora thread]] UPDATE: Enable the Chrome extension to open URLs in default browser. #+ATTR_HTML: :width 75% :height 75% [[file:images/add-site-specific-browsers-to-your-workflow/helper.png]] And choose the default browser to open URLs. #+ATTR_HTML: :width 75% :height 75% [[file:images/add-site-specific-browsers-to-your-workflow/default.png]] * [2015-07-20 Mon] Sardinia travel bookmarks :PROPERTIES: :CUSTOM_ID: sardinia-travel-bookmarks :END: - Alghero. - Baja Sardinia. - Budoni. - [[http://www.sardinianbeaches.com/beaches-of-sardinia/east/baunei/cala-goloritze/][Cala Goloritze, Sardinia]]. - Castelsardo (gifts maybe?). - Food: Maialetto sardo (Pig), Sebadas, Pardula, Papassinas, Pani e sapa. - L'Asinara boat trip (abandoned penitentiary). - La Pelosa beach. - Nuraghe. - Porto Cervo. - Porto Torres. - San Teodoro. - Stintino (fishing port). - Zedda e Piras vinyards (Alghero). * [2015-07-17 Fri] Open closest build file in Emacs :PROPERTIES: :CUSTOM_ID: open-closest-build-file-in-emacs :END: Whether it's Makefile, SConstruct, BUILD, or your favorite build file, chances are you have to tweak it from time to time. ~ar/open-build-file~ searches your current and parent directories to find a build file. #+BEGIN_SRC emacs-lisp (defvar ar/project-file-names '("Makefile" "SConstruct" "BUILD")) (defun ar/parent-directory (path) "Get parent directory for PATH." (unless (equal "/" path) (file-name-directory (directory-file-name path)))) (defun ar/find-upwards (path filename) "Search upwards from PATH for a file named FILENAME." (let ((file (concat path filename)) (parent (ar/parent-directory (expand-file-name path)))) (if (file-exists-p file) file (when parent (ar/find-upwards parent filename))))) (defun ar/open-closest (filename) "Open the closest FILENAME in current or parent dirs (handy for finding Makefiles)." (let ((closest-file-path (ar/find-upwards (buffer-file-name) filename))) (when closest-file-path (message closest-file-path) (switch-to-buffer (find-file-noselect closest-file-path))) closest-file-path)) (defun ar/open-build-file () "Open the closest project file in current or parent directory. For example: Makefile, SConstruct, BUILD, etc. Append `ar/project-file-names' to search for other file names." (interactive) (catch 'found (mapc (lambda (filename) (when (ar/open-closest filename) (throw 'found t))) ar/project-file-names) (error "No project file found"))) #+END_SRC * [2015-07-15 Wed] Create iOS static fat libraries :PROPERTIES: :CUSTOM_ID: create-ios-static-fat-libraries :END: Have separate static libraries for different iOS architectures? Stitch 'em up into a single fat library using with lipo: #+BEGIN_SRC sh $ lipo -create libOne_i386.a libOne_x86_64.a libOne_armv7.a libOne_arm64.a -output libOne.a #+END_SRC * [2015-07-15 Wed] Settling scores with an org table :PROPERTIES: :CUSTOM_ID: settling-scores-with-an-org-table :END: Recently kept track of expenses between a group of us. To settle the scores, I emailed an exported HTML table from an org file. This was simple enough and required no external viewer from recepients. The org table, in all its textful glory, looked as follows... #+BEGIN_EXAMPLE | Date | Item | Charge | |------------------+----------------+----------| | [2015-06-18 Thu] | Cash | 20.00 | | [2015-07-11 Sat] | Lucky 7 | 42.97 | | [2015-07-13 Mon] | Santa Maria | 32.00 | | [2015-07-12 Sun] | Tayyabs | 46.00 | | [2015-07-13 Mon] | The Brass Rail | 39.00 | | [2015-07-13 Mon] | Underground | 10.00 | | [2015-07-10 Fri] | Cash | 20.00 | | [2015-07-13 Mon] | Cash | 20.00 | | [2015-07-14 Tue] | Cash | 20.00 | |------------------+----------------+----------| | | total | £ 249.97 | ,#+TBLFM: @11$3=vsum(@2..@10);£ %.2f #+END_EXAMPLE ...while the exported HTML below could be easily pasted on to an email. | Date | Item | Charge | |------------------+----------------+----------| | [2015-06-18 Thu] | Cash | 20.00 | | [2015-07-11 Sat] | Lucky 7 | 42.97 | | [2015-07-13 Mon] | Santa Maria | 32.00 | | [2015-07-12 Sun] | Tayyabs | 46.00 | | [2015-07-13 Mon] | The Brass Rail | 39.00 | | [2015-07-13 Mon] | Underground | 10.00 | | [2015-07-10 Fri] | Cash | 20.00 | | [2015-07-13 Mon] | Cash | 20.00 | | [2015-07-14 Tue] | Cash | 20.00 | |------------------+----------------+----------| | | total | £ 249.97 | #+TBLFM: @11$3=vsum(@2..@10);£ %.2f * [2015-07-13 Mon] Recognize new password prompts in Emacs shell :PROPERTIES: :CUSTOM_ID: recognize-new-password-prompts-in-emacs-shell :END: At some point, you may come across a trusted command-line utility prompting you for a password, and Emacs shell happily displaying each typed character to the nearby-world to see. Luckily, you can train Emacs to recognize new password prompts and hide the typed characters in modes deriving from comint. Append the password prompt REGEXP: #+BEGIN_SRC emacs-lisp (setq comint-password-prompt-regexp (concat comint-password-prompt-regexp "\\|" "Password for red alert:")) #+END_SRC * [2015-07-11 Sat] Bosnia and Hercegovina travel bookmarks :PROPERTIES: :CUSTOM_ID: bosnia-and-hercegovina-travel-bookmarks :END: - [[http://www.lonelyplanet.com/bosnia-and-hercegovina/travel-tips-and-articles/ten-reasons-to-visit-bosnia-hercegovina][Ten reasons to visit Bosnia & Hercegovina]]. * [2015-07-11 Sat] Ireland travel bookmarks :PROPERTIES: :CUSTOM_ID: ireland-travel-bookmarks :END: - [[https://en.wikipedia.org/wiki/Skellig_Michael][Skellig Michael]]. - Fishy Fishy in Kinsale: beautiful town on the water. - Belfast. - Giant's Causeway. - Greyhound dog races at Shelbourne Park. - [[https://twitter.com/bilderbergh/status/1066223113774514176?s=12][Old library chamber, Trinity College, Dublin]]. * [2015-07-09 Thu] Pizza in London :PROPERTIES: :CUSTOM_ID: pizza-in-london :END: Not tried these yet. Taking note: - Bravi Ragazzi (Streatham). - Homeslice (Covent Garden). - Lord Morpeth (Hackney). - Santa Maria (Ealing). - Voodoo Ray's (Dalston). - Well Kneaded Wagon (Date-dependent location). * [2015-07-09 Thu] mp4 to gif :PROPERTIES: :CUSTOM_ID: mp4-to-gif :END: Converting mp4 to gif is handy for posting short screencasts. You can convert to gif using ffmpeg and optimize with imagemagick. To install: #+BEGIN_SRC sh apt-get install ffmpeg imagemagick (linux) brew install ffmpeg imagemagick (Mac) #+END_SRC Convert to gif: #+BEGIN_SRC sh ffmpeg -i my.mp4 -pix_fmt rgb24 -r 5 my.gif #+END_SRC Optimize with: #+BEGIN_SRC sh convert -dither none -layers Optimize my.gif my_optimized.gif #+END_SRC UPDATE: There's also licecap and subsequently optimize with: #+BEGIN_SRC sh cat source.gif | gifsicle --colors 256 --optimize=3 --delay=15 > target.gif #+END_SRC UPDATE: [[https://gist.github.com/dergachev/4627207][Also consider for .mov]]: #+BEGIN_SRC sh ffmpeg -i in.mov -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif #+END_SRC * [2015-07-06 Mon] Keyboards bookmarks :PROPERTIES: :CUSTOM_ID: keyboards-bookmarks :END: :MODIFIED: [2021-12-20 Mon] :END: - [[http://www.keyboardco.com/blog/index.php/2012/12/an-introduction-to-cherry-mx-mechanical-switches/][An introduction to Cherry MX mechanical switches]]. - [[http://www.codekeyboards.com][Code keyboard]]. - [[https://ethanaa.com/blog/i-%E2%99%A5-keyboards/#silver][I ♥ Keyboards | Ethan Anderson]]. - [[https://blog.keyboard.io/][Keyboardio Blog]]. - [[https://www.keychron.com/][Keychron | Wireless Mechanical Keyboards for Mac, Windows and phones]]. - [[https://colemak.com/Learn][Learn - Colemak keyboard layout]]. - [[https://mechdb.net/][Mechanical Keyboards Database - custom keyboards photos]]. - [[https://5z6p.com/products/plaid-through-hole/][Plaid // Keyboard base board]]. - [[https://ultimatehackingkeyboard.com/shop][Products – Ultimate Hacking Keyboard]]. - [[https://www.reddit.com/r/cyberDeck/][r/cyberDeck]]. - [[https://www.reddit.com/r/ErgoMechKeyboards/][r/ErgoMechKeyboards]]. - [[https://news.ycombinator.com/item?id=17989303][Ultimate Hacking Keyboard (Hacker News)]]. - [[http://sittingscribe.com/why-learn-the-colemak-keyboard-layout/][Why Learn the Colemak Keyboard Layout?]]. * [2015-07-05 Sun] United States travel bookmarks :PROPERTIES: :CUSTOM_ID: united-states-travel-bookmarks :END: :MODIFIED: [2021-04-21 Wed] :END: - [[https://www.abandonedamerica.us/][Abandoned America]]. - [[https://www.lonelyplanet.com/usa/travel-tips-and-articles/americas-best-food-cities-for-travelers-on-a-budget/40625c8c-8a11-5710-a052-1479d2756c74][America's best food cities for travelers on a budget - Lonely Planet]]. - [[https://en.wikipedia.org/wiki/Antelope_Canyon][Antelope Canyon (Arizona)]]. - [[https://www.statelibraryofiowa.org/services/collections/law-library][Law Library in Iowa]]. - [[https://qr.ae/pGIlFt][Peter Wade's answer has restaurants throughout the US]]. - [[https://duckduckgo.com/?q=Supai%252C+Arizona&t=ffab&iax=1&ia=images][Supai, Arizona]]. - [[https://texastriffidranch.com/][The Texas Triffid Ranch | Dallas's Pretty Much Only Carnivorous Plant Gallery]]. - [[https://duckduckgo.com/?q%3DTurnip%2BRock%2Bin%2BPort%2BAustin%252C%2BMichigan&t%3Dffab&iax%3D1&ia%3Dimages][Turnip Rock in Port Austin, Michigan]]. - [[https://twitter.com/EarthPix/status/613912754227965952/photo/1][Vance Creek Bridge in Washington]]. - [[https://www.wta.org/][Washington trail association (hiking)]]. - [[https://www.quora.com/Where-can-I-afford-to-live-in-NYC-with-a-100-000-salary-and-no-debt][Where can I afford to live in NYC with a $100,000 salary and no debt? (Quora)]]. * [2015-07-05 Sun] Lebanon travel bookmarks :PROPERTIES: :CUSTOM_ID: lebanon-travel-bookmarks :END: :MODIFIED: [2023-04-20 Thu] :END: - [[https://en.wikipedia.org/wiki/Baatara_gorge_waterfall][Baatara gorge waterfall]]. - [[https://www.instagram.com/steakcrush][STEAK CRUSH (@steakcrush)]]. * [2015-07-05 Sun] Slovenia travel bookmarks :PROPERTIES: :CUSTOM_ID: slovenia-travel-bookmarks :END: - [[http://wildswim.com/lake-bohinj][Lake Bohinj]]. * [2015-07-05 Sun] Belgium travel bookmarks :PROPERTIES: :CUSTOM_ID: belgium-travel-bookmarks :END: :MODIFIED: [2020-02-15 Sat] :END: - [[https://twitter.com/planetepics/status/617003120695099392/photo/1][The Flower Carpet event at the Grand-Place in Brussels]]. - [[https://zerokspot.com/weblog/2020/02/03/travel-arrangements-brussels/][Travel arrangements around Brussels - zerokspot.com]]. * [2015-07-03 Fri] Fishing with Emacs :PROPERTIES: :CUSTOM_ID: fishing-with-emacs :END: OK not quite, but having recently learned about [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Appending-Kills.html][C-M-w (append-next-kill)]], I used it in a keyboard macro to fish out matching lines. This is similar to [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Other-Repeating-Search.html][flush-lines]], except the kill ring is also populated. This is handy, if you need the flushed lines. Here's an example. #+ATTR_HTML: :width 75% :height 75% [[file:images/fishing-with-emacs/fishing.gif]] Here's the equivalent in Emacs lisp: #+BEGIN_SRC emacs-lisp (defun flush-kill-lines (regex) "Flush lines matching REGEX and append to kill ring. Restrict to \ region if active." (interactive "sFlush kill regex: ") (save-excursion (save-restriction (when (use-region-p) (narrow-to-region (point) (mark)) (goto-char 0)) (while (search-forward-regexp regex nil t) (move-beginning-of-line nil) (kill-whole-line))))) #+END_SRC * [2015-07-03 Fri] California travel bookmarks :PROPERTIES: :CUSTOM_ID: california-travel-bookmarks :END: - [[https://en.wikipedia.org/wiki/Sequoia_National_Park][General Sherman Tree at Sequoia National Park]]. * [2015-07-01 Wed] Rebind caps lock to control key on Mac OS X :PROPERTIES: :CUSTOM_ID: rebind-caps-lock-to-control-key-on-mac-os-x :END: Let's see if this one sticks. I'll give caps lock as control a try. Rebinding the keys on Mac OS X is easy enough: #+ATTR_HTML: :width 75% :height 75% [[file:images/rebind-caps-lock-to-control-key-on-mac-os-x/caps-lock-to-control.png]] #+BEGIN_QUOTE System Preferences -> Keyboard -> Keyboard Tab -> Modifier Keys... #+END_QUOTE * [2015-06-30 Tue] Searchable ebooks in Emacs :PROPERTIES: :CUSTOM_ID: searchable-ebooks-in-emacs :END: If you haven't bought [[https://www.masteringemacs.org/book][Mastering Emacs]] by [[https://twitter.com/mickeynp][Mickey Petersen]], you should. It's a wonderful source of Emacs tips. Having just finished the ebook on my Kindle, I was keen to go back and fish out some of that newly found wisdom. My immediate reaction was to figure out a way to make the ebook searchable from Emacs. The ebook is available in epub and pdf format. Though Emacs's docview is super handy for viewing pdf's, searching didn't feel as comfortable as searching in org mode. The epub, on the other hand, proved useful. [[http://pandoc.org][Pandoc]] can easily convert from epub to org. #+BEGIN_SRC sh pandoc --from=epub --to=org mastering-emacs.epub > mastering-emacs.org #+END_SRC After a some tidying (mostly removing BEGIN_HTML/END_HTML blocks and adding TITLE/AUTHOR), the resulting org file is surprisingly clean and easy to search/navigate. [[https://github.com/ShingoFukuyama/helm-swoop][helm-swoop]] and [[https://github.com/emacs-helm/helm/blob/199b9feb396eedc0e502dd767b19060f7dc09f6a/helm-org.el][helm-org-in-buffer-headings]] are great for that. #+ATTR_HTML: :width 75% :height 75% [[file:images/searchable-ebooks-in-emacs/mastering-emacs-org-00.png]] #+ATTR_HTML: :width 75% :height 75% [[file:images/searchable-ebooks-in-emacs/mastering-emacs-org-01.png]] #+ATTR_HTML: :width 75% :height 75% [[file:images/searchable-ebooks-in-emacs/mastering-emacs-org-02.png]] * [2015-06-21 Sun] Portugal travel bookmarks :PROPERTIES: :CUSTOM_ID: portugal-travel-bookmarks :END: :MODIFIED: [2023-07-09 Sun] :END: - [[https://www.quora.com/As-a-Dermatologist-what-life-changing-skin-care-advice-would-you-give-me][As a Dermatologist, what life changing skin care advice would you give me?]]. - [[https://duckduckgo.com/?q=avenida+dos+platanos&ia=images][Avenida dos Platanos]]. - [[https://brunoamaral.eu/page/beautiful-lisbon/][Beautiful Lisbon]]. - [[https://www.reddit.com/r/Sardinia/comments/14uwypj/best_restaurants_in_alghero/][Best restaurants in Alghero?]]. - Boca do inferno. - Cabo da Roca. - Casa dos passarinhos (Steak on hot stone, tuna steak with “mirandesa” sauce, monkfish masada). - Cascais - Guincho. - Cervejaria Ramiro (seafood restaurant in town). - Eduard 7th park. - Estoril. - Fox Trot (bar). - [[https://en.wikipedia.org/wiki/Hachij%C5%8D-jima][Hachijō-jima island]]. - [[https://duckduckgo.com/?q=ilha+da+culatra&t=ffab&iax=1&ia=images][Ilha da Culatra (good for families)]]. - [[https://duckduckgo.com/?q=ilha+da+tavira&t=ffab&iax=1&ia=images][Ilha da Tavira (good for food @ Portas do Mar)]]. - [[https://duckduckgo.com/?q=ilha+deserta&t=ffab&iax=1&ia=images][Ilha Deserta (seafood as Estaminé)]]. - Jeronimos Monastery (Lisbon). - Lisbon Castle. - [[https://www.lisbonlux.com/lisbon-shops/mercado-da-ribeira.html][Mercado da Ribeira in Lisbon]]. - Mouro's castle (Sintra). - Mouro's castle. - Pasteis de Belem (Lisbon). - Pastelaria piriquita eat queijadas de sintra. - Pasteleria Piriquita (Sintra). - Pavilhao Chines (bar). - Pena's Pallace (must see if you go to sintra) - Pena's Pallace (Sintra). - Pensao do Amor (bar). - [[https://www.etfoodvoyage.com/category/locations/portugal/][Portugal Archives - ET Food Voyage]]. - Praça do comercio. - Quinta da Regaleira - Quinta da Regaleira (Sintra). - Sintra village - [[https://en.wikipedia.org/wiki/Sintra][Sintra]]. - Stop do bairro (tamboril rice, prawn curry, and seafood rice). - [[http://www.surfcastle.com/surf/school][Surfcastle]]. - [[https://twitter.com/archpng/status/1115037292752723968][São Bento railway station]]. - Sé (Lisbon Cathedral). - [[https://twitter.com/lonelyplanet/status/612282216635363328/photo/1][The best beaches in Portugal's Algarve]]. - Torre Belem (Lisbon). - [[https://www.eventbrite.com/e/web-summit-ladies-craft-night-tote-bag-embroidery-workshop-tickets-51503431149][Web Summit Ladies Craft Night - Tote Bag Embroidery Workshop Tickets, Tue, Nov 6, 2018 at 7:00 PM (Eventbrite)]]. - [[https://www.quora.com/What-tips-would-you-give-to-a-newbie-who-wants-to-travel-like-you][What tips would you give to a newbie who wants to travel like you? - Quora]]. - [[https://edition.cnn.com/travel/article/world-longest-pedestrian-suspension-bridge-portugal-arouca/index.html][World's longest pedestrian suspension bridge]]. * [2015-06-21 Sun] Bulgaria travel bookmarks :PROPERTIES: :CUSTOM_ID: bulgaria-travel-bookmarks :END: :MODIFIED: [2015-06-21 Sun] :END: - [[https://twitter.com/EarthPix/status/612661559018528768/photo/1][Devetashka Cave]]. * [2015-06-21 Sun] Presenting bookmarks :PROPERTIES: :CUSTOM_ID: presenting-bookmarks :END: :MODIFIED: [2016-01-13 Wed] :END: - [[http://s.hbr.org/1A4l5OX][How to give a presentation people will remember]]. - [[http://s.hbr.org/1A3uvKp][How to give a stellar presentation]]. - [[http://www.troyhunt.com/2015/06/speaker-style-bingo-10-presentation.html?m%3D1][Speaker style bingo: 10 presentation anti-patterns]]. * [2015-06-21 Sun] Bali travel bookmarks :PROPERTIES: :CUSTOM_ID: bali-travel-bookmarks :END: - [[https://www.lonelyplanet.com/indonesia/nusa-tenggara/gili-islands][Gili Islands travel (Nusa Tenggara, Indonesia - Lonely Planet)]]. - [[https://snorkelaroundtheworld.com/2018/09/manta-snorkeling-nusa-penida/][Manta snorkeling Nusa Penida – When? Where? How much?]]. - Pura Lempuyang, Bali. * [2015-06-17 Wed] WWDC app for OS X :PROPERTIES: :CUSTOM_ID: wwdc-app-for-os-x :END: [[https://github.com/insidegui][Guilherme Rambo]] created a great OS X [[https://github.com/insidegui/WWDC][OS X app for viewing WWDC content]]. Just installed it. Super handy. Thanks. Installing as simple as: #+BEGIN_SRC sh $ brew cask install wwdc #+END_SRC * [2015-06-15 Mon] Debugging Objective-C reference cycles :PROPERTIES: :CUSTOM_ID: debugging-objective-c-reference-cycles :END: Overriding retain/release/autorelease may be handy while debugging: #+BEGIN_SRC objc - (instancetype)retain { NSLog(@"%p, retain\n", self); return [super retain]; } - (oneway void)release { NSLog(@"%p, release\n", self); [super release]; } - (instancetype)autorelease { NSLog(@"%p, autorelease\n", self); return [super autorelease]; } #+END_SRC * [2015-06-13 Sat] London grub :PROPERTIES: :CUSTOM_ID: london-grub :END: Beyond the hype, buzz, and pricey gimmicks... Places to eat in London: - Antipode. - Arang. - Bone Daddies. - Gelupo. - Grind. - Holy Cow. - Kerbisher and Malt. - Kulu Kulu (South Ken). - Le Relais de Venise. - Lucky 7's. - Royal China. - Shree Krishna Vada Pav. - Sri Suwoon. - Tayyabs. - The Cow. - Tonkotsu. * [2015-06-08 Mon] My working playlist :PROPERTIES: :CUSTOM_ID: my-working-playlist :END: It's been a while since I spotted [[http://www.asianefficiency.com/motivation/music-working/][The Ultimate Music Collection for Getting Work Done]]. Since then, I've been on the lookout for music to work to. Some favorites: - [[https://play.google.com/store/music/album/B_Fleischmann_I_m_Not_Ready_For_The_Grave_Yet?id%3DBvu3fq5u5nbqcouo55bqi5qukjq][B. Fleischmann - I'm Not Ready For The Grave Yet]]. - [[https://play.google.com/store/music/album/B_Fleischmann_Pop_Loops_For_Breakfast?id%3DB55lzvhp5xn2mkrzggq2uymiwm4][B. Fleischmann - Pop Loops For Breakfast]]. - [[https://play.google.com/store/music/album/B_Fleischmann_Sidonie?id%3DBu5v5pc4ixxzapcoehnpllfvm5u][B. Fleischmann - Sidonie]]. - [[https://play.google.com/store/music/album/B_Fleischmann_The_Humbucking_Coil?id%3DBok7yvyylg7ddkofaaecjdsduky][B. Fleischmann - The Humbucking Coil]]. - [[https://play.google.com/store/music/album/Stars_of_the_Lid_The_Tired_Sounds_of_Stars_of_the?id%3DBasr7yt6jlsut3v2tpua7kfcckm][B. Fleischmann - The Tired Sounds of Stars of the Lid]]. - [[https://play.google.com/store/music/album/B_Fleischmann_Welcome_Tourist?id%3DByefc55y7psyxg4okrq63mn4nne][B. Fleischmann - Welcome Tourist]]. - [[https://play.google.com/store/music/album/Bexar_Bexar_Haralambos?id%3DBpyhpbxh6b4wthiczeokgiuijo4][Bexar Bexar - Haralambos]]. - [[https://play.google.com/store/music/album/Budhaditya_Mukherjee_Sitar_Recital?id%3DBtawoyja7nxl2arsuimelitwzay][Budhaditya Mukherjee - Sitar Recital]]. - [[https://play.google.com/store/music/album/Daft_Punk_TRON_Legacy?id%3DBbcjlhafmpp5ueztndxevp4cfuq][Daft Punk - TRON: Legacy]]. - [[https://play.google.com/store/music/album/General_Fuzz_Soulful_Filling?id%3DB7rb24bzexr2q5bfjzffhvdd5he][General Fuzz - Soulful Filling]]. - [[https://play.google.com/store/music/album/Hans_Zimmer_Inception_Music_From_The_Motion_Pictur?id%3DBoebgqwhs6bsgytjw2eybh7jiny][Inception (Music From The Motion Picture)]]. - [[https://play.google.com/store/music/album/ISAN_Lucky_Cat?id%3DBjuvgzm2mocch55nolmbsjenaxy][ISAN - Lucky Cat]]. - [[https://play.google.com/store/music/album/ISAN_Plans_Drawn_In_Pencil?id%3DBmp2y6k5bstvqlnzn2ncexcyolq][ISAN - Plans Drawn In Pencil]]. - [[https://play.google.com/store/music/album/Jayanthi_Kumaresh_Mysterious_Duality?id%3DByrdsgd3b7ixcouemqqouxf45ia][Jayanthi Kumaresh - Mysterious Duality]]. - [[https://play.google.com/store/music/album/Mogwai_Les_Revenants?id%3DBu2zb5nvoth3ead6v5riw43by7u][Mogwai - Les Revenants]]. - [[https://play.google.com/store/music/album/Moondog_Big_Cat?id%3DB2hq6dlicqboshlev5eeiy53ybe][Moondog - Big Cat]]. - [[https://play.google.com/store/music/album/Various_Artists_Moonrise_Kingdom_Original_Soundtra?id%3DB5babupzgcigh6jdprp3ga3owzm][Moonrise Kingdom (Original Soundtrack)]]. - [[https://play.google.com/store/music/album/Nico_Muhly_Drones?id%3DBlj2wetseui4m5gfjjk5lssenui][Nico Muhly - Drones]]. - [[https://play.google.com/store/music/album/Paul_Leonard_Morgan_Limitless_Original_Motion_Pict?id%3DBev5grya2zxgojikqwkdcxmdijq][Paul Leonard-Morgan - Limitless (Original Motion Picture Soundtrack)]]. - [[https://play.google.com/store/music/album/Robert_Scott_Thompson_Upon_the_Edge_of_Night?id%3DBpkg77vpxsfgu4dj53y5ucxa4qe][Robert Scott Thompson - Upon the Edge of Night]]. - [[https://play.google.com/store/music/album/Ryan_Miller_The_Kings_of_Summer_Jordan_Vogt_Robert?id%3DBx2mxfujrx5mjkqq6mm23zwzj54][Ryan Miller - The Kings of Summer (Jordan Vogt-Roberts' Original Motion Picture Soundtrack)]]. - [[https://play.google.com/music/listen#/album//Stars%2Bof%2Bthe%2BLid/And%2BTheir%2BRefinement%2Bof%2Bthe%2BDecline][Stars of the Lid - And Their Refinement of the Decline]]. - [[https://play.google.com/store/music/album/Stars_of_the_Lid_Gravitational_Pull_vs_The_Desire?id%3DBdnfpvqwopgqufuy2ly6u3lkhvy][Start of the Lid - Gravitational Pull vs. The Desire for an Aquatic Life]]. - [[https://play.google.com/store/music/album/Terry_Riley_Terry_Riley_A_Rainbow_In_Curved_Air_Po?id%3DBmfe6h2d7heiey4xz74ocg6sx6e][Terry Riley - A Rainbow In Curved Air; Poppy Nogood and the Phantom Band]]. - [[http://www.amazon.com/Social-Network-Trent-Reznor-Atticus/dp/B0044430H8/ref%3Dtmm_msc_swatch_0?_encoding%3DUTF8&sr%3D&qid%3D][Trent Reznor & Atticus Ross - The Social Network (Soundtrack from the Motion Picture)]]. - [[https://play.google.com/store/music/album/Trentem%25C3%25B8ller_Into_The_Great_Wide_Yonder?id%3DBf6v47rm3dvgrjaircusjtocbfq][Trentemøller - Into The Great Wide Yonder]]. - [[https://play.google.com/store/music/album/Tycho_Awake?id%3DBtc34r45fy7qwk4t6irzpkduv4a][Tycho - Awake]]. - [[https://play.google.com/store/music/album/Various_Artists_Singing_Strings_From_India?id%3DBvkavd7gn62io3lmskjsbgpvtvy][Various Artists - Singing Strings From India]]. - [[http://www.vitling.com/toys/triple_saw/][vitling: Triple Saw (algorithmic music) #algorave]]. - [[https://play.google.com/store/music/album/Justin_Hurwitz_Whiplash_Original_Motion_Picture_So?id%3DBfdbec3biny47s6rwchdifzgrg4][Whiplash (Original Motion Picture Soundtrack)]]. - [[https://play.google.com/store/music/album/Youth_Lagoon_The_Year_Of_Hibernation?id%3DBfw6onp7zxplpmlrheu3rmd3yui][Youth Lagoon - The Year Of Hibernation]]. * [2015-06-02 Tue] Xcode bookmarks :PROPERTIES: :CUSTOM_ID: xcode-bookmarks :END: :MODIFIED: [2021-01-23 Sat] :END: - [[https://medium.com/ios-os-x-development/a-better-way-to-automatically-merge-changes-in-your-xcode-project-files-3d83b3583fe4#.hz33egjv1][A Better Way to Automatically Merge Changes in Your XCode Project Files]]. - [[http://www.amazon.co.uk/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=sr_1_1?ie=UTF8&qid=1444472656&sr=8-1&keywords=Clean+Code%3A+A+Handbook+of+Agile+Software+Craftsmanship][Clean Code: A Handbook of Agile Software Craftsmanship (Book)]]. - [[https://medium.com/passei-direto-product-and-technology/from-xcode-to-testflight-using-command-line-288c3a85bd93][From Xcode to TestFlight using command line]]. - [[https://github.com/FuzzyAutocomplete/FuzzyAutocompletePlugin/blob/master/README.md][Fuzzy autocomplete for Xcode]]. - [[https://github.com/kolinkrewinkel/Multiplex][Multiplex (like Emacs multiple cursor but for Xcode)]]. - [[http://chen.do/blog/2013/10/22/reverse-engineering-xcode-with-dtrace/][Reverse-engineering Xcode with dtrace]]. * [2015-06-02 Tue] Costa Rica travel bookmarks :PROPERTIES: :CUSTOM_ID: costa-rica-travel-bookmarks :END: - [[https://twitter.com/planetepics/status/603851463509540864/photo/1][Catarata del Toro]]. - [[https://www.quora.com/What-are-the-best-travel-hacks-when-traveling-to-Costa-Rica][What are the best travel hacks when traveling to Costa Rica? (Quora)]]. * [2015-06-02 Tue] Australia travel bookmarks :PROPERTIES: :CUSTOM_ID: australia-travel-bookmarks :END: :MODIFIED: [2016-12-01 Thu] :END: - [[http://www.lonelyplanet.com/australia/sydney/travel-tips-and-articles/australias-best-food-experiences-state-by-state][Australia's best food experiences: state by state]]. - [[http://www.lonelyplanet.com/travel-tips-and-articles/best-queensland-island-escapes-for-small-budgets][Best Queensland island escapes for small budgets]]. - [[http://myproducetrail.com.au/directory/215][Des and Debi O’Tooles Honey]]. - Fish and chips at Bondi beach. - [[https://www.lonelyplanet.com/australia/tasmania/travel-tips-and-articles/tasmania-the-formidable-isle-thats-wild-at-heart][Tasmania: the isle that's wild at heart]]. - The Butler Potts Point (bar & restaurant). - [[https://www.tripadvisor.com/Attraction_Review-g488368-d2415480-Reviews-Tree_Top_Walk-Walpole_Western_Australia.html][Tree Top Walk (Walpole, Australia): Top Tips Before You Go - TripAdvisor]]. * [2015-06-02 Tue] Samoa travel bookmarks :PROPERTIES: :CUSTOM_ID: samoa-travel-bookmarks :END: - [[http://www.samoa.travel/activity/to-sua-ocean-trench][To Sua ocean trench]]. * [2015-06-02 Tue] Norway travel bookmarks :PROPERTIES: :CUSTOM_ID: norway-travel-bookmarks :END: :MODIFIED: [2020-03-28 Sat] :END: - [[https://twitter.com/archpics/status/613586879645155328/photo/1][Atlantic Road]]. - Bergen (check out colorful wooden houses). - Bergen railway (Bergen-Oslo): 300 miles of beautiful Norwegian scenery. - [[http://www.lofoten-info.no/][Lofoten Islands]]. - Norwegian Air (cheap flights between all the - [[https://duckduckgo.com/?q=olden+norway&t=ffab&iax=1&ia=images][Olden]]. - [[https://en.wikipedia.org/wiki/Reine][Reine]]. - [[https://www.pinterest.com/pin/377950593706704729/?utm_campaign%3Drecs_150817&utm_term%3D1&utm_content%3D377950593706704729&e_t%3Dbce987c654c54dfa8733bc2f9df20080&utm_source%3D31&e_t_s%3Dpins&utm_medium%3D2004][Sakrisøy, Lofoten Islands]]. - [[https://duckduckgo.com/?q=Spitsbergen&t=ffsb&iax=1&ia=images][Spitsbergen]]. - [[http://www.theatlanticroad.com/][The Atlantic Road - Atlanterhavsveien / Atlanterhavsvegen]]. * [2015-06-02 Tue] Los Angeles travel bookmarks :PROPERTIES: :CUSTOM_ID: los-angeles-travel-bookmarks :END: :MODIFIED: [2018-10-29 Mon] :END: - [[http://www.beerbellyla.com/][Beer Belly (Craft Beer + Crafty Food)]]. - [[http://www.bluestardonuts.com/][Blue Star Donuts (SF + LA)]]. * [2015-05-28 Thu] Mastering Emacs is out :PROPERTIES: :CUSTOM_ID: mastering-emacs-is-out :END: Emacs is amazingly alive. New packages are regularly listed on [[http://melpa.org][melpa]] and a new book just came out: [[https://www.masteringemacs.org/book][Mastering Emacs]] by [[https://twitter.com/mickeynp][Mickey Petersen]]. [[https://www.masteringemacs.org/book][file:images/mastering-emacs-is-out/cover.png]] * [2015-05-25 Mon] South Carolina travel bookmarks :PROPERTIES: :CUSTOM_ID: south-carolina-travel-bookmarks :END: - [[https://en.wikipedia.org/wiki/Angel_Oak][Angel Oak tree]]. * [2015-05-25 Mon] Colorado travel bookmarks :PROPERTIES: :CUSTOM_ID: colorado-travel-bookmarks :END: - [[http://horseshoebend.com/][Horseshoe Bend]]. * [2015-05-25 Mon] Bash bookmarks :PROPERTIES: :CUSTOM_ID: bash-bookmarks :END: :MODIFIED: [2019-07-07 Sun] :END: - [[https://linuxhint.com/bash_conditional_statement/][Bash conditional statement (Linux Hint)]]. - [[https://linuxhint.com/bash_echo/][Bash Echo Examples (Linux Hint)]]. - [[https://linuxhint.com/bash_error_handling/][Bash Error Handling (Linux Hint)]]. - [[https://linuxhint.com/bash_for_loop/][Bash for loop examples (Linux Hint)]]. - [[https://www.gnu.org/software/bash/manual/bashref.html][Bash Reference Manual]]. - [[https://news.ycombinator.com/item?id=11832941][Common shell script mistakes (Hacker News)]]. - [[http://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming][Defensive bash programming]]. - [[https://www.cyberciti.biz/faq/linux-unix-bash-for-loop-one-line-command/][HowTo: Use bash For Loop In One Line - nixCraft]]. - [[http://www.etalabs.net/sh_tricks.html][Rich’s sh (POSIX shell) tricks]]. - [[https://github.com/anordal/shellharden/blob/master/how_to_do_things_safely_in_bash.md][Safe ways to do things in bash]]. - [[https://github.com/koalaman/shellcheck][shellcheck: ShellCheck, a static analysis tool for shell scripts]]. - [[https://linuxhint.com/string_concatenation_bash/][String concatenation in bash (Linux Hint)]]. - [[http://bash.academy][The Bash Academy]]. * [2015-05-25 Mon] restclient.el :PROPERTIES: :CUSTOM_ID: restclient.el :END: Installed [[https://github.com/pashky/restclient.el][Pashky's]] [[https://github.com/pashky/restclient.el][restclient.el]] Emacs package. Super helpful when trying out REST APIs. #+ATTR_HTML: :width 75% :height 75% [[file:images/restclient.el/restclient.png]] * [2015-05-25 Mon] Seatle travel bookmarks :PROPERTIES: :CUSTOM_ID: seatle-travel-bookmarks :END: :MODIFIED: [2019-04-12 Fri] :END: - [[http://www.lonelyplanet.com/usa/seattle/travel-tips-and-articles/14-free-things-to-do-in-seattle][14 free things to do in Seattle]]. - [[https://indichocolate.com/][Indi chocolate]]. - [[https://www.lepanier.com/][Le Panier]]. * [2015-05-25 Mon] Berlin travel bookmarks :PROPERTIES: :CUSTOM_ID: berlin-travel-bookmarks :END: :MODIFIED: [2016-01-12 Tue] :END: - [[http://www.topinspired.com/top-10-things-to-do-in-berlin/][10 things to do in Berlin]]. - [[http://www.angloitalianfollowus.com/berlin-on-a-budget][Berlin On A Budget: Our Slow Travel Guide]]. - [[http://www.lonelyplanet.com/travel-tips-and-articles/69756][Perfect day in Berlin]]. - [[http://www.lonelyplanet.com/germany/berlin/travel-tips-and-articles/75972][The best of hidden Berlin]]. * [2015-05-25 Mon] Skeuomorph :PROPERTIES: :CUSTOM_ID: skeuomorph :END: From [[https://en.wikipedia.org/wiki/Skeuomorph][Wikipedia]], skeuomorph /ˈskjuːəmɔrf/ is a derivative object that retains ornamental design cues from structures that were necessary in the original. Examples include pottery embellished with imitation rivets reminiscent of similar pots made of metal and a software calendar that imitates the appearance of binding on a paper desk calendar. * [2015-05-25 Mon] define-word :PROPERTIES: :CUSTOM_ID: define-word :END: Installed [[https://github.com/abo-abo][Abo Abo's]] [[https://github.com/abo-abo/define-word][define-word]] Emacs package. A handy package to define words at point. #+ATTR_HTML: :width 75% :height 75% [[file:images/define-word/define-word.png]] * [2015-05-22 Fri] Flushing empty lines in Emacs :PROPERTIES: :CUSTOM_ID: flushing-empty-lines-in-emacs :END: Via [[https://www.masteringemacs.org][masteringemacs.org]], [[https://www.masteringemacs.org/article/removing-blank-lines-buffer][removing blank lines in a buffer]]: #+BEGIN_EXAMPLE M-x flush-lines RET ^$ RET #+END_EXAMPLE * [2015-05-22 Fri] Regex bookmarks :PROPERTIES: :CUSTOM_ID: regex-bookmarks :END: :MODIFIED: [2019-08-06 Tue] :END: - [[http://ergoemacs.org/emacs/emacs_regex.html][Emacs: Text Pattern Matching (regex) tutorial]]. - [[https://dev.to/emmawedekind/regex-cheat-sheet-2j2a][Regex Cheat Sheet (DEV Community)]]. - [[http://regexrenamer.sourceforge.net/help/regex_quickref.html][Regex quick reference]]: From regexrenamer. - [[https://news.ycombinator.com/item][RegExr, see hacker news comments for other suggestions]]. - [[http://regexr.com/][RegExr: A website for interactive regex prototyping with syntax highlighting]]. * [2015-05-06 Wed] Write to temp iOS snippet :PROPERTIES: :CUSTOM_ID: write-to-temp-ios-snippet :END: #+BEGIN_SRC objc NSString *tempDir = NSTemporaryDirectory(); NSLog(@"%@\n", tempDir); NSString *dataFilePath = [tempDir stringByAppendingPathComponent:@"my.file"]; [data writeToFile:dataFilePath atomically:YES]; #+END_SRC * [2015-05-04 Mon] Greece travel bookmarks :PROPERTIES: :CUSTOM_ID: greece-travel-bookmarks :END: :MODIFIED: [2021-01-02 Sat] :END: - [[http://island-ikaria.com/villages/Armenistis][Armenistis - Ikaria]]. - [[https://en.wikipedia.org/wiki/Hydra_%2528island%2529][Hydra (island). No cars or motorcycles allowed]]. - [[https://twitter.com/planetepics/status/584886491534471168/photo/1][Kathisma Beach - Lefkada]]. - [[https://en.wikipedia.org/wiki/Cephalonia][Kefalonia Island]]. - [[https://en.wikipedia.org/wiki/Melissani_Cave][Melissani Cave]]. - [[https://duckduckgo.com/?q=monemvasia+greece&iac=1][Momnevasia]]. - [[https://en.wikipedia.org/wiki/Navagio][Navagio bay]]. - [[http://www.milos-island.gr/beaches/papafragas-beach.html][Papafragas beach]]. - [[https://duckduckgo.com/?q=preveza&t=ffab&iax=images&ia=images][Preveza at DuckDuckGo]]. * [2015-05-04 Mon] Sri Lanka travel bookmarks :PROPERTIES: :CUSTOM_ID: sri-lanka-travel-bookmarks :END: :MODIFIED: [2021-05-01 Sat] :END: - [[https://exploreslk.com/ambuluwawa-temple/][Ambuluwawa Temple]]. - [[https://www.nomadicmatt.com/travel-blogs/sri-lanka-trip-planning-guide/][Sri Lanka Travel Guide | Best Tips For Your Trip (Nomadic Matt)]]. - [[https://www.lonelyplanet.com/amp/articles/best-train-rides-sri-lanka][The best train journeys in Sri Lanka]]. - [[http://www.agoda.com/the-safari-hotel/hotel/yala-lk.html%20][The Safari Hotel (great area to go on safari, see leopards)]]. * [2015-05-04 Mon] Switzerland travel bookmarks :PROPERTIES: :CUSTOM_ID: switzerland-travel-bookmarks :END: :MODIFIED: [2021-05-16 Sun] :END: - [[https://en.wikipedia.org/wiki/Bernina_railway][Bernina railway]]. - [[https://en.wikipedia.org/wiki/Lauterbrunnen][Lauterbrunnen village]]. - [[http://en.wikipedia.org/wiki/Lion_Monument][Lion Monument (Lucerne)]]. - [[http://www.luzern.com/en/index.cfm][Lucerne lake/city]]. - [[https://en.wikipedia.org/wiki/Oeschinen_Lake][Oeschinen Lake]]. * [2015-05-04 Mon] Thailand travel bookmarks :PROPERTIES: :CUSTOM_ID: thailand-travel-bookmarks :END: :MODIFIED: [2018-04-08 Sun] :END: - [[http://www.traveller.com.au/bangkok-street-food-restaurant-raan-jay-fai-awarded-with-michelin-star-h03h7v][Best Thai street food: Bangkok stall Raan Jay Fai awarded with Michelin star]]. - [[http://www.thebuddhism.net/2012/07/11/buddha-statue-in-forest-pak-chong-thailand/][Buddha Statue in Forest Pak Chong]]. - [[http://en.wikipedia.org/wiki/Phanom_Rung_Historical_Park][Phanom Rung Historical Park]]. - [[https://twitter.com/archpics/status/607334981971623936/photo/1][Rama IX park, Bangkok]]. - [[https://duckduckgo.com/?q=Sanctuary+of+truth%2C+Thailand+&t=ffsb&iax=1&ia=images][Sanctuary of Truth]]. - [[https://www.quora.com/What-makes-Bangkok-so-popular][What makes Bangkok so popular? (Quora)]]. * [2015-05-04 Mon] Madagascar travel bookmarks :PROPERTIES: :CUSTOM_ID: madagascar-travel-bookmarks :END: - [[http://en.wikipedia.org/wiki/Avenue_of_the_Baobabs][Avenue of the Baobabs]]. * [2015-05-04 Mon] Hong Kong travel bookmarks :PROPERTIES: :CUSTOM_ID: hong-kong-travel-bookmarks :END: :MODIFIED: [2019-03-17 Sun] :END: - [[http://hongkongthrumyeyes.com/2013/07/13/crowd-of-pedestrians-crossing-at-sogo-in-causeway-bay/][Causeway Bay pedestrian crossing]]. - [[http://www.lonelyplanet.com/china/travel-tips-and-articles/75797][Hong Kong's most breathtaking views: where to glimpse the city from above]]. - [[http://www.hotel-icon.com/][Hotel Icon (allegedly amazing service/extras)]]. - [[https://en.wikipedia.org/wiki/Lin_Heung_Tea_House][Lin Heung Tea House (bakery/tea/dim sum)]]. - [[https://www.tripadvisor.co.uk/Restaurant_Review-g294217-d8028365-Reviews-Mak_s_Noodle_Jordan-Hong_Kong.html][Mak's Noodle (Jordan)]]. - [[https://en.wikipedia.org/wiki/Siu_yuk][Siu yuk (Roasted Pig)]]. - [[https://en.wikipedia.org/wiki/Tsang_Tsou_Choi][Tsang Tsou Choi (King of Hong Kong)]]. - [[http://danielfooddiary.com/2014/12/13/tsimchaikee/][Tsim Chai Kee]] (recommended over Mak's wonton/soup). * [2015-05-04 Mon] Barcelona travel bookmarks :PROPERTIES: :CUSTOM_ID: barcelona-travel-bookmarks :END: :MODIFIED: [2015-08-26 Wed] :END: - [[http://www.lonelyplanet.com/spain/barcelona/travel-tips-and-articles/77782][18 free things to do in Barcelona]]. - [[https://twitter.com/merowing_/status/884349497685549056][Dessert place you can recommend in Barcelona? (Twitter)]]. - [[https://www.lapedrera.com/en/home][La Pedrera]]. * [2015-05-04 Mon] Iceland travel bookmarks :PROPERTIES: :CUSTOM_ID: iceland-travel-bookmarks :END: :MODIFIED: [2018-12-25 Tue] :END: - [[http://www.gertenbach.info/e_reisen_2010.htm][An Iceland travel log]]. - [[http://www.apartmenthouse.is/][Apartmenthouse.is]] for local flats. - Blue lagoon spa. - [[http://citywalk.is/][citywalk.is]]: Free walking tour. - [[http://designmarch.is/][Design March]]. - [[http://www.iheartreykjavik.net/2015/04/drive-it-yourself-the-snaefellsnes-peninsula/][Drive it yourself: The Snæfellsnes peninsula]]. - [[https://www.google.co.uk/maps/place/Efstidalur/@64.2428231,-20.5525875,17z/data%3D!3m1!4b1!4m2!3m1!1s0x48d699ea8baff6ab:0x9c26aa93153abbec?hl%3Den][Efstidalur]]: farm to table restaurant. - [[http://www.lonelyplanet.com/travel-tips-and-articles/eight-must-see-spots-in-icelands-wild-west][Eight must-see spots in Iceland's wild west]]. - [[http://www.fridrikv.is/en/][Fridrikv restaurant]]. - [[http://outfitters.is/en/][Gangleri outfitters]]. - Golden circle's waterfalls and geysers. - [[http://www.grillmarkadurinn.is/][grillmarkadurinn.is]] restaurant. - [[http://www.smaratun.is/][Horse farm hotel]]. - [[http://www.hotelbudir.is/][Hotel Budir]]. - [[http://www.lonelyplanet.com/iceland/travel-tips-and-articles/how-to-have-a-budget-break-in-iceland][How to have a budget break in iceland]]. - [[https://drive.google.com/a/google.com/file/d/0B_7OFb4eNjNWeEFzM29maE9EUkU/view][Iceland itinerary]]. - [[http://www.lebowskibar.is/][Lebowski Bar]] seriously? - Noodle Station. - [[http://www.pinkiceland.is/#!tours/cbo8][Pink Iceland tours]]. - [[https://swanhouse.is/][Reykjavik Apartment Hotel – Accommodation in City Centre (swanhouse.is)]]. - [[https://www.britishairways.com/en-gb/destinations/reykjavik/reykjavik-holidays][Reykjavik City Breaks (Book now with British Airways)]]. - [[http://sandholt.is/][Sandholt]]. - South coast's waterfalls and caves. * [2015-04-30 Thu] Building clang-format :PROPERTIES: :CUSTOM_ID: building-clang-format :END: Based on instructions from [[http://blog.hardcodes.de/articles/63/building-clang-format-and-friends-on-osx-mountain-lion][Building clang-format and friends on OSX Mountain Lion]]. #+BEGIN_SRC sh #!/bin/bash set -o nounset set -o errexit # Based on instructions from: # http://blog.hardcodes.de/articles/63/building-clang-format-and-friends-on-osx-mountain-lion readonly LLVM_DIR_PATH='/tmp/llvm' update_repo() { if [[ ! -d $1 ]]; then git clone $2 else cd $1 git pull cd .. fi cd .. } update_all_repos() { update_repo "llvm" "http://llvm.org/git/llvm.git" pushd "${LLVM_DIR_PATH}/llvm/tools" update_repo "clang" "http://llvm.org/git/clang.git" popd cd "../../${LLVM_DIR_PATH}/llvm/tools/clang/tools" update_repo "clang-tools-extra" "http://llvm.org/git/clang-tools-extra.git" cd "../../.." } build_clang() { mkdir -p clang mkdir -p build cd clang ../llvm/configure --enable-libcpp --enable-cxx11 --enable-debug-symbols=no --enable-optimized --prefix="${LLVM_DIR_PATH}/build" make install } mkdir -p $LLVM_DIR_PATH cd ${LLVM_DIR_PATH} update_all_repos build_clang #+END_SRC Bonus: use [[http://zed0.co.uk/clang-format-configurator/][clang-format-configurator]]. * [2015-04-30 Thu] Programmatic iOS Auto Layout :PROPERTIES: :CUSTOM_ID: programmatic-ios-auto-layout :END: Basic iOS auto layout usage. See [[https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/AdoptingAutoLayout/AdoptingAutoLayout.html][Adopting Auto Layout]] and [[https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/VisualFormatLanguage.html][Visual Format language]] for reference. #+BEGIN_SRC objc - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { // Disable autoresizing mask translation for parent. self.translatesAutoresizingMaskIntoConstraints = NO; _subview1 = [[UIView alloc] init]; // Disable autoresizing mask translation for subview. _subview1.translatesAutoresizingMaskIntoConstraints = NO; _subview1.backgroundColor = [UIColor redColor]; [self addSubview:_subview1]; // Creates a dictionary of bindings to be used in visual format. NSDictionary *viewBindings = NSDictionaryOfVariableBindings(_subview1); // H: horizontal layout // |-50- spacing in relation to superview // [_subview1(==50)] subview1's width [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-50-[_subview1(==50)]" options:0 metrics:nil views:viewBindings]]; [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[_subview1(==50)]" options:0 metrics:nil views:viewBindings]]; } return self; } #+END_SRC ** Also consider: - A UIView Subclass should implement intrinsicContentSize. - A UIView Subclass should never add constraints on neither itself (ie. self) nor superview. ** References - [[https://medium.com/@NSomar/auto-layout-best-practices-for-minimum-pain-c130b2b1a0f6#.uu0xxmqbr][Auto layout best practices for minimum pain]]. * [2015-04-23 Thu] Japan travel bookmarks :PROPERTIES: :CUSTOM_ID: japan-travel-bookmarks :END: :MODIFIED: [2024-02-24 Sat] :END: - [[https://www.nomadasaurus.com/things-to-do-in-yokohama-japan/][21 Awesome Things to Do in Yokohama, Japan (2020 Guide)]]. - [[http://www.lonelyplanet.com/travel-tips-and-articles/77715][21 free things to do in Tokyo]]. - [[http://www.tokyoweekender.com/2017/11/6-tokyo-travel-tips-to-help-you-get-around-the-city/][6 Tokyo Travel Tips to Help You Get Around the City | Tokyo Weekender]]. - 7 day Japan Rail pass (first class?), possibly only sold outside Japan. - [[https://publishizer.com/8020-japanese/][80/20 Japanese by Richard Webb - Publishizer]]. - [[http://luckypeach.com/a-guide-to-the-regional-ramen-of-japan/][A Guide to the regional ramen of Japan]]. - [[https://smallseasons.guide/][A guide to understanding "Small Seasons"]]. - [[http://ignition.co/398][A Moss Girl’s Guide to Japanese Moss Viewing]]. - [[http://www.lonelyplanet.com/japan/travel-tips-and-articles/77501][A no-sushi guide to food in Japan]]. - [[http://www.quora.com/How-does-it-feel-to-travel-alone#__w2_kxAuQyJ_answer_content][A trip to Japan (Quora answer)]]. - [[https://www.annees-de-pelerinage.com/tawaraya-ryokan-review-best-hotel-in-the-world/][An unsponsored review of the Tawaraya Ryokan in Kyoto, Japan]]. - [[http://www.insidekyoto.com/arashiyama-bamboo-grove][Arashiyama Bamboo Grove]]. - [[http://jnto.org.au/autumn-leaves-in-hokkaido/][Autumn Leaves in Hokkaido]]. - [[http://www.bbc.com/travel/story/20181009-japans-special-take-on-a-packed-lunch][BBC - Travel - Japan’s special take on a packed lunch]]. - [[https://www.tofugu.com/japan/bushido/][Bushido: Way of Total Bullshit]]. - [[http://www.amazon.co.uk/Drinking-Japan-Alcoholic-Beverages-Establishments/dp/4805310545][Drinking Japan]]. - [[http://www.independent.co.uk/travel/asia/five-best-japanese-ryokan-406127.html][Five Best: Japanese Ryokan]]. - Fuji Q Highland (rollercoaster theme park). Check out haunted hospital. - [[http://www.city.furano.hokkaido.jp/][Furano, Hokaido]]. - [[http://rubyronin.com/going-to-kyushu-japan-why-visiting-yakushima-is-worth-it/][Going to Kyushu, Japan? Why Visiting Yakushima is Worth it - The Ruby Ronin]]. - Guest houses: [[http://kazari-ya.com/index-e.html][Kazariya]], [[http://rakuza.gh-project.com/e/home.html][Rakuza]], [[http://ja-jp.facebook.com/musubian.kyoto][Musubian]]. - [[http://www.hiiragiya.co.jp/][Hiiragiya ryokan]]. - [[https://en.wikipedia.org/wiki/Himeji_Castle][Himeji Castle]]. - Hiroshima oysters (try the one with cheese). - [[https://en.wikipedia.org/wiki/Historic_Villages_of_Shirakawa-g%C5%8D_and_Gokayama][Historic Villages of Shirakawa-gō and Gokayama - Wikipedia]]. - Hokkaido summer flowers. - [[http://www.hyperdia.com/en/][Hypermedia (internal travel website)]]. - [[http://www.jalan.net/en/japan_hotels_ryokan/?cc%3Deng_banner][jalan.net (travel booking site)]]. - [[http://www.japan-guide.com][Japan guide]]. - [[http://jpninfo.com/][Japan Info]]. - [[https://www.thisisinsider.com/japan-program-free-abandoned-homes-2018-11][Japan is launching a program that will give away abandoned homes - INSIDER]]. - [[http://www.japan-guide.com/e/e2361.html][Japan Rail Pass]]. - [[http://www.mext.go.jp/english/highered/1303739.htm][Japan Study Program]]. - [[https://www.amazon.co.uk/JAPAN-TRAVEL-15DAYS-3-5GB-SIM/dp/B01J0Q8132][JAPAN TRAVEL DATA 15DAYS, 3.5GB on 4G/LTE- NANO SIM]]. - [[https://www.japantimes.co.jp/news/2017/12/26/national/japans-glut-abandoned-homes-hard-sell-bargains-opportunity-knocks/][Japan's glut of abandoned homes: Hard to sell but bargains when opportunity knocks (The Japan Times)]]. - [[http://www.lonelyplanet.com/travel-tips-and-articles/the-other-japan-okinawas-secret-beaches][Japanese beaches]]. - [[https://gurunavi.com/][Japanese Foods Encounter Like No Others (food search)]]. - [[http://japaneseruleof7.com/][Japanese rule of 7]]. - [[https://www.nippon.com/en/features/h00124/][Japan’s 72 Microseasons]]. - [[http://www.japanonwheels.com/kawachi_fujien.html][Kawachi Fujien 河内藤園 (Kawachi Wisteria Garden)]]. - [[http://www.japanese-incense.com/kodo-censer.htm][Kodo -- Preparing the Censor]]. - [[https://cromwell-intl.com/travel/japan/koyasan/kongo-sanmai-in.html][Kongō Sanmai-in at Kōya-san]]. - [[https://news.ycombinator.com/item?id=13136252][Koya Bound – Eight Days on the Kumano Kodo | Hacker News]]. - [[http://eng.shukubo.net/][Koyasan (needs booking)]]. - [[http://landedbook.com/landed-japan/][Landed Japan Book (local knowledge to buy Japanese real estate)]]. - [[http://www.japan-guide.com/e/e3912.html][Lots of goodies. Bamboo forest, oh my]]. - [[https://blackshipcoffee.com/cafe/][Michael’s Cafe American – Black Ship Coffee]]. - [[http://visit-miyajima-japan.com/en/][Miyajima: One of the top three scenic spots in Japan]]. - [[https://www.flickr.com/photos/26608745@N05/2845439357/][Monument in front of the Shin-Yatsushiro Station]]. - [[https://duckduckgo.com/?q=Nagakushiyama+park%2C+Japan+&t=ffsb&iax=1&ia=images][Nagakushiyama park]]. - [[https://en.wikipedia.org/wiki/Nagoya][Nagoya]]. - Natadera Temple in winter. - [[http://www.skijapan.com/resorts/niseko/][Niseko Ski Resort]]. - [[https://www.lonelyplanet.com/japan/okinawa-and-the-southwest-islands/okinawa-honto/travel-tips-and-articles/the-other-japan-okinawas-secret-beaches][Okinawa: secrets for a long and happy life]]. - Okonomimura (all okonomiyaki restaurants). - Onsen. - [[http://www.quora.com/What-are-some-of-Japans-best-kept-secrets][Quora: What are some of Japans best kept secrets]]? - [[https://www.youtube.com/watch?v=geZWL_gE-Ak][Saitamaya: The Master of Grilled Meat - YouTube]]. - [[https://www.historynet.com/satsuma-rebellion-satsuma-clan-samurai-against-the-imperial-japanese-army.htm][Satsuma Rebellion: Satsuma Clan Samurai Against the Imperial Japanese Army]]. - [[https://twitter.com/tokyo_gov/status/1146931698837291008][Shitamachi #Museum in Ueno and catch a glimpse into old-fashioned living]]. - [[https://en.wikipedia.org/wiki/Siege_of_Kumamoto_Castle][Siege of Kumamoto Castle (Wikipedia)]]. - [[https://news.ycombinator.com/item?id=18442097][Snapshots of Tokyo’s vivid street life (Hacker News)]]. - [[http://marc.merlins.org/perso/japan2013/links.html][Table of Content for japan2013]]. - [[http://marc.merlins.org/perso/japan2014/links.html][Table of Content for japan2014]]. - [[http://marc.merlins.org/perso/japan2015/links.html][Table of Content for japan2015]]. - [[http://www.4wd-networks.com/makers/detail/takazawa-candle.html][TAKAZAWA Candle (or look for ikaragata shape candle)]]. - [[https://visithachinohe.com/en/stories/the-2020-hachinohe-enburi-festival-schedule/][The 2020 Hachinohe Enburi Festival Schedule (Sakura festival)]]. - [[http://jpninfo.com/13012][The village of living water]]. - [[https://www.quora.com/What-are-the-most-inconvenient-things-foreign-tourists-who-travel-to-Japan-experience][Things to look out for in Japan (Quora)]]. - [[https://www.japan-guide.com/list/e1102.html][Tohoku Travel Guide]]. - [[https://en.wikipedia.org/wiki/Sukiyaki][Try out sukiyaki]]. - [[https://docs.google.com/document/d/1wjqJKYEKbHSUTsj8Lxj8OCn0gSOXOpf_SroyBEjLbKY/edit][Uncharted Tokyo]]. - [[https://www.vitra.com/en-gb/magazine/details/the-hill-of-the-buddha][Vitra | The Hill of the Buddha]]. - [[http://www.mymodernmet.com/profiles/blogs/zao-fox-village-miyagi-japan][Zao Fox Village]]. - [[http://hekiunsou.jp/][国指定重要文化財「野村別邸 碧雲荘」]]. * [2015-10-21 Wed] Kyoto travel bookmarks :PROPERTIES: :CUSTOM_ID: kyoto-travel-bookmarks :END: :MODIFIED: [2020-12-29 Tue] :END: - [[http://www.everintransit.com/nishiki-market-tour-kyoto/][Eating My Way Through Nishiki Market, Kyoto | Ever In Transit]]. - [[http://en.wikipedia.org/wiki/Fushimi_Inari-taisha][Fushimi Inari Temple]]: 4KM mountain trail lined with bright orange shinto gates. - Golden Pavillion (macha and biscuits at tea house). - Hakone (day trip for hot baths), see Yuryo spa. Also the pirate boat. - [[http://www.aaronwilliamson.com/old_web/travel/japan/kibune/kibune.htm][Kibune]]. - [[http://en.wikipedia.org/wiki/Kinkaku-ji][Kinkakuji Temple]]. - [[http://en.wikipedia.org/wiki/Kiyomizu-dera][Kiyomizu Temple]]. - Kuramadera Temple & Kibune Shrine: More peaceful shrine. - [[http://www.insidekyoto.com/kyoto-itineraries][Kyoto itineraries]]. - [[https://docs.google.com/document/d/1bQb4GeiTElx0Gsv84wTDQlOVrbkqwTChSnMPMzrCcr4/edit?authkey%3DCJPtzocJ&hl%3Den_US&authkey%3DCJPtzocJ][Kyoto travel tips (doc)]]. - [[http://www.kyotoguide.com/ver2/walking/walking-top.html][Kyoto walking maps]]. - Kyoto's train station itself. - [[http://en.wikipedia.org/wiki/Nij%C5%8D_Castle][Nijo-Jo’]]. - Nishiki Market: Awesome market. Some say better than Tsukiji. - Origami master and school http://www.orizurusalon-yume.com info@orizurusalon-yume.com - [[http://www.orizurusalon-yume.com/][orizurusalon yume (origami)]]. - Ryokan ("kaiseki" meals). - Ryōan-ji (竜安寺). - [[http://en.wikipedia.org/wiki/Sanj%C5%ABsangen-d%C5%8D][Sanjusangendo]]. - [[http://globalhelpswap.com/things-to-do-in-kyoto-japan/][Things to do in Kyoto, Japan]]. - [[http://maps.google.com/maps/ms?msid%3D202789377275033201812.00049d620c1fcd8fb451e&msa%3D0&ll%3D35.019734,135.756168&spn%3D0.093628,0.181789][Walking courses (Google maps)]]. - [[http://www.waraido.com/walking/gion.html][WaRaiDo Nighttime tour]]. * [2015-04-19 Sun] Tokyo travel bookmarks :PROPERTIES: :CUSTOM_ID: tokyo-travel-bookmarks :END: :MODIFIED: [2021-12-03 Fri] :END: - [[https://roadsandkingdoms.com/travel-guide/tokyo/know-before-you-go-to-tokyo/][14 Things to Know Before You Go to Tokyo]]. - [[http://globalhelpswap.com/5-alternative-things-to-do-in-tokyo/][5 alternative things to do in Tokyo (by globalhelpswap)]]. - [[https://roadsandkingdoms.com/travel-guide/tokyo/a-history-of-tokyo-in-8-dishes/][A History of Tokyo in 8 Dishes]]. - Akasaka area (N/E of Roppongi). - Cup noodle museum. - Ginza Kimuraya (bakery). Try anpan (invented here). - Ichiran Ramen. - Pan No Tora Bakery (Kyoto?). - Zauo.com "Let's fixhing enjoy". Catch your own fish to eat. - Akasaka Sagamiya (also Mamekan, established in 1895). - Akihabara: Electronics district, arcades and comic stores. - Asakusa (tourist spot). Kaminarimon, Nakamise (oldest shopping street in Japan). Sensoji Temple. - [[https://www.hokke.co.jp/english/asakusa/][Asakusa hotel]]. - Asakusa Shrine: Shinto shrine and market. - [[http://bar-navi.suntory.co.jp/shop/0334413588/index.html][Bar Epilogue]]. - [[http://authenticbar.com/odin/yebisu.html][Bar Odin]]. - [[https://www.tripadvisor.co.uk/Restaurant_Review-g1066461-d1688630-Reviews-Benten-Taito_Tokyo_Tokyo_Prefecture_Kanto.html][Benten, Taito - 3-21-8 Asakusa, Ueno, Asakusa (Buckwheat noodles shop)]]. - Bentomi (Sushi). - [[https://cheese-stand.com/][CHEESE STAND (チーズスタンド)]]. - Coffee Tengoku, Asakusa (best hotcakes/pancakes). Noting is premade. After 12 years, best hotcakes. - [[http://tabelog.com/en/tokyo/A1313/A131301/13002389/][Daiwasushi (food)]]. An account [[http://mjkobb.com/Prattling%20on/6570A66F-8F2F-49FD-912C-4A5D0C3862C8.html][here]]. - Dorayaki (in Ukenbukuru). Seijuken is long established in Ningyocho. - [[http://dairycream.blogspot.co.uk/2016/07/doteno-iseya-127-year-old-tempura-don.html][Doteno-Iseya 土手の伊勢屋: 127-year old Tempura]]. - Eateries around Takadanobaba eki - Ebisu (area for izakaya experience, drink/chat with bartender). Look for Ebisu Yokocho. - Fish market (6am sushi). - [[https://en.rocketnews24.com/2017/10/11/five-of-the-worst-areas-to-live-in-and-around-tokyo/?utm_content=buffer38deb&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer][Five of the worst areas to live in and around Tokyo | SoraNews24]]. - [[http://www.tokyoeats.jp/fuunji/][Fu-unji & 風雲児 | Tokyo Eats]]. - [[http://www.ghibli-museum.jp/en/welcome][Ghibli museum]] (book in advance or try [[http://www.lawson.co.jp/ghibli/museum/ticket/english.html][lawson]]). - Ginza. - [[http://tabelog.com/en/tokyo/A1301/A130103/13002611/][Ginzakyuubee (food)]]. - [[http://unmissabletokyo.com/golden-gai][Golden Gai (lots tiny bars)]]. - [[https://blog.govoyagin.com/tokyo-christmas][How to Spend a Magical Christmas in Tokyo (2019 update)]]. - https://www.timeout.com/tokyo/restaurants/tokyo-coolest-kakigori - Imperial Palace: Book to go inside. Beautiful park, great for pictures. - Irie known (sweet shop) for Mamekan. In Monzen-Nakacho. - Isetan (upscale food market). - [[http://tabelog.com/en/tokyo/A1313/A131301/13091991/][Isozushi (food)]]. - [[https://trulytokyo.com/jimbocho-book-town/][Jimbocho Book Town (largest second-hand book town in the world, classic-style cafes, old school charm)]]. - Kaiden-don, near tsukiji (Sushi). - Kajitsuen Libre. Peach Parfait. Fresh fruit. - Kinozen restaurant for Matcha Bavarian cream (matcha bavaroa). Kagurazaka. Check out the backstreets. - [[http://www.waentei-kikko.com/][Kodai's Fukui restaurant (old tea house)]]. - Kushikatsu restaurant in Golden Gai, a karaoke booth in Ebisu, or drifting through the back alley izakayas of Akabane. - Menya Musashi and Fuunji are both generally very well regarded and about a 5-7 minute walk from the SW part of Shinjuku station. - [[http://openbuildings.com/buildings/mikimoto-ginza-2-profile-2818][Mikimoto building in Ginza]]. - [[http://www.mori.art.museum/eng/index.html][Mori Art museum]]. - [[https://www.google.co.uk/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=musashiya+tripadvisor+tokyo][Musashiya ramen]]. - [[https://tokyocheapo.com/food-and-drink/michelin-star-ramen-nakiryu/][Nakiryu: Tantalizing Tantanmen Noodles with a Michelin Star]]. - [[https://en.wikipedia.org/wiki/Nezu_Museum][Nezu museum]]. - [[https://www.gotokyo.org/en/destinations/southern-tokyo/odaiba/index.html][Odaiba]]. - [[http://tokyoplaying.blogspot.co.uk/2012/01/not-japanese-pizza-okonomiyaki-in.html][Okonomiyaki in Tokyo]]. - Omoide yokocho: Alleyway next to Shinjuku station. Lots of yakitori restaurants. - [[http://ooo-koffee.com/][Omotesando Koffee]] (coffee and baked custard slice). - Omotesando side streets. - [[http://pignontokyo.jp/][Pignon | French Restaurant]]. - Pound cake from Patisserie Gondola in Kudanue. - Roppongi. - Savarin (brioge-based, of french origin) in Yokohama. Cafe Recherche. - Seafood street south of Ueno eki - [[https://www.huckmag.com/art-and-culture/photography-2/tokyo-street-photographer-mikiko-hara/][Secret snapshots of Tokyo vivid street life]]. - [[https://livejapan.com/en/in-shibamata_kita-senju_kameari/article-a0001571/][Shibamata: Snacking and Sightseeing in Tokyo’s Old Edo Neighborhood]]. - Shibuya Crossing: Largest pedestrian crossing in the world. - Shimokitazawa (Shimokita for short). Bohemian, vintage shopping. - Shimokitazawa (thirft stores, music bands, pubs, and cafes). - [[http://tabelog.com/en/tokyo/A1301/A130101/13002260/][Sukiyabashi Jiro]]. - Sushi dai (Sushi, long queue, maybe turisty). - [[http://tabelog.com/en/tokyo/A1301/A130103/13005003/][Sushi Kanesaka]]. - Sushi places around Tsukiji market in the morning (much better than the market visit itself, these days) - [[http://tabelog.com/en/tokyo/A1308/A130802/13015251/][Sushi Saito]]. - [[http://tabelog.com/en/tokyo/A1313/A131301/13002388/][Sushidai (food)]]. - [[http://tabelog.com/en/tokyo/A1307/A130701/13061640/][Sushitsu (food)]]. - [[http://tabelog.com/en/tokyo/A1316/A131603/13013967/][Sutekihausukatsura]]. - [[http://www.japan-guide.com/e/e3029.html][Takaosan (Mount Takao)]]. - [[https://www.minube.com/rincon/restaurante-tsunahachi-a186891][Tempura Tsunahachi en Tokio: 4 opiniones y 7 fotos]]. - [[http://tabelog.com/en/tokyo/A1303/A130301/13001783/][Tenkazushi (food)]]. - The whole of Kabukicho (area in-between Shinjuku station and Shin-Okubo) - [[http://www.ytravelblog.com/things-to-do-in-tokyo-japan/][Things to Do in Tokyo Japan - Sunday Spotlight]]. - [[https://twitter.com/tokyo_gov/status/1201652265649606656][Tokyo Gov on Twitter: Higashikurume Station]]. - [[https://www.lonelyplanet.com/japan/travel-tips-and-articles/tokyo-in-winter-what-to-see-do-and-eat/40625c8c-8a11-5710-a052-1479d276b0f5][Tokyo in winter: what to see, do and eat (Lonely Planet)]]. - Tokyo Municipal Government building: Only for observation deck with view to Fuji (if clear day). - [[https://www.lonelyplanet.com/japan/tokyo/travel-tips-and-articles/tokyo-on-a-budget-tips-for-making-your-yen-go-further/40625c8c-8a11-5710-a052-1479d2775214?utm_campaign=article&utm_medium=social&utm_source=twitter&utm_content=Tokyo%20on%20a%20budget:%20tips%20for%20making%20your%20yen%20go%20further][Tokyo on a budget: tips for making your yen go further (Lonely Planet)]]. - [[http://tokyoplaying.blogspot.co.uk/][Tokyo play blog]]. - [[http://japaneseruleof7.com/tokyo-salaries-all-you-need-to-know][Tokyo Salaries: all you need to know]]. - Tokyo station: Friendly JR office (english spoken). They help book all trips/tickets/reservations. - Tokyo Station: Massive station. Lots of restaurants and shops (check out ramen street). - [[http://coffeeandpassport.com/tokyo-travel-tips/][Tokyo Travel Tips: 5 Things You Need In Japan | Coffee and Passport]]. - [[https://twitter.com/yanarchy/status/1162570360769798144][Tokyo Twitter: any Japanese breakfast restaurants]]. - [[https://www.cntraveller.com/article/travel-guide-tokyo][Tokyo, Japan - Condé Nast Traveller | CN Traveller]]. - [[http://tokyocheapo.com/][TokyoCheapo]]. - Tokyu Hands and Loft (shops in Shibuya). - Toritake (yakitori at Shibuya). - Try Mos rice burger (fast food). - Try out Pancan (bread in can). - [[http://www.tsukiji-market.or.jp/etc/calendar/2016.html][Tsukiji Fish Market calendar]]. - Tsukiji Fish Market: Sushi bars and food vendors (get there early, visitor numbers restricted). - Umemura in Asakusa (also Mamekan). - Yurakucho Yakitori Alley - [[http://tabelog.com/en/tokyo/A1303/A130301/13058009/][婁熊東京 (raw and grilled pork)]]. - [[http://r.tabelog.com/tokyo/A1307/A130701/13041724/][酒友]] (Sake & good Shabushabu), Roppongi. * [2015-04-19 Sun] UK travel bookmarks :PROPERTIES: :CUSTOM_ID: uk-travel-bookmarks :END: :MODIFIED: [2021-07-11 Sun] :END: - [[http://www.buzzfeed.com/chelseypippin/25-wanderlust-worthy-day-trips-from-london#.xbkbNaApW][25 stunning british places you can reach from London]]. - [[https://twitter.com/ddoniolvalcroze/status/1278326573070876672][A graveyard of red telephone boxes located in the small village of Carlton Miniott]]. - [[https://en.wikipedia.org/wiki/Dunmore_Pineapple][Dunmore Pinapple]]. - [[http://www.hitchinlavender.co.uk/][Hitchin Lavender]]. - [[http://www.theguardian.com/travel/2015/may/10/scotland-beach-swimming-wild-camping][In search of Scotland’s best beach]]. - [[http://www.seemytravels.com/2015/01/23/the-isle-of-man-mist/][Isle of Man]]. - [[https://en.wikipedia.org/wiki/Sandwood_Bay][Sandwood Bay]]. - [[https://duckduckgo.com/?q=sark+island&t=ffsb&iax=1&ia=images][Sark island]]. - [[http://www.theguardian.com/travel/2015/aug/23/scotland-north-coast-500-road-trip?CMP%3Dshare_btn_tw][Scotland’s new North Coast 500 route]]. - [[https://www.lonelyplanet.com/amp/articles/best-hikes-in-england][The 8 most dramatic hikes in England]]. - [[http://www.thenewforest.co.uk/][The New Forest]]. - [[http://www.seemytravels.com/2015/02/15/where-to-find-street-art-in-liverpool/][Where to Find Street Art in Liverpool]]. - [[http://www.x-pilot.co.uk/][X-Pilot (Redsand towers)]]. * [2015-04-19 Sun] Development quotes :PROPERTIES: :CUSTOM_ID: development-quotes :END: - [[https://twitter.com/giorgiosironi/status/587507955521708032][If your backlog is exploding the problem is not that your developers are slow, but that your business model is not based on reality]]. - [[http://redux.js.org/docs/introduction/PriorArt.html][If you lose out on object allocation, you still win by avoiding expensive re-renders and re-calculations]]. - [[https://www.sandimetz.com/blog/2016/1/20/the-wrong-abstraction][Duplication is far cheaper than the wrong abstraction (prefer duplication up to a point)]]. - [[https://en.wikipedia.org/wiki/Rule_of_three_(computer_programming)][Choosing an appropriate design to duplication avoid might benefit from more examples to see patterns in. Attempting premature refactoring risks selecting a wrong abstraction]]. - [[https://www.deconstructconf.com/2017/brian-marick-patterns-failed-why-should-we-care][Patterns failed, why we should case]]. * [2015-04-19 Sun] Development philosophy :PROPERTIES: :CUSTOM_ID: development-philosophy :END: - Boyscout rule: Leave campground cleaner than found. - [[https://nibblestew.blogspot.com/2019/12/what-can-clang-format-teach-us-about.html?m=1][What can clang-format teach us about the human condition?]]. * [2015-04-19 Sun] Spain travel bookmarks :PROPERTIES: :CUSTOM_ID: spain-travel-bookmarks :END: :MODIFIED: [2020-12-18 Fri] :END: - [[https://www.larecomendadora.com/2019/11/cafeterias-bonitas-originales-encanto-madrid.html][7 CAFETERIAS BONITAS, ORIGINALES y CON ENCANTO en MADRID]]. - [[https://www.tripadvisor.co.uk/Restaurant_Review-g187514-d6673431-Reviews-Bomboneria_Santa-Madrid.html][BOMBONERIA SANTA, Madrid - Barrio de Salamanca]]. - [[https://www.timeout.com/madrid/cinemas/cine-dore-filmoteca-espanyola][Cine Doré Filmoteca Española | Cinemas in Lavapiés, Madrid]]. - [[https://www.timeout.com/madrid/art/espacio-fundacion-telefonica][Espacio Fundación Telefónica | Art in Malasaña, Madrid]]. - [[https://www.timeout.com/madrid/art/fundacion-masaveu][Fundación Masaveu | Art in Madrid, Madrid]]. - [[https://www.larecomendadora.com/2019/10/juanchis-burgers-hamburguesas-madrid.html][JUANCHI'S BURGERS]]. - [[https://laduquesita.es/][La Duquesita. Pastelería - Bombonería - Confitería repostería desde 1914]]. - [[https://en.wikipedia.org/wiki/La_Palma][La Palma, most north-westerly of the Canary Islands]]. - [[https://www.facebook.com/pages/La-Perejila/116839091715751][La Perejila - Madrid - Bar de tapas y restaurante, Restaurante español]]. - [[http://www.tripadvisor.com/ShowUserReviews-g1802172-d1887157-r141602833-El_Lago_Verde-El_Golfo_Lanzarote_Canary_Islands.html][Lanzarote's green lagoon]]. - [[https://www.viajenaviagem.com/destino/madri/onde-comer-madri/][Madri: onde comer | Restaurantes e bares de tapas recomendados]]. - [[http://www.madricioso.com][Madricioso]]. - [[https://www.timeout.com/madrid/art/matadero-madrid][Matadero Madrid | Art in Legazpi, Madrid]]. - [[http://www.mataderomadrid.org][Matadero Madrid. Centro de creación contemporánea]]. - [[https://www.timeout.com/madrid/shopping/mercado-de-san-fernando][Mercado de San Fernando | Shopping in Lavapiés, Madrid]]. - [[https://www.timeout.com/madrid/things-to-do/mercado-de-vallehermoso][Mercado de Vallehermoso | Things to do in Chamberí, Madrid]]. - [[https://commons.wikimedia.org/wiki/Category:Rock_carved_hermitage_of_Saints_Justus_and_Pastor,_Olleros_de_Pisuerga][Rock carved hermitage of Saints Justus and Pastor, Olleros de Pisuerga]]. - [[https://eltriciclo.es/triciclo/][triciclo - grupotriciclo]]. * [2015-04-19 Sun] Meet up bookmarks :PROPERTIES: :CUSTOM_ID: meet-up-bookmarks :END: - [[https://www.couchsurfing.com][Couchsurfing.org]]. - [[http://www.meetup.com/][Meetup]]. - [[http://teawithstrangers.com][Tea with strangers]]. * [2015-04-17 Fri] Plantuml example :PROPERTIES: :CUSTOM_ID: plantuml-example :END: Played with [[http://plantuml.sourceforge.net/PlantUML_Language_Reference_Guide.pdf][Plantuml]]. Convenient for generating UML diagrams from text. Here's the [[http://plantuml.sourceforge.net/PlantUML_Language_Reference_Guide.pdf][Language Reference Guide]]. Here's an example: #+BEGIN_SRC plantuml :exports both :file images/plantuml-example/plantuml-singer.png @startuml abstract class Singer { abstract void sing() void Dance() } skinparam monochrome true Singer <|-- PopSinger Singer <|-- SalsaSinger class PopSinger { void sing() } class SalsaSinger { void sing() } @enduml #+END_SRC #+RESULTS: [[file:images/plantuml-example/plantuml-singer.png]] Install plantuml on Mac OS X: #+BEGIN_SRC sh brew install plantum #+END_SRC Generating diagram: #+BEGIN_SRC sh $GRAPHVIZ_DOT=~/homebrew/bin/dot java -jar path/to/plantuml.8018.jar diagram.plantuml #+END_SRC ps. Installation and verification [[https://gist.github.com/NLKNguyen/c39596c205ba1f1866c8][gist]]. ps2. More handy UML examples in this [[https://github.com/xenodium/uml][fork]]. * [2015-04-14 Tue] Helm-describe-helm-attribute :PROPERTIES: :CUSTOM_ID: helm-describe-helm-attribute :END: [[https://www.youtube.com/watch?v%3DXjKtkEMUYGc][Writing A Spotify Client in 16 Minutes]] is fantastic for picking up helm and Emacs lisp tips. Of interest helm-describe-helm-attribute, second to the awesomeness of helm-spotify integration. #+BEGIN_SRC html #+END_SRC * [2015-04-12 Sun] Youtube videos in your org html export :PROPERTIES: :CUSTOM_ID: youtube-videos-in-your-org-html-export :END: [[https://twitter.com/sachachua][Sacha Chua]] and [[https://twitter.com/jwiegley][John Wiegley]] posted a wonderful video on [[http://sachachua.com/blog/2015/04/2015-04-08-emacs-lisp-development-tips-with-john-wiegley][Emacs lisp development tips]]. Embedding the following raw HTML using #+BEGIN_HTML/#+END_HTML: #+BEGIN_SRC html #+END_SRC results in an embedded video when exporting your org file: #+BEGIN_SRC html #+END_SRC * [2015-04-12 Sun] .net bookmarks :PROPERTIES: :CUSTOM_ID: dot-net-bookmarks :END: :MODIFIED: [2019-01-27 Sun] :END: - [[http://thomasvm.github.io/blog/2015/03/17/open-source-net-libraries-that-make-your-life-easier/][Open Source .Net libraries that make your life easier]]. * [2015-04-10 Fri] UK property bookmarks :PROPERTIES: :CUSTOM_ID: uk-property-bookmarks :END: - [[http://commutefrom.com/][Commute from]] (find property based on potential commute). - [[http://property.mapumental.com][Mapumental Property]] (find property by travel time). * [2015-04-09 Thu] Git commit message style :PROPERTIES: :CUSTOM_ID: git-commit-message-style :END: Adopted Tim Pope's Git commit message [[http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html][style]]. Also enabled Emacs's git-commit-training-wheels-mode: #+BEGIN_SRC emacs-lisp (use-package git-commit-training-wheels-mode :ensure t :commands (git-commit-training-wheels-mode)) (use-package git-commit-mode :ensure t :config (add-hook 'git-commit-mode-hook 'git-commit-training-wheels-mode) :commands (git-commit-mode)) #+END_SRC Another great [[http://chris.beams.io/posts/git-commit/][post]] by Chris Beams. * [2015-04-06 Mon] fci-mode and org-html-export-to-html bug :PROPERTIES: :CUSTOM_ID: fci-mode-and-org-html-export-to-html-bug :END: Having enabled fci-mode in most programing modes, org-html-export-to-html now exports an additional unicode character in source blocks. This [[http://lists.gnu.org/archive/html/emacs-orgmode/2014-09/msg00777.html][thread]] has a workaround: #+BEGIN_SRC emacs-lisp (defun org-html-fontify-code (code lang) ;; ... (funcall lang-mode) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (when (require 'fill-column-indicator nil 'noerror) (fci-mode -1)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (insert code) ;; ... #+END_SRC * [2015-04-03 Fri] Try cocoapods out :PROPERTIES: :CUSTOM_ID: try-cocoapods-out :END: [[https://github.com/CocoaPods/cocoapods-try][Cocapods try]]: #+BEGIN_SRC sh $ pod try POD_NAME #+END_SRC * [2015-04-03 Fri] Cornwall travel bookmarks :PROPERTIES: :CUSTOM_ID: cornwall-travel-bookmarks :END: - [[http://barefootcornwall.com/on-the-road/][Food along the way]]. * [2015-04-03 Fri] Austria travel bookmarks :PROPERTIES: :CUSTOM_ID: austria-travel-bookmarks :END: :MODIFIED: [2015-06-02 Tue] :END: - [[https://www.lonelyplanet.com/austria/vienna/travel-tips-and-articles/coffee-house-culture-in-vienna-where-to-get-your-caffeine-hit][Coffee houses in Vienna]]. - [[https://duckduckgo.com/?q%3Dmelk%2Baustria%2Blibrary&iax%3D1&ia%3Dimages][Melk Abbey library]]. * [2015-04-02 Thu] Cinnamon desktop run dialog :PROPERTIES: :CUSTOM_ID: cinnamon-desktop-run-dialog :END: Note to self. Open with Alt-f2. * [2015-03-29 Sun] Books for 2015 :PROPERTIES: :CUSTOM_ID: books-for-2015 :END: - [[http://www.amazon.co.uk/Catch-22-Vintage-Classics-Joseph-Heller/dp/0099470462][Catch 22]]. - [[http://www.amazon.co.uk/Circle-Dave-Eggers/dp/0804172293][The Circle]]. - [[http://www.amazon.co.uk/Born-Run-Hidden-Ultra-Runners-Greatest/dp/1861978774][Born to Run]]. - [[http://www.amazon.co.uk/Thinking-Fast-Slow-Daniel-Kahneman/dp/0141033576][Thinking, Fast and Slow]]. * [2015-03-29 Sun] Ayahuasca bookmarks :PROPERTIES: :CUSTOM_ID: ayahuasca-bookmarks :END: - [[http://ayaadvisor.org/listings/onanya-joni-shipibo-europe/][Ayaadvisor]]. - [[https://www.erowid.org/chemicals/ayahuasca/ayahuasca_death.shtml][Ayahuasca fatalities]]. - [[https://erowid.org/chemicals/ayahuasca/][Ayahuasca on erowid]]. - [[http://www.cbc.ca/m/news/canada/jennifer-logan-s-death-in-peru-puts-focus-on-purging-ceremonies-1.2948955][Jennifer Logan's death in Peru]]. - [[https://medium.com/@Grayfox/the-hacker-who-drank-ayahuasca-517148aa1ed4][The hacker who drank Ayahuasca]]. * [2015-03-28 Sat] Emacs init.el bookmarks :PROPERTIES: :CUSTOM_ID: emacs-init.el-bookmarks :END: :MODIFIED: [2020-12-12 Sat] :END: - [[https://github.com/daschwa/emacs.d][Adam Schwartz's init]]. - [[https://github.com/apg/emacs-config/tree/master/lisp/activator.d][Andrew Gwozdziewycz's init.el]]. - [[http://www.cs.utah.edu/~aek/code/init.el.html][Andrew Kensler's init.el]]. - [[https://github.com/Droogans/.emacs.d/blob/mac/init.el][Andrew's .emacs]]. - [[https://github.com/ikame/.emacs.d-literate][Anler Hernandez's literate config]]. - [[https://github.com/redguardtoo/emacs.d/][Chen Bin's init.el]]. - [[https://github.com/eastwood/config/blob/master/emacs.d/org-init.org][Clinton Ryan's init (JS config)]]. - [[https://github.com/daviderestivo/emacs-config/blob/master/README.md][daviderestivo/emacs-config (clean/macOS)]]. - [[https://github.com/iocanel/dotfiles/blob/master/.config/emacs/config.org][dotfiles/config.org at master · iocanel/dotfiles · GitHub (mu4e config)]]. - [[https://www.emacswiki.org/emacs/StarterKits][EmacsWiki: Starter Kits]]. - [[https://github.com/ejmr/DotEmacs/blob/master/.emacs][Eric James Michael Ritz]]. - [[https://github.com/alhassy/emacs.d][GitHub - alhassy/emacs.d: My Emacs configuration, literately]]. - [[https://github.com/rememberYou/.emacs.d/][GitHub - FIXME rememberYou/.emacs.d: Personal GNU Emacs configuration]]. - [[https://github.com/Fuco1/.emacs.d][GitHub - Fuco1/.emacs.d: My emacs config]]. - [[https://github.com/MatthewZMD/.emacs.d][GitHub - MatthewZMD/.emacs.d: M-EMACS, a full-feature GNU Emacs configuration]]. - [[https://github.com/zamansky/emacs.dz][GitHub - zamansky/emacs.dz: Awesome emacs config files]]. - [[https://github.com/zoliky/dotemacs][GitHub - zoliky/dotemacs: My GNU Emacs configuration (super clean)]]. - [[https://github.com/grettke/home/blob/master/ALEC.txt][Grant Rettke's literate config]]. - [[http://doc.rix.si/org/fsem.html][Hardcore Freestyle Emacs]]. - [[https://github.com/huseyinyilmaz/emacs-config/blob/master/lisp/user-init.el][Huseyin Yilmaz]]. - [[https://github.com/ianpan870102/.personal-emacs.d/blob/master/init.el][ianpan870102/.personal-emacs.d]]. - [[http://ivanmalison.github.io/dotfiles/][Ivan Malison's Emacs init]]. - [[http://ivanmalison.github.io/dotfiles/#colorizecompliationbuffers][Ivan Malison's init.el]]. - [[http://www.john2x.com/emacs.html][John's Emacs Config (mu4e and ledger usage)]]. - [[https://justin.abrah.ms/dotfiles/emacs.html][Justin Abrahms: My Emacs Configuration]]. - [[https://ladicle.com/post/config/][Ladicle's Emacs Configuration]]. - [[https://github.com/MatthewZMD/.emacs.d#lsp][M-EMACS's lsp config]]. - [[https://github.com/msparks/dotfiles/blob/master/.emacs][Mark Sparks's init.el]]. - [[https://github.com/CQQL/dotfiles/blob/master/src/.emacs.d/init.el][Marten Lienen's init.el]]. - [[http://writequit.org/org/settings.html][Mathew Lee Hinman's Emacs settings file]]. - [[https://github.com/angrybacon/dotemacs/blob/master/dotemacs.org][Mathieu Marques's wonderful literary config (uses tern for Javascript)]]. - [[https://github.com/abdullin/emacs.d/blob/master/emacs.org][Rinat Abdullin's literary config]]. - [[https://github.com/To1ne/temacco][Temacco's init]]. - [[https://gitlab.com/to1ne/temacco][Temacco's Plutonium empowered emacs]]. - [[https://github.com/wasamasa/dotemacs/blob/master/TODO.org][Wasamama's extensive init TODO ]]. - [[http://zzamboni.org/post/my-emacs-configuration-with-commentary/][zzamboni.org | My Emacs Configuration, With Commentary]]. - [[https://etienne.depar.is/emacs.d/init.html][Étienne Deparis's Emacs Main Initialization File]]. * [2015-03-28 Sat] CSS vertical align using flex :PROPERTIES: :CUSTOM_ID: css-vertical-align-using-flex :END: Codepen [[http://codepen.io/oisinlavery/pen/Jmjtz][snippet]]: #+BEGIN_SRC css div{ height: 200px; background: #ccc; display: flex; justify-content: center; align-items: center; } p{ margin: auto } #+END_SRC * [2015-03-26 Thu] London diving schools :PROPERTIES: :CUSTOM_ID: london-diving-schools :END: - [[http://londonschoolofdiving.co.uk][London Diving School]]. Not heard good comments. - [[http://www.divewimbledon.com][Dive Wimbledon]]. Heard ok comments. - [[http://www.clidive.org/][Clidive]] is a BSAC club (amateur organisation). Not commercial but may take longer. - [[http://www.sublimediving.co.uk/][Sublime Diving]]. Heard good comments. - [[http://www.oysterdiving.com/][Oyster Diving]]. Pool in cetral London. Good comments. - [[http://en.wikipedia.org/wiki/SS_Thistlegorm][SS Thistlegorm]] mentioned as a memorable site. - Many suggest to get certified elsewhere. Perhaps Egypt via [[http://www.poseidondivers.com/][Poseidon Divers]]. * [2015-03-26 Thu] Helm buffer URLs :PROPERTIES: :CUSTOM_ID: helm-buffer-urls :END: Venturing into Emacs lisp and [[https://github.com/emacs-helm/helm][Helm]]. Here's a go at listing all URLs in current buffer. #+BEGIN_SRC emacs-lisp (require 'goto-addr) (defun ar/helm-buffer-url-candidates () "Generate helm candidates for all URLs in buffer." (save-excursion (goto-char (point-min)) (let ((helm-candidates '()) (url)) (while (re-search-forward goto-address-url-regexp nil t) (setq url (buffer-substring-no-properties (match-beginning 0) (match-end 0))) (add-to-list 'helm-candidates (cons url url))) helm-candidates))) (defun ar/helm-buffer-urls () "Narrow down and open a URL in buffer." (interactive) (helm :sources `(((name . "Buffer URLs") (candidates . ,(ar/helm-buffer-url-candidates)) (action . (lambda (url) (browse-url url))))))) #+END_SRC * [2015-03-23 Mon] Doh! undo last git commit :PROPERTIES: :CUSTOM_ID: doh-undo-last-git-commit :END: #+BEGIN_SRC sh $ git reset --soft HEAD~1 #+END_SRC * [2015-03-22 Sun] Resetting variables using defvar :PROPERTIES: :CUSTOM_ID: resetting-variables-using-defvar :END: Want to re-evaluate defvars and modify variables? eval-defun (bound to C-M-x) can help. From the manual: #+BEGIN_QUOTE If the current defun is actually a call to `defvar', then reset the variable using its initial value expression even if the variable already has some other value. (Normally `defvar' does not change the variable's value if it already has a value.) Treat `defcustom' similarly. #+END_QUOTE * [2015-03-22 Sun] Broken Xcode plugins? :PROPERTIES: :CUSTOM_ID: broken-xcode-plugins :END: Some Xcode plugins stopped loading after updating Xcode. Ensure the latest DVTPlugInCompatibilityUUIDs is added to the plugin's Info.plist. Get from: #+BEGIN_SRC sh $ defaults read \ /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID #+END_SRC Additional suggestions as [[http://stackoverflow.com/questions/30361228/why-are-my-xcode-plugins-such-as-clang-format-installed-with-alcatraz-no-longe][Stack Overflow]]. * [2015-03-22 Sun] Born to Run references :PROPERTIES: :CUSTOM_ID: born-to-run-references :END: :MODIFIED: [2015-03-23 Mon] :END: References from reading Christopher McDougall's [[http://www.chrismcdougall.com/born-to-run][Born to Run]]: - [[http://www.chirunning.com][Chi running]]. - Chia and pinole. Random recipes [[http://www.nomeatathlete.com/tarahumara-pinole-chia-recipes/][here]]. - [[http://heritageseeds.org/][Heritage Seeds]]. - Ken Mierke’s [[http://www.evolutionrunning.com][Evolution running]]. - [[https://posemethod.com/running][Pose method]]. - Quotes, references, videos, etc. at [[http://ultimatepaleoguide.com/born-to-run/][ultimate paleo guide]]. Recipe by [[http://www.bellaonline.com/articles/art51802.asp][Megan Mignot]], based on book references: ** Mama Tita’s Pancakes - 1 ½ cups cooked brown rice - 1 cup coconut milk - 2 ripe bananas - 1 tablespoon honey - ½ cup white cornmeal - 2 teaspoons baking powder * [2015-03-19 Thu] Org tips from 2015-03-18 Emacs hangout :PROPERTIES: :CUSTOM_ID: org-tips-from-2015-03-18-emacs-hangout :END: :MODIFIED: [2015-03-22 Sun] :END: Lots of great tips in [[http://sachachua.com/blog/2015/03/emacs-hangout-2015-03-18-show-notes/][Emacs Hangout 2015-03-18]]. Favorites: - Private org drawer to prevent export: #+BEGIN_SRC org :PRIVATE: My super duper secret text I don't want to export. :END: #+END_SRC - C-c C-p/C-c C-n Jump over sections. - (setq org-hide-leading-stars t). - (org-bullets-mode). - (org-refile). - C-u (org-refile) jumps, no refile. - (helm-org-in-buffer-headings). * [2015-03-19 Thu] Food bookmarks :PROPERTIES: :CUSTOM_ID: food-bookmarks :END: :MODIFIED: [2020-10-29 Thu] :END: - [[https://twitter.com/cherdotdev/status/1264343579725647880][Cher's hot sauce collection]]. - [[https://twitter.com/hex/status/1320350713734717440][Scott Martin's hot sauce collection]]. - [[http://summertomato.com/][Summer tomato]]. - [[http://www.tarladalal.com/][Tarladalal recipes]]. * [2015-03-19 Thu] Ethiopia travel bookmarks :PROPERTIES: :CUSTOM_ID: ethiopia-travel-bookmarks :END: - [[https://en.wikipedia.org/wiki/Church_of_Saint_George,_Lalibela][Bet Giyorgis Church]]. * [2015-03-19 Thu] China travel bookmarks :PROPERTIES: :CUSTOM_ID: china-travel-bookmarks :END: :MODIFIED: [2021-11-23 Tue] :END: - [[http://en.people.cn/n3/2021/0719/c90000-9874081.html]["If you have not been to Kashgar, then you haven’t really been to Xinjiang”]]. - [[http://www.lonelyplanet.com/asia/travel-tips-and-articles/china-for-beginners-7-first-timer-fails-to-avoid-on-your-trip-to-beijing][7 first-timer fails to avoid on your trip to Beijing]]. - [[https://twitter.com/archpng/status/1146625946943967232][Archpng on Twitter: "Mount Maiji Grottoes,China… "]]. - [[http://t.co/1tSn3xxfP7][Beijing on a budget]]. - [[http://www.lonelyplanet.com/china/travel-tips-and-articles/the-most-incredible-chinese-cities-youve-never-heard-of][Chinese cities you've never heard of]]. - Ctrip for hotels. Stick to high-rated only. - [[http://www.lonelyplanet.com/asia/travel-tips-and-articles/essential-regional-cuisine-of-china][Essential regional cuisine of China]]. - [[https://en.wikipedia.org/wiki/Fenghuang_County][Fenghuang ancient town]]. - [[http://www.youramazingplaces.com/hallelujah-mountains-china/][Hallelujah Mountains]]. - [[https://goo.gl/maps/yP03w][Houhai Lake]] (Beijing). Miscellaneous bars. - [[https://en.wikipedia.org/wiki/Jiuzhaigou][Jiuzhaigou nature reserve]]. - [[https://twitter.com/planetepics/status/613968121498632192][Luotuofeng peak, Sichuan]]. - [[http://www.boredpanda.com/worlds-most-dangerous-hiking-trail-huashan-mountain-china/][Mount Huashan]]. - [[https://duckduckgo.com/?q=Mount+Maiji+Grottoes&t=ffab&iax=images&ia=images][Mount Maiji Grottoes (DuckDuckGo)]]. - [[https://goo.gl/maps/TfdOV][Nan Luo Gu Xiang]] (Beijing). Street Food! - [[https://goo.gl/maps/15aFa][Qianmen Street]]. Near Tiananmen Square. Artifact shopping and famous food. - [[http://www.dailymail.co.uk/travel/article-1389739/Chinas-Sichuan-province-Visiting-lair-Yellow-Dragon.html][Rock pools]]. - [[http://www.lifeonnanchanglu.com/2010/06/shanghai-street-food-7-jian-bing.html][Shanghai Street Food #7 Jiān Bǐng 煎餅]]. - [[http://joi.ito.com/weblog/2014/09/01/shenzhen-trip-r.html][Shenzhen]] (Hong Kong). The worlds manufacturing ecosystem. - [[http://arts.cultural-china.com/en/85Arts192.html][Suspended Temple of Mt. Hengshan]]. - [[http://www.lonelyplanet.com/round-the-world-travel/best-of-round-the-world-travel/content/travel-tips-and-articles/77807][The essential guide to backpacking China's silk road]]. - [[https://www.quora.com/What-are-some-must-try-foods-when-visiting-China][What are some must-try foods when visiting China? (Quora)]]. - [[https://en.wikipedia.org/wiki/Zhangjiajie_National_Forest_Park][Zhangjiajie National Forest Park]]. - [[https://www.lonelyplanet.com/china/travel-tips-and-articles/chinas-most-epic-high-speed-rail-journeys/40625c8c-8a11-5710-a052-1479d2768596][China's most epic high-speed rail journeys]]. * [2015-03-18 Wed] South Korea travel bookmarks :PROPERTIES: :CUSTOM_ID: south-korea-travel-bookmarks :END: :MODIFIED: [2021-01-02 Sat] :END: - [[https://www.nomadasaurus.com/things-to-do-in-jeonju-south-korea/][8 Amazing Things to Do in Jeonju, South Korea (2020 Guide)]]. - [[https://en.wikipedia.org/wiki/Hongdae,_Seoul][Hongdae, Seoul]]. - [[http://www.humarakausar.com/tag/koi-fish-mural][Koi fish mural at Naksan Park, Seoul]]. * [2015-03-18 Wed] Sharing on iOS :PROPERTIES: :CUSTOM_ID: sharing-on-ios :END: - [[https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIActivityViewController_Class/][UIActivityViewController]]. - Use completionWithItemsHandler on iOS 8. - Sample: #+BEGIN_SRC objc NSString *title = @"Sharing on iOS bookmarks."; NSURL *url = [NSURL URLWithString:@"http://xenodium.com/#sharing-on-ios"]; UIImage *image = [UIImage imageNamed:@"beautiful-image"]; UIActivityViewController *controller = [[UIActivityViewController alloc] initWithActivityItems:@[title, url, image] applicationActivities:nil]; // self being a UIViewController. [self presentViewController:controller animated:YES completion:nil]; #+END_SRC - Sharing through Mail app on simulator isn't supported. #+BEGIN_QUOTE viewServiceDidTerminateWithError: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "The operation couldn’t be completed. (_UIViewServiceInterfaceErrorDomain error 3.)" UserInfo=... {Message=Service Connection Interrupted} #+END_QUOTE - Sharing through Mail app on device is OK. - [[http://devstreaming.apple.com/videos/wwdc/2014/205xxqzduadzo14/205/205_hd_creating_extensions_for_ios_and_os_x,_part_1.mov?dl%3D1][WWDC 2014 Creating Extensions for iOS and OSX, Part 1]]. - Share Extensions talk by Guy Fullerton. - Usually view controllers in addition to plist. - CFBundleDisplayName. - NSExtendion. - NSExtensionAttributes. - NSExtensionActivationRule. - SLComposeServiceViewController. - UIActivityViewController. - [[http://devstreaming.apple.com/videos/wwdc/2014/217xxsvxdga3rh5/217/217_hd_creating_extensions_for_ios_and_os_x_part_2.mov?dl%3D1][WWDC 2014 Creating Extensions for iOS and OSX, Part 2]]. - Want to a share URL to App Store? See [[https://developer.apple.com/library/ios/qa/qa1633/_index.html][Technical Q&A 1633]]. * [2015-03-18 Wed] San Francisco travel bookmarks :PROPERTIES: :CUSTOM_ID: san-francisco-travel-bookmarks :END: :MODIFIED: [2018-10-29 Mon] :END: - [[http://www.bluestardonuts.com/][Blue Star Donuts (Portland + LA)]]. - [[https://www.yelp.com/biz/mr-and-mrs-miscellaneous-san-francisco][Mr. and Mrs. Miscellaneous]]. - [[https://www.smittenicecream.com/][Smitten Ice Cream]]. - [[http://www.tiledsteps.org/][Tiled steps at 16th Moraga Street in San Francisco]]. * [2015-03-18 Wed] Istanbul travel bookmarks :PROPERTIES: :CUSTOM_ID: istanbul-travel-bookmarks :END: :MODIFIED: [2015-06-21 Sun] :END: - [[http://istanbulfood.com/altan-sekerleme-a-sweet-sweet-bayram/][Altan Şekerleme (turkish delight shop)]]. - [[http://www.lonelyplanet.com/turkey/istanbul/travel-tips-and-articles/top-10-traditional-cheap-eats-in-istanbuls-bazaar-district][Cheap eats in Istanbul's Bazaar District]]. - [[http://www.turkeyfromtheinside.com/istanbul-guide/f/1255-findikli.html][Findikli rainbow stairs]]. - Historic neighborhood of Arnavutkoy in Istanbul. - [[http://istanbulfood.com/altan-sekerleme-a-sweet-sweet-bayram/][Istanbul Food: after the perfect bite]]. - [[http://www.lonelyplanet.com/turkey/cappadocia-kapadokya/travel-tips-and-articles/the-rise-of-karakoy-istanbuls-hippest-neighbourhood][The rise of Karakoy: Istanbul's hippest neighbourhood]]. - [[http://www.timwilmot.com/2012/04/fish-market-uskudar-istanbul.html][Uskudar Fish Market]]. * [2015-03-18 Wed] Rome travel bookmarks :PROPERTIES: :CUSTOM_ID: rome-travel-bookmarks :END: - [[http://www.topbikerental.com/nuovosito/eng/tour-rome/city-center.php][Bike rental in Rome]]. - [[http://www.darkrome.com/][Darkrome tours]]. - [[http://www.lonelyplanet.com/italy/travel-tips-and-articles/first-time-rome-a-beginners-guide-to-the-eternal-city#ixzz3lhwtbgg0][First time Rome: a beginner’s guide to the Eternal City]]. * [2015-03-17 Tue] Italy travel bookmarks :PROPERTIES: :CUSTOM_ID: italy-travel-bookmarks :END: :MODIFIED: [2020-09-20 Sun] :END: - [[http://themindcircle.com/stunning-italy/][22 Towns in Italy That Are Almost Too Perfect Looking]]. - [[http://www.monte-oliveto.com/][Abbazia di Monte Oliveto Maggiore]]. - [[https://travellingantics.com/][Abbruzzo's Sulmona: one of the oldest towns in the area and home to the Latin poet Ovid, confetti (sugared almonds) and arrosticini (barbecued lamb skewers)]]. - [[https://en.wikipedia.org/wiki/Alberobello][Alberobello - Wikipedia]]. - [[http://www.neatorama.com/2015/04/22/Furore-The-Little-Italian-Beach-Hidden-in-a-Fjord/][Amalfi coast's Furore beach]]. - [[https://en.wikipedia.org/wiki/Boboli_Gardens][Boboli Gardens, Florence]]. - [[http://italychronicles.com/heavenly-beauty-braies-lake-italy/][Braie lake]]. - [[http://www.caffemeletti.it/][Caffe Meletti]]. - [[https://en.wikipedia.org/wiki/Cinque_Terre][Cinque Terre]]. - [[https://en.wikipedia.org/wiki/Emilia-Romagna][Emilia Romagna]]. (foood!). - [[http://emilyluxton.co.uk/italy/five-small-towns][Fixe small towns in Italy]]. - [[https://en.wikipedia.org/wiki/Herculaneum][Herculaneum - Wikipedia]]. - [[http://www.lonelyplanet.com/italy/travel-tips-and-articles/italys-six-best-road-trips][Italy's six best road trips]]. - [[https://sirenuse.it/en][Le Sirenuse (Positano)]]. - [[http://www.lonelyplanet.com/italy/amalfi-coast/travel-tips-and-articles/76904][Live the good life: 12 local experiences on the Amalfi Coast]]. - [[https://en.wikipedia.org/wiki/Manarola][Manarola]]. - Milan - Deus cafe. - Milan - [[https://www.google.co.uk/search?sa%3DG&hl%3Den&q%3Dgelateria%2Bmilano&npsic%3D0&rflfq%3D1&tbm%3Dlcl&ved%3D0ahUKEwjx8vuA353KAhWIOhoKHaFNDq0QjGoIPQ&biw%3D1600&bih%3D789][Gelato joints]]. - Milan - [[http://www.ilmangione.it/][Il mangione]] to find restaurants. - Milan - Mercato Metropolitani. - Milan - Navigli and eat at "el brellin". - Milan - [[http://www.taveggia.it][Taveggia]] for hot chocolate. - Milan - [[http://www.msadventuresinitaly.com/blog/2008/04/14/where-to-go-to-aperitivo-in-milan-italy/][Where to go for aperitivo in Milan]]. - [[https://en.wikipedia.org/wiki/Montalcino][Montalcino, and Brunello wine]]. - [[https://en.wikipedia.org/wiki/Palace_of_Venaria][Palace of Venaria]]. - [[https://en.wikipedia.org/wiki/Piazza_dei_Miracoli#Duomo][Piazza dei Miracoli]]. - [[https://en.wikipedia.org/wiki/Piedmont][Piedmont]]. - [[https://en.wikipedia.org/wiki/Pienza][Pienza, Tuscany]]. - [[https://en.wikipedia.org/wiki/Lampedusa][Rabbit beach]]. - [[http://www.tripadvisor.co.uk/Restaurant_Review-g635634-d1515714-Reviews-Re_di_Macchia-Montalcino_Tuscany.html][Re di Macchia, restaurant in Montalcino]]. - [[http://www.sacred-destinations.com/italy/san-galgano-abbey][San Galgano, Tuscany]]. - [[https://en.wikipedia.org/wiki/San_Gimignano][San Gimignano, Tuscany]]. - [[http://florence-markets.com/sanlorenzomarket.asp][San Lorenzo leather market]]. - [[https://www.lonelyplanet.com/travel-tips-and-articles/skiing-in-italy-find-your-perfect-resort][Skiing in Italy: find your perfect resort]]. - [[https://lovefromtuscany.com/devils-bridge-tuscany/][The Devil's Bridge in Borgo a Mozzano, Tuscany, Italy - Love from Tuscany]]. - [[https://news.ycombinator.com/item][The New Treasures of Pompeii]]. - [[https://en.wikipedia.org/wiki/Volterra][Volterra, Tuscany]]. * [2015-03-17 Tue] Emacs lisp debug on entry :PROPERTIES: :CUSTOM_ID: emacs-lisp-debug-on-entry :END: Wanted to track down which package was enabling ido-mode on my behalf. debug-on-entry to the rescue. Pass the method name in question and you're good to go. #+BEGIN_SRC emacs-lisp (debug-on-entry 'ido-mode) #+END_SRC When done, use cancel. #+BEGIN_SRC emacs-lisp (cancel-debug-on-entry 'ido-mode) #+END_SRC * [2015-03-17 Tue] Burma travel bookmarks :PROPERTIES: :CUSTOM_ID: burma-travel-bookmarks :END: :MODIFIED: [2019-01-27 Sun] :END: - Bagan and Inle lake are the "touristy" areas. - [[http://balloonsoverbagan.com/home][Balloons over Bagan]]. - For Bagan, get bicycles. - Inle lake guided boat tour. - [[https://en.wikipedia.org/wiki/Ngapali_Beach][Ngapali beach]]. - [[https://www.go-myanmar.com/ngwe-saung/][Ngwe Saung beach]]. - Shwesandaw at sunset. - [[http://imgur.com/a/D1EQJ][zyklusdiewelt's Myanmar's photos]]. * [2015-03-16 Mon] OS X Screencasts to animated GIF :PROPERTIES: :CUSTOM_ID: os-x-screencasts-to-animated-gif :END: - [[https://gist.github.com/dergachev/4627207][Alex Dergachev]] has a great [[https://gist.github.com/dergachev/4627207][howto]] for generating animated GIF out of OS X Screencasts. - Of interest [[http://gifbrewery.com/][GIF Brewery]]. * [2015-03-15 Sun] Writing Xcode plugins :PROPERTIES: :CUSTOM_ID: writing-xcode-plugins :END: - [[https://github.com/kattrali/Xcode-Plugin-Template][Xcode-Plugin-Template]] from [[http://www.delisa.me/][Delisa Mason]]/[[https://github.com/kattrali/Xcode-Plugin-Template][kattrali]]. - Ensure DVTPlugInCompatibilityUUIDs is in Info.plist. - Get from: #+BEGIN_SRC sh defaults read \ /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID #+END_SRC - Luis Solanos's [[https://github.com/luisobo/Xcode-RuntimeHeaders][Xcode-RuntimeHeaders]]. - Boris Bügling's [[https://github.com/neonichu/Xcode-RuntimeHeaders][Xcode-RuntimeHeaders]] fork. - [[http://artsy.github.io/blog/2014/06/17/building-the-xcode-plugin-snapshots/][Building the Xcode plugin snapshots]]. - [[https://github.com/edwardaux/XcodeExplorer][Xcode Explorer]] enables you to explore Xcode events/notifications. - [[http://www.blackdogfoundry.com/blog/creating-an-xcode4-plugin/][Creating an Xcode4 plugin]]. - [[http://www.blackdogfoundry.com/blog/common-xcode4-plugin-techniques/][Common Xcode plugin techniques]]. - [[http://www.blackdogfoundry.com/blog/xcodeexplorer-monitor-xcode4-internals/][XcodeExplorer to monitor Xcode internals]]. - [[http://www.blackdogfoundry.com/blog/debugging-your-xcode-plugin/][Debugging your Xcode plugin]]. * [2015-03-15 Sun] Uninstalling Alcatraz from Xcode :PROPERTIES: :CUSTOM_ID: uninstalling-alcatraz-from-xcode :END: #+BEGIN_SRC sh $ rm -rf ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin $ rm -rf ~/Library/Application\ Support/Alcatraz #+END_SRC ps. Removing all plugins: #+BEGIN_SRC sh $ rm -rf ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/* #+END_SRC * [2015-03-14 Sat] Prefill Emacs swiper with current region :PROPERTIES: :CUSTOM_ID: prefill-emacs-swiper-with-current-region :END: The new [[https://github.com/abo-abo/swiper][swiper]] Emacs package is proving to be a great alternative to [[https://github.com/ShingoFukuyama/helm-swoop][helm-swoop]]. Here's how to prefill with current region: #+BEGIN_SRC emacs-lisp (defun ar/prefilled-swiper () "Pre-fill swiper input with region." (interactive) (if (region-active-p) (let ((region-text (buffer-substring (region-beginning) (region-end)))) (swiper region-text)) (swiper))) (global-set-key (kbd "C-s") #'ar/prefilled-swiper) #+END_SRC * [2015-03-14 Sat] Change macOS app icon :PROPERTIES: :CUSTOM_ID: change-mac-os-app-icon :END: - Open the new icon (.icns) in Preview. - Click on large image - Select all (⌘-a). - Copy (⌘-c). - Ctrl-click on app icon. - Select Get Info. - Click on app icon (top-left). - Paste (⌘-v). - Done! [[file:images/change-mac-os-app-icon/overriding.png]] [[file:images/change-mac-os-app-icon/after.png]] * [2015-03-11 Wed] Hack on Emacs London meetup bookmarks :PROPERTIES: :CUSTOM_ID: hack-on-emacs-meetup :END: - [[http://www.european-lisp-symposium.org][European Lisp Symposium]]. - [[https://github.com/kai2nenobu/guide-key][guide-key]] displays available key bindings. - [[https://github.com/csrhodes/iplayer-el][iplayer-el]] Emacs interface to the BBC's iPlayer. - [[https://github.com/csrhodes/swankr][swankr]] REPL (swank protocol for R). * [2015-03-09 Mon] Working with OS X and Emacs tips :PROPERTIES: :CUSTOM_ID: working-with-os-x-and-emacs-tips :END: From [[http://emacsblog.org][M-x all-things-emacs]], Ryan McGeary's OS X/Emacs [[http://emacsblog.org/2011/01/04/how-i-work-working-with-os-x-and-emacs/][workflow]]. ** Frequently used apps: - [[https://agilebits.com/onepassword][1 password]]. - [[http://www.choosyosx.com/][Choosy]]. - [[http://mizage.com/divvy/][Divvy]]. - [[http://www.red-sweater.com/fastscripts][Fastscript]]. - [[http://fluidapp.com/][Fluid]] (SSB). - [[http://www.obdev.at/products/launchbar/index.html][Launchbar]]. - [[https://evernote.com/skitch/guide/mac/][Skitch (screenshots)]]. - [[http://smilesoftware.com/TextExpander/index.html][te (Text expander)]]. ** Dotfiles - [[https://github.com/rmm5t/dotfiles][Github]]. * [2015-03-09 Mon] Building ycmd :PROPERTIES: :CUSTOM_ID: building-ycmd :END: ** Build #+BEGIN_SRC sh $ git clone https://github.com/Valloric/ycmd.git $ cd ycmd $ git submodule update --init --recursive $ ./build.sh --clang-completer #+END_SRC ** Test #+BEGIN_SRC sh $ python ycmd serving on http://127.0.0.1:54265 #+END_SRC ** More info - [[https://github.com/Valloric/YouCompleteMe/blob/master/README.md][YouCompleteMe README]]. - [[https://github.com/Valloric/ycmd/blob/master/README.md][ycmd README]]. * [2015-03-08 Sun] Regular bookmarks :PROPERTIES: :CUSTOM_ID: regular-bookmarks :END: - [[http://roadsandkingdoms.com/category/food/][Roads & Kingdoms (food)]]. - [[http://roadsandkingdoms.com/category/music][Roads & Kingdoms (music)]]. - [[http://roadsandkingdoms.com/category/travel/][Roads & Kingdoms (travel)]]. * [2015-03-08 Sun] Photography bookmarks :PROPERTIES: :CUSTOM_ID: photography-bookmarks :END: :MODIFIED: [2020-12-12 Sat] :END: - [[http://www.techradar.com/how-to/photography-video-capture/cameras/77-photography-techniques-tips-and-tricks-for-taking-pictures-of-anything-1320768/][77 photography techniques, tips and tricks for taking pictures of anything]]. - [[https://sites.google.com/site/marclevoylectures/schedule][Course schedule - Digital Photography]]. - [[https://www.qdev.de/?location=mac/exifrenamer][ExifRenamer: Batch rename photos using exif information]]. - [[https://github.com/Jack000/Expose][Exposé, A simple static site generator for photoessays]]. - [[https://ko-fi.com/s/f7ed5aec56][Japanese Storefront Reference set - Elora 's Ko-fi Shop - Ko-fi]]. - [[http://gakuran.com/category/haikyo-ruins/][Michael Gakuran's Gakuranman]]. - [[https://openmv.io/][OpenMV (Small - Affordable - Expandable)]]. - [[https://www.reddit.com/r/photocritique][Photo Critique (Subreddit)]]. * [2015-03-08 Sun] Paris travel bookmarks :PROPERTIES: :CUSTOM_ID: paris-travel-bookmarks :END: :MODIFIED: [2016-07-13 Wed] :END: - [[http://www.ateliermaitrealbert.com/][Atelier Maitre Albert (known for its rotisserie chicken)]]. - Au Passage. Small plates in fun atmosphere. - Berthillon Ice Cream. - [[http://www.yelp.com/biz/breizh-caf%C3%A9-paris-2][Breizh Café (traditional gallete, savory buckwheat crepes)]]. - Buvette Gastrotheque. Wine bar with small dishes. - Cheri Bibi, possibly hipster, underneath Sacre Coeur, good cocktails. - Creperie Josseline. Worth the queue. Drink Breton cider with crepes. - [[http://holybel.ly][Holybelly]] Canal Saint Martin. - [[http://xdaysiny.com/how-to-spend-a-culinary-weekend-in-paris/][How To Spend a Culinary Weekend In Paris]]. - L'Aller Retour. The place for steak-frites. - L'Office. Wine bar/bistrot. - Le Barav'. - Le Petit Poucet (restaurant next to Place de Clichy, Paris). - [[http://www.lereminet.com][Le Reminet]] (Paris restaurant). - Marché d'Aligre. Authentic neighbourhood market. - Marché des Enfants Rouge. Small covered market. Eat at food stalls. - Mosquee de Paris. City mosque. Drink mint tea at courtyard under olive trees or eat in restaurant inside. North African food. - Musee d'Orsay. - [[http://sprudge.com/paris-a-guide-to-some-of-the-best-cafes-in-canal-st-martin-56068.html][Paris: A Guide To Some Of The Best Cafes In Canal St. Martin]]. - Pierre Herme. For great pastries and macarons. - RATP for transport info including the "carnet" of 10 tickets. - Rodin Museum. - [[http://www.yelp.com/biz/west-country-girl-paris][West Country Girl (crepes)]]. - [[https://www.quora.com/What-are-the-best-boulangeries-and-patisseries-in-Paris-for-each-arrondissement][What are the best boulangeries and patisseries in Paris for each arrondissement? (Quora)]]. - [[https://www.quora.com/What-are-the-best-places-to-buy-cheese-in-Paris][What are the best places to buy cheese in Paris? (Quora)]]. - [[https://www.quora.com/Where-are-best-vintage-stores-in-Paris][Where are best vintage stores in Paris? (Quora)]]. - [[https://www.quora.com/Where-are-the-best-flea-markets-in-Paris][Where are the best flea markets in Paris? (Quora)]]. * [2015-03-08 Sun] Org mode bookmarks :PROPERTIES: :CUSTOM_ID: org-mode-bookmarks :END: :MODIFIED: [2021-11-23 Tue] :END: - [[https://karl-voit.at/2017/08/12/org-rabbit-hole/][[org-agenda] UOMF: Org Mode As a Rabbit Hole: Agenda Tasks Piling Up]]. - [[http://www.emacslife.com/baby-steps-org.html][A Baby Steps Guide to Managing Your Tasks with Org]]. - [[https://blog.aaronbieber.com/2016/09/24/an-agenda-for-life-with-org-mode.html][An Agenda for Life With Org Mode]]. - [[https://scripter.co/notes/org-table-spreadsheet/][An Org Table Spreadsheet cheatsheet]]. - [[http://stackoverflow.com/questions/13340616/assign-ids-to-every-entry-in-org-mode][Assigning ids to entries]]. - [[http://thewanderingcoder.com/2015/03/automating-boilerplate-in-org-mode-journalling/][Automating boilerplate in org-mode journalling]]. - [[https://www.reddit.com/r/emacs/comments/jc4uou/tags_everywhere/][Beautiful Emacs tags (maybe for org mode?)]]. - [[https://zzamboni.org/post/beautifying-org-mode-in-emacs][Beautifying Org Mode in Emacs]]. - [[https://emacs-doctor.com/blogging-from-emacs.html][Blogging from GNU Emacs/org (with rss example)]]. - [[https://www.sadiqpk.org/blog/2018/08/08/blogging-with-org-mode.html][Blogging with Emacs org-mode]]. - [[https://yewtu.be/watch][Build a second brain]]. - [[https://mullikine.github.io/posts/arbitrary-interpreters-for-babel/][Compounding Confoundment: arbitrary interpreters for Babel]]. - [[https://gitlab.com/sadiq/sadiq.gitlab.io/blob/master/src/blog-atom.sh][Creating org atom xml feed with blog-atom.sh]]. - [[https://github.com/philipphoman/org-mode-poster][Creating scientific posters with org-mode]]. - [[https://dev.to/learnbyexample/customizing-pandoc-to-generate-beautiful-pdfs-from-markdown-3lbj][Customizing pandoc to generate beautiful pdfs from markdown (helpful to tweak org export)]]. - [[https://github.com/dfeich/org-babel-examples/blob/master/README.org][dfeich/org-babel-examples (GitHub)]]. - [[https://github.com/dfeich/org-babel-examples/blob/master/README.org][Dfeich’s Org-babel, org-exporter, org-table example collection]]. - [[https://gitlab.com/zzamboni/ox-leanpub][Diego Zamboni / ox-leanpub · GitLab]]. - [[http://correl.phoenixinquis.net/2015/07/12/git-graphs.html][Drawing Git Graphs with Graphviz and Org-Mode]]. - [[http://ergoemacs.org/emacs/elisp_parse_org_mode.html][Elisp: Parse Org Mode (API examples by Xah Lee)]]. - [[http://ehneilsen.net/notebook/orgExamples/org-examples.html][Emacs org-mode examples and cookbook]]. - [[https://jherrlin.github.io/posts/emacs-orgmode-source-code-blocks2/][Emacs Orgmode Source Code Blocks 2 | jherrlin]]. - [[https://emacs.stackexchange.com/questions/51399/org-babel-tangle-with-function-in-header-arguments/51769#51769][Executing org source blocks when loading file (and defining file-local vars)]]. - [[https://github.com/nikclayton/ob-html-chrome][Export Org HTML SRC blocks as PNG files using Chrome]]. - [[https://gitlab.com/ambrevar/ambrevar.gitlab.io/blob/master/feed-builder/feed-builder.el][feed-builder/feed-builder.el an org/blog rss implementation]]. - [[https://github.com/DarkBuffalo/ox-report][GitHub - DarkBuffalo/ox-report: Export your org file to minutes report PDF file]]. - [[https://github.com/misohena/el-easydraw][GitHub - misohena/el-easydraw: Embedded drawing tool for Emacs]]. - [[https://github.com/niklasfasching/go-org][GitHub - niklasfasching/go-org: Org mode parser with html & pretty printed org rendering]]. - [[https://github.com/alphapapa/helm-org-rifle][helm-org-rifle: Rifle through your Org buffers and acquire your target]]. - [[https://www.reddit.com/r/emacs/comments/6mzgkg/how_can_orgbabel_be_configured_to_set_variables/][How can org-babel be configured to set variables across multiple language? (Reddit)]]. - [[https://her.esy.fun/posts/0015-how-i-use-org-mode/index.html][How I use org-mode]]. - [[https://orgmode.org/manual/HTML-doctypes.html#HTML-doctypes][HTML doctypes (The Org Manual)]]. - [[https://www.miskatonic.org/2016/08/25/image-display-size-in-org/][Image display size in Org]]. - [[https://karl-voit.at/2021/08/28/pim-lecture-tug-2021/][Karl Voit's personal information management PIM Lecture at TU Graz]]. - [[http://kelvinh.github.io/wiki/org-mode-manual/][Kevin's org notes]]. - [[http://howardism.org/Technical/Emacs/literate-devops.html][Literate DevOps with org source blocks (Howardism)]]. - [[http://www.howardism.org/Technical/Emacs/literate-devops.html][Literate DevOps]]. - [[http://cachestocaches.com/2018/6/org-literate-programming/][Literate Programming with Org-mode]]. - [[https://www.offerzen.com/blog/literate-programming-empower-your-writing-with-emacs-org-mode][Literate Programming: Empower Your Writing with Emacs Org-Mode]]. - [[http://www.newartisans.com/2007/08/using-org-mode-as-a-day-planner/][Lost in Technopolis (getting things done with org agenda)]]. - [[http://irreal.org/blog/?p=7651][Making a Poster with Org-mode (Irreal)]]. - [[https://isamert.net/2021/04/21/managing-your-contacts-in-org-mode-and-syncing-them-to-your-phone-android-ios-whatever-.html][Managing your contacts in org-mode and syncing them to your phone]]. - [[https://www.bytedude.com/files/managing-your-life-with-org-mode.html][Managing Your Life With org-mode and Other Tools]]. - [[http://mbork.pl/2018-08-18_Embedding_files_in_Org-mode_revisited][Marcin Borkowski: 2018-08-18 Embedding files in Org-mode revisited]]. - [[https://fuco1.github.io/2018-12-23-Multiline-fontification-with-org-emphasis-alist.html][Multiline fontification (ie. bold) with org-emphasis-alist]]. - [[https://joshrollinswrites.com/emacsorg/org-capture-template-1/][My Org Capture Templates - Part 1 · The Art of Not Asking Why]]. - [[https://joshrollinswrites.com/emacsorg/org-capture-template-3/][My Org Capture Templates - Part 3 · The Art of Not Asking Why]]. - [[https://www.reddit.com/r/emacs/comments/hnf3cw/my_orgmode_agenda_much_better_now_with_category/][My org-mode agenda, much better now with category icons! : emacs]]. - [[https://patrickskiba.com/org-mode/2019/05/22/uses-for-org-mode.html][My Org-mode use cases (Patrick Skiba)]]. - [[http://www.cachestocaches.com/2016/9/my-workflow-org-agenda/][My Workflow with Org-Agenda]]. - [[https://christiantietze.de/posts/2019/12/emacs-notifications/][Native macOS Notifications for Emacs Org Tasks and Appointments]]. - [[https://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/][New link features in org 9]]. - [[https://github.com/ndwarshuis/om.el/blob/master/README.md][om.el/README.md at master · ndwarshuis/om.el · GitHub]]. - [[https://github.com/dfeich/org-babel-examples][Org babel examples repo]]. - [[https://org-babel.readthedocs.io/en/latest/][Org Babel reference card]]. - [[https://raw.githubusercontent.com/eschulte/babel-dev/master/scraps.org][org babel scraps]]. - [[https://ag91.github.io/blog/2020/08/28/org-crypt-and-logbook-how-they-can-work-together-for-a-secure-agenda/][Org crypt and LOGBOOK: how they can work together for a secure agenda.]]. - [[https://titan-c.gitlab.io/org-cv/][Org CV/resume]]. - [[http://www.star.bris.ac.uk/bjm/org-basics.html][Org mode basics]]. - [[https://writepermission.com/org-blogging-rss-feed.html][Org mode blogging: RSS feed]]. - [[http://home.fnal.gov/~neilsen/notebook/orgExamples/org-examples.html][Org mode examples and cookbook]]. - [[http://home.fnal.gov/~neilsen/notebook/orgExamples/org-examples.html][Org mode examples]]. - [[https://www.reddit.com/r/emacs/comments/9d8i7y/org_mode_habits/][Org Mode Habits : emacs]]. - [[https://gist.github.com/drj42/1755992][Org mode reference card]]. - [[https://orgmode.org/worg/org-tutorials/][Org tutorials]]. - [[https://alphapapa.github.io/org-almanac/][org-almanac]]. - [[https://github.com/sprig/org-capture-extension/blob/master/README.md][org-capture-extension (GitHub)]]. - [[https://github.com/eschulte/org-ehtml][org-ehtml: Export Org-mode files as editable web pages]]. - [[https://github.com/theodorewiles/org-mind-map][org-mind-map: creates graphviz directed graphs from org-mode files]]. - [[http://pragmaticemacs.com/emacs/org-mode-basics-vii-a-todo-list-with-schedules-and-deadlines/][Org-mode basics VII: A TODO list with schedules and deadlines | Pragmatic Emacs]]. - [[https://bzg.fr/en/some-emacs-org-mode-features-you-may-not-know.html/][Org-mode features You May Not Know · Bastien Guerry - Liberté, informatique]]. - [[https://yiufung.net/post/org-mode-hidden-gems-pt2/][Org-mode Hidden Gems - 02 Tables]]. - [[https://github.com/flexibeast/org-vcard/][org-mode support for vCard export and import]]. - [[https://github.com/weirdNox/org-noter][org-noter: Emacs document annotator, using Org-mode]]. - [[https://alhassy.github.io/org-special-block-extras/README.html][org-special-block-extras]]. - [[https://github.com/alphapapa/org-web-tools][org-web-tools: Commands and functions for retrieving web page content and processing it into and displaying it as Org-mode content.]]. - [[https://github.com/alphapapa/org-web-tools][org-web-tools: View, capture, and archive Web pages in Org-mode]]. - [[https://github.com/lyon0xd/uml/blob/master/org/test.org][org/uml examples]]. - [[https://www.zcl.space/tools/organize-you-life-in-org/][Organize you life in Emacs Org | ZCL.SPACE]]. - [[http://doc.norang.ca/org-mode.html][Organize your life in plain text]]. - [[https://www.youtube.com/playlist?list=PLVtKhBrRV_ZkPnBtt_TD1Cs9PJlU0IIdE&app=desktop][OrgMode tutorial - YouTube channel]]. - [[https://forum.effectivealtruism.org/posts/w4CM7RfTLXxYLDccX/pablo-stafforini-s-forecasting-system-1][Pablo Stafforini’s Forecasting System - EA Forum]]. - [[https://medium.com/@tasshin/plan-your-day-daily-time-management-with-emacs-org-mode-and-google-calendar-a9162837fdb3][Plan your day: Daily Time Management with Emacs, Org-Mode, and Google Calendar]]. - [[https://news.ycombinator.com/item?id=23130104][Prettifying Org Mode with CSS | Hacker News]]. - [[https://sandyuraz.com/articles/orgmode-css/][Prettifying Org Mode with CSS]]. - [[https://puntoblogspot.blogspot.com/2018/12/3-basic-org-agenda-tips-for.html][puntoblogspot: 3 basic org agenda tips for the fundamentally forgetful]]. - [[https://vxlabs.com/2017/06/03/querying-restful-webservices-into-emacs-orgmode-tables/][Querying RESTful webservices into Emacs orgmode tables (vxlabs)]]. - [[https://www.youtube.com/playlist?list=PLVtKhBrRV_ZkPnBtt_TD1Cs9PJlU0IIdE][Rainer König's OrgMode YouTube tutorials]]. - [[https://fuco1.github.io/2019-02-10-Refiling-hydra-with-pre-defined-targets.html][Refiling hydra with pre-defined targets]]. - [[http://blog.lujun9972.win/emacs-document/blog/2018/10/22/ricing-up-org-mode/index.html][Ricing up Org Mode - EMACS-DOCUMENT]]. - [[https://lepisma.github.io/2017/10/28/ricing-org-mode/][Ricing up Org Mode]]. - [[https://www.arcadianvisions.com/blog/#orga597dcf][Robust Notes with Embedded Code (extensive org babel usage)]]. - [[https://orgmode.org/guide/][The compact Org-mode Guide]]. - [[https://ag91.github.io/blog/2020/09/04/the-poor-org-user-spaced-repetition/][The Poor Org-User Spaced Repetition - Where parallels cross]]. - [[http://www.flutterbys.com.au/stats/tut/tut16.1.html][Tutorial 16.1 - Emacs orgmode tables]]. - [[https://karl-voit.at/2017/01/15/org-clone-subtree-with-time-shift/][UOMF: Recurring Events with Org Mode]]. - [[http://www.sastibe.de/2018/05/2018-05-11-emacs-org-mode-rest-apis-stocks/][Use Emacs Org Mode and REST APIs for an up-to-date Stock Portfolio]]. - [[http://cestlaz.github.io/posts/using-emacs-24-capture-2/#.WTtEbXWw5pg][Using Emacs - 24 - Org Capture 2]]. - [[https://cestlaz.github.io/post/using-emacs-54-org-tables][Using Emacs 54 Org Tables]]. - [[https://dpitt.me/blog/2020/03/zettelkasten][Using Emacs's org-mode As Your Zettelkasten]]. - [[http://www.diegoberrocal.com/blog/2015/08/19/org-protocol/][Using org-capture with org-protocol be like - Diego Berrocal]]. - [[http://kitchingroup.cheme.cmu.edu/blog/2019/02/12/Using-results-from-one-code-block-in-another-org-mode/][Using results from one code block in another org-mode]]. - [[https://ofosos.org/2017/12/04/sudo-org-babel/][Using sudo in org-babel]]. - [[https://www.reddit.com/r/emacs/comments/jof1p3/visit_tangled_file_with_orgopenatpoint/][Visit tangled file with org-open-at-point (supports tramp/ssh)]]. - [[https://pjs64.wordpress.com/2020/12/07/worgsheet-calc-intro/][WorgSheet Calc Intro – Dj Pj (lots of tips and shortcuts)]]. - [[http://katherine.cox-buday.com/blog/2015/03/14/writing-specs-with-org-mode/][Writing Specs with Org-mode]]. - [[https://www.youtube.com/watch][YouTube: org introduction]]. - [[https://github.com/nobiot/Zero-to-Emacs-and-Org-roam][Zero to Emacs and Org-roam: a step-by-step guide]]. * [2018-09-11 Tue] London bar backlog :PROPERTIES: :CUSTOM_ID: london-bar-backlog :END: ** Soho - [[http://www.68andboston.com][68 and Boston (cocktails and wine bar)]]. * [2015-03-08 Sun] London food backlog :PROPERTIES: :CUSTOM_ID: london-food-backlog :END: :MODIFIED: [2019-05-25 Sat] :END: ** B_acklog *** [[https://www.saporitaliarestaurant.co.uk][Saporitalia (Italian/pizza), Notting Hill]]. *** [[https://theblacklock.com/menus/][Menus | Lunch, Dinner, Sunday Roast - Blacklock]]. *** [[https://thebarbary.co.uk/food-drink/][Food & Drink - The Barbary | Covent Garden Restaurant | Neal's Yard | London]]. *** [[https://www.pophamsbakery.com/][Pophams Bakery]]. *** [[https://www.timeout.com/london/restaurants/yipin-china][Yipin China | Restaurants in Islington, London]]. *** [[https://m.facebook.com/sundaybarnsbury/][Sunday (breakfast)]]. *** [[https://www.clifton.co.uk/the-quince-tree-cafe-london][The Quince Tree Cafe London (Cafe), Paddington]]. *** [[https://www.bombaybustle.com][Bombay Bustle (Indian), Mayfair]]. *** [[https://www.kyseri.co.uk][Kyseri (modern turkish), Fitzrovia]]. *** [[http://www.pied-a-terre.co.uk/][Pied a Terre (fine dining), Fitzrovia]]. *** [[http://www.theledbury.com/tasting-menu/][The Ledbury (fine dining), Notting Hill]]. *** [[https://www.flourandgrape.com][Flour and Grape (Pasta), Bermondsey]]. *** [[https://www.honipoke.com/][Honi Pokē (poke), Soho]]. *** [[http://zialucia.com/][ZIA LUCIA (pizza), Highbury Islington]]. *** Yeast Bakery. *** Pavillion Cafe. *** Palm Vaults. ** Angel **** TODO [[http://www.shawarmabar.co.uk/][Shawarma Bar - Berber and Q]]. **** TODO [[http://bombayburrito.co.uk/][Bombay Burrito (Indian burrito takeaway & restaurant: Angel, Islington)]]. ** Baker Street **** DONE [[http://www.anticapizzeriadamichele.co.uk][L’ANTICA PIZZERIA DA MICHELE (Pizza), Baker Street]]. ** Barbican **** TODO [[http://sushitetsu.co.uk][Sushi Tetsu (must book, well in advance)]]. ** Barnsbury **** TODO Sunday (breakfast, cafe, working). ** Battersea **** TODO [[https://tonkotsu.co.uk/][Tonkotsu (ramen)]]. ** Brick Lane **** TODO [[http://www.chezellesbistroquet.co.uk][Chez Elles]] (french). **** TODO [[http://www.yelp.com/biz/fika-london-2][Fika]] (Swedish, cinnamon buns, coffee). ** Bermondsey **** TODO Druid Street market ***** FAT London (Kimchee ). ***** & Cultured butter. ** Bethnal Green *** DONE [[https://lahpet.co.uk/][Lahpet]] (Burmese) <2018-12-02 Sun> <2018-12-27 Thu> ** Brixton **** TODO [[http://www.nanban.co.uk/][Nanban]] (Japanese soul food). ** Borough **** DONE [[http://padella.co][Padella]] (great fresh pasta). **** TODO [[https://roastingplant.com/][Roasting Plant: Fresh Roasted Coffee]] <2019-01-15 Tue> ** Camberwell **** TODO [[http://suncamberwell.com][Sun of Camberwell]] (Roast beef, Yorkshire, and sticky toffee pudding). **** TODO [[http://www.timeout.com/london/restaurants/silk-road][Silk Road (Chinese, Lamb/cumin skewers)]]. ** Canada Water **** TODO [[http://www.chuckburgerbar.com/#canadawater][Chuck burger (truck)]]. ** Cannon street **** TODO [[https://www.theinfatuation.com/london/reviews/brigadiers][The Brigadiers (Indian)]] <2019-01-22 Tue> ** Chiswick **** TODO [[https://www.thecoffeetraveller.com/][The Coffee Traveller]] <2019-01-16 Wed> ** Covent Garden **** TODO [[http://www.punjab.co.uk/][Punjab]] (Punjabi). **** TODO [[https://www.dintaifung-uk.com/][鼎泰豐・Din Tai Fung・ディンタイフォン・딘타이펑 (soup dumplings)]] <2019-03-12 Tue> **** TODO [[https://www.littlekolkata.co.uk/][Little Kolkata (London Restaurant - Kolkata Spirits)]] <2019-03-12 Tue> **** TODO [[http://www.duendelondon.com/][Duende]] (modern Spanish). **** TODO [[http://rockandsoleplaice.com][Rock & Sole Plaice]] (fish and chips). **** TODO [[https://tyuk.com][Timber Yard]] (coffee, working). **** TODO [[http://www.chicknsours.co.uk/][Chicks 'n' Sours]]. **** TODO [[https://www.jidori.co.uk/][Jidori]] (chicken yakitori) <2018-12-02 Sun> **** DONE Dishoom (Indian), try Lamb raan. **** DONE [[http://www.sagarveg.co.uk][Sagar]] (South Indian): Great food! ** Clapham **** TODO [[http://www.joepublicpizza.com][Joe Public Pizza]]. ** Crouch end **** TODO [[http://www.the-haberdashery.com][The Haberdashery]] (coffee, working). **** TODO [[http://www.localblend.co.uk/blend-harringay-2][Blend]] (coffee, working). ** Ealing **** TODO Kiraku (Sushi). **** TODO [[https://wacafe.co.uk/][Wa Cafe (Japanese Patiserie)]]. ** Earls court **** TODO [[http://mamlondon.com][MAM]] (Vietnamese) <2018-12-02 Sun> **** TODO [[https://www.facebook.com/ukjollibee/?utm_source=tripadvisor&utm_medium=referral][Jollibee UK (filipino fried chicken/fast food)]] <2019-03-12 Tue> ** Edware road **** DONE [[http://gogi-restaurant.com][GOGI]] (korean): Average. Also, they lied to me and apologized with £10 credit. ** Euston **** TODO Roti King (Indian/Pakistani/Singaporean): 40, Doric Way, Euston, NW1 1LH. ** Farringdon **** TODO Quality Chop House. **** TODO Daddy Donkey (Mexican). **** TODO [[http://jandacafe.com][J+A]] (coffe, working). ** Fitzrovia **** TODO [[http://www.indianymca.org/][Indian YMCA]] (inexpensive Indian). **** TODO [[https://www.pastificioaldente.com][Pastificio al dente (Italian, fresh pasta)]] <2019-03-12 Tue> **** TODO [[http://www.houseofho.co.uk/home][House of Ho]] (Vietnamese). ** Golders Green **** TODO Cafe Japan (Sushi). ** Hackney **** TODO [[http://www.pidginlondon.com][Pidgin]]. **** TODO [[https://dabbadrop.co.uk][DabbaDrop (Indian delivery subscription)]]. ** Hammersmith **** DONE [[http://indian-zing.co.uk/][Indian Zing]] (Indian): It was OK (not great). **** TODO [[https://www.etfoodvoyage.com/2018/08/24/dragon-cat-cafe/][Dragon cat cafe]] (bubble tea and wheel cake). <2019-07-14 Sun> ** Hamstead **** TODO [[http://www.jinkichi.com/][Jin Kichi]] (Japanese). ** Harrow **** TODO [[http://mazarafghanrestaurant.co.uk/contact/][Mazar]] (Afghan). ** Hatch End **** TODO [[http://www.chuckburgerbar.com/][Chuck Burger]]. ** Holborn **** TODO [[http://www.prufrockcoffee.com][Prufrock Café]] (coffee, working). **** TODO [[http://www.goodandpropertea.com/find-us][Good & Proper]] (coffee, tea, working). **** TODO [[https://www.theinfatuation.com/london/reviews/noble-rot][Noble Rot (wine bar/food)]] <2019-01-22 Tue> ** Holloway Road **** TODO Xi'an impression (Xi'an) ** Islington **** TODO [[http://delhigrill.com][Delhi Grill]] (Indian), try chicken makhani and naan. **** TODO [[http://www.bababoom.london][BabaBoom]] (the kebab makers) <2018-12-02 Sun> **** TODO [[http://rootsatn1.com][Roots N1]] (Indian). **** TODO [[http://www.thepigandbutcher.co.uk/][The pig and butcher]] (sunday roast). **** TODO [[http://busanbbq.co.uk][Busan BBQ]] (Korean meets American diner/burgers and fried chicken). **** TODO [[https://smokehouseislington.co.uk/][Smokehouse Islington]]. **** TODO [[https://www.etfoodvoyage.com/2019/02/19/katsute-100/][Katsuke 100]] (Japanese tea/cake room). <2019-07-14 Sun> ** Kensington **** TODO Clarke's, try the burger. ** Kensal Green **** TODO [[http://www.tripadvisor.com/Restaurant_Review-g186338-d3531042-Reviews-Centro_Galego_de_Londres-London_England.html][Centro Galego de Londres]] (Gallician). ** Kentish town **** TODO [[http://www.timeout.com/london/restaurants/the-fields-beneath][The Fields Beneath]] (coffee, working). ** King's Cross **** TODO Itadaki Zen. **** TODO [[http://www.germangymnasium.com/][German Gymnasium]]. **** DONE [[http://starofkings.co.uk/food-and-drink/][Yeah! Burger at Star of Kings]]. **** TODO [[http://www.wingwing.co.uk/][Wing Wing (Korean fried chicken)]]s. **** TODO [[https://www.etfoodvoyage.com/2018/08/31/sambal-shiok-has-a-permanent-home][Sambal Shiok]] known for laksa and satai burger. <2019-07-14 Sun> ** Leicester square **** [[https://ichibanya.uk/][Curry House Ichibanya UK Japanese Restaurant London WC2H]] <2019-03-12 Tue>. ** Leytonstone **** [[http://www.singburi.co.uk][Singburi (Thai)]] <2019-05-07 Tue>. ** Liverpool street **** TODO [[http://www.gunpowderlondon.com][Gunpowder]] (Indian). **** TODO Cinnamon Kitchen (Indian). ** London Bridge **** TODO [[https://www.santoremedio.co.uk/][Santo Remedio]] (Mexican). ** Marylebone **** DONE [[http://www.timeout.com/london/restaurants/fischers][Fischer's]] (Austrian). Great atmosphere and schnitzel. Not cheap. **** TODO Nambutei (Sushi). **** TODO [[http://www.lurra.co.uk/][Lurra]] (Basque). ** Mayfair **** TODO [[http://www.mayfairchippy.com][Mayfair chippy]] (Fish and chips). **** TODO [[http://www.ikedarestaurant.com/][Ikeda]] (Japanese). **** TODO [[http://www.the-araki.com/][THE ARAKI (Sushi) / pricey]]. ** Mornington Crescent **** TODO Asakusa (Japanese). ** Notting Hill **** TODO [[http://www.localblend.co.uk/blend-harringay-2][Blend]] (coffee, working). **** TODO [[http://www.thecontinentalpantry.com/][The continental pantry]]. **** TODO [[http://mamlondon.com][MAM]] (Vietnamese) <2018-12-02 Sun> ** Old Street **** TODO [[http://sardine.london][Sardine]] (French). **** TODO [[http://sasukeramen.co.uk/][Sasuke]] (ramen). ** Olympia **** DONE Aborz (Iranian). <2018-12-27 Thu> ** Oxford street **** TODO Roti Chai (Indian). ** Peckham **** TODO [[http://www.ganapatirestaurant.com][Ganapati]] (South Indian). **** TODO [[http://thebeggingbowl.co.uk/][The Begging Bowl (Thai)]] <2019-05-07 Tue>. ** Piccadilly **** TODO [[http://www.urbantearooms.com/menus][Urban tea rooms (coffee/tea/brunch)]] <2019-03-12 Tue> **** TODO [[http://machi-ya.co.uk/][Machiya]] (Japanese comfort) <2018-12-02 Sun> **** TODO [[https://yoriuk.com/][YORI-Korean Restaurant]] <2019-03-12 Tue> **** TODO [[https://www.ica.art/rochelle-canteen][Rochelle Canteen @ The Institute of Contemporary Arts (ICA)]] (Pie and ping Sunday special) <2019-02-12 Tue> **** TODO [[https://www.fortnumandmason.com/products/dark-chocolate-coated-chocolate-pearl][Dark Chocolate Coated Chocolate Pearl, 190g - Fortnum & Mason]] <2020-06-14 Sun>. ** Putney **** TODO [[https://www.tripadvisor.co.uk/ShowUserReviews-g186338-d807103-r176708451-Tomoe-London_England.html][authentic Japanese restaurant in Putney - Tomoe, London Traveller Reviews - TripAdvisor]]. ** Sheppherds bush **** TODO [[https://www.etfoodvoyage.com/2017/09/03/caco-co/][Caco & Co]] (Portuguese cafe). <2019-07-14 Sun> **** TODO [[https://www.etfoodvoyage.com/2017/03/17/chop-chop-noodle-bar/][Chop chop]] (Noodle bar). <2019-07-14 Sun> ** Shoreditch **** TODO [[http://mastbrothers.com/pages/london][Mast Brothers chocolate makers]]. **** TODO [[http://www.sagardi.co.uk/en/][Sagardi]] (basque). **** TODO [[http://www.lookmumnohands.com/][Look mum no hands]] (cofee, working). **** TODO [[http://jandacafe.com][J+A]] (coffe, working). **** TODO [[http://www.goodandpropertea.com/find-us][Good & Proper]] (coffee, tea, working). **** TODO [[https://smokestak.co.uk][Smokestak]] (BBQ). **** TODO [[https://pickyglutton.com/2015/08/17/banh-mi-in-london-review/][Pho Viet 68]] (Banh mi). ** Sloane Square **** TODO [[http://rasoi-uk.com/][Rasoi]] (Indian). ** Soho **** TODO [[https://www.lehanoi.uk/][Le Hanoi]] (Vietnamese) <2018-12-02 Sun> **** TODO [[https://www.thevietnamesekitchen.co.uk/][Cay Tre]] (Vietnamese) <2018-12-02 Sun> **** TODO [[http://vietnamfood.co.uk/vietfood][Viet Food]] (Vietnamese) <2018-12-02 Sun> **** TODO [[http://www.taotaoju.co.uk/][Tao Tao Ju]] (Dim sum) <2018-12-02 Sun> **** TODO [[http://www.lokhandwala.co.uk/][Lokhandwala London (Top Indian Tapas Restaurant & Bar in London)]] <2019-01-15 Tue> **** TODO [[https://dumlondon.com/][DUM biryani (Indian)]] <2019-01-15 Tue> **** TODO [[http://pastaio.london][Pastaio (Italian, fresh pasta)]] <2019-01-15 Tue>. **** TODO [[https://bun.house/][Bun House]] (ie. pork buns). **** TODO [[http://temperrestaurant.com/][Temper restaurant]] (BBQ/tapas). **** TODO [[http://www.goldenunion.co.uk][Golden Union]] (fish bar). **** TODO [[http://meltroom.com/][Melt Room]] (Cheese toasties). **** TODO [[http://shotgunbbq.com/][Shotgun]] (BBQ). **** TODO [[http://smacklobster.com/][Smack Lobster]] (Lobster rolls). **** TODO [[https://pickyglutton.com/2014/11/05/smoking-goat-review/][Smoking Goat]] (Thai), highly recommended. **** TODO [[http://www.atariya.co.uk/restaurants/][Atari Ya]] (Sushi). **** TODO Yumi Izakaya (Japanese). **** TODO Jugemu (Japanese). **** TODO [[http://www.darjeeling-express.com/][Darjeeling Express]] (Indian). **** TODO [[http://www.hopperslondon.com][Hoppers]] Dosas, Rice, Roast, Kothu & Arrack (Sri Lanka and Tamil Nadu). **** TODO [[https://tyuk.com][Timber Yard]] (coffee, working). **** DONE [[http://pizzapilgrims.co.uk/][Pizza Pilgrims]]. **** DONE [[https://pickyglutton.com/2016/10/14/kiln-review-soho/][Kiln]] (Thai), highly recommended. **** DONE [[http://baolondon.com][BAO]] (Bao buns! enough said). **** DONE [[http://said.it/en/london/][SAID]] (italian chocolate shop). Awesome hot chocolate. ** Southhall *** DONE [[http://brilliantrestaurant.com][Brilliant restaurant]] (healthier Indian). <2018-12-27 Thu> ** Southbank **** TODO [[https://tonkotsu.co.uk/][Tonkotsu (ramen)]]. ** South Kensington **** TODO Hour Glass (Pub restaurant). ** Smithfield **** TODO [[http://birdofsmithfield.com][Bird of Smithfield]] (Sheppherd's pie, ox cheek, cheesecake). ** Spitafields **** DONE [[https://pickyglutton.com/2016/05/02/som-saa-review-spitalfields/][Som Saa]] (Thai), highly recommended. <2018-12-27 Thu> **** TODO [[https://lahpet.co.uk/][Lahpet]] (Burmese) <2018-12-02 Sun> ** Strand **** TODO [[https://www.strand-continental.co.uk/india-club][India Club (around for 50 years)]] <2019-05-21 Tue> ** Stoke Newingtom **** TODO [[http://www.the-haberdashery.com][The Haberdashery]] (coffee, working). ** Tottenham Court Road. **** DONE [[https://www.kanada-ya.com/][Kanada-Ya]] (rammen): Not bad. ** Tower Hill **** TODO [[http://www.manze.co.uk][M. Manze]] (pie and mash). **** TODO [[https://www.google.co.uk/search?q=maltby+street+market&rlz=1C1FLDB_enGB546GB546&espv=2&biw=1449&bih=913&tbm=isch&tbo=u&source=univ&sa=X&ved=0ahUKEwj1nrGQvYvLAhUF2hoKHeaQDQsQsAQIOg&dpr=1][Maltby street market]]. ** Tufnell Park **** TODO Monsoon (Indian), try lamb naga. ** Turnham Green **** TODO Chief Coffee. ** Victoria **** TODO [[http://dominiqueansellondon.com/][Dominique Ansel Bakery (Bakery)]] <2019-01-22 Tue> **** TODO Dominique Ansel Bakery <2018-12-11 Tue> **** TODO [[https://bleeckerburger.co.uk][Bleeker (burger)]] <2019-01-22 Tue> ** Walthamstow **** TODO [[https://grillstock.co.uk][Grillstock BBQ]]. ** Waterloo **** TODO [[http://thelaughinggravy.co.uk][The Laughing Gravy]]. **** TODO [[http://zenchina.co.uk][Zen China]]. ** West Hamstead **** TODO [[http://www.timeout.com/london/restaurants/nautilus][Nautilus]] (fish and chips). **** TODO [[https://twitter.com/MamacitaNW6/media][Mamacita]] (Mexican). ** Whitechapel **** TODO Lahore Kebab House, try seekh kebabs with roti. **** TODO Sushinoen. ** Wimbledon **** TODO Dalchini (Indian), try spicy cocunut fish curry. * [2015-03-07 Sat] UX bookmarks :PROPERTIES: :CUSTOM_ID: ux-bookmarks :END: :MODIFIED: [2021-06-04 Fri] :END: - [[https://99designs.com/designer-blog/2014/01/20/11-kerning-tips/][10 kerning tips for improving your typography]]. - [[http://line25.com/inspiration/flat-design-color-palettes][30 Flat Design Color Palettes That Just Work]]. - [[https://learnui.design/blog/4-rules-intuitive-ux.html][4 Rules for Intuitive UX]]. - [[http://tympanus.net/Development/AnimatedSVGIcons/][Animated SVG icons]]. - [[https://developer.apple.com/design/tips/][Apple's UI design Dos and Don'ts]]. - [[https://twitter.com/yuanqinglim/status/1357893783803756544][Applying white space in UI design: 8 practical tips, with examples.]]. - [[https://news.ycombinator.com/item?id=12711060][Ask HN: Good books or articles on UI design? (Hacker News)]]. - [[https://www.behance.net/][behance (Showcase & Discover Creative Work)]]. - [[https://www.behance.net/gallery/18006477/California-Magazine][California magazine]]. - [[http://capptivate.co][capptivate.co (features mobile UIs)]]. - [[https://lmjabreu.com/post/creating-badass-users/][Creating badass users]]. - [[http://deathtothestockphoto.com/stories/][Death to Stock (stock photos)]]. - [[https://www.designernews.co/][Designer News]]. - [[https://blogs.gnome.org/tbernard/2019/12/30/designing-an-icon-for-your-app/][Designing an Icon for Your App – Space and Meaning (planet gnome)]]. - [[https://developer.bring.com/blog/ui-tips/][DIY UI Tips for Backend Developers]]. - [[http://evil-icons.io][Evil icons]]. - [[http://www.fontsquirrel.com/][Font squirrel (free fonts for commercial use)]]. - [[https://news.ycombinator.com/item?id=27232297][Freesound just reached 500K Creative Commons sounds | Hacker News]]. - [[https://news.ycombinator.com/item?id=13015631][How to Become a UX Designer (Hacker News)]]. - [[https://www.sketchbook.com/blog/how-to-draw-imagination-using-references/][How to Draw from Imagination: Beyond References]]. - [[https://news.ycombinator.com/item?id=10861521][Images and Sketch files of popular devices (Hacker News)]]. - [[http://facebook.github.io/design/devices][Images and Sketch files of popular devices]]. - [[https://vimeo.com/137263880][iOS Typography: Stop Saying “No” to Designers on Vimeo]]. - [[https://news.ycombinator.com/item?id=24030969][Laws of UX | Hacker News]]. - [[http://www.underconsideration.com/brandnew/archives/logo_modernism.php#.VhRP_HvoVE4][Logo Modernism (Book)]]. - [[http://makerbook.net/][Makerbook: A hand-picked directory of the best free resources for creatives]]. - [[https://github.com/google/material-design-icons/releases/tag/1.0.0][Material Design icons]]. - [[http://www.mobile-patterns.com/][mobile-patterns.com (UX mobile patterns)]]. - [[http://pttrns.com/][pttrns.com (mobile UX patterns)]]. - [[https://www.refactoringui.com/book][Refactoring UI: The Book]]. - [[https://news.ycombinator.com/item?id=20728645][Rules for Intuitive UX | Hacker News]]. - [[https://uxdesign.cc/selection-controls-ui-component-series-3badc0bdb546][Selection controls — UI component series | by Taras Bakusevych | UX Collective]]. - [[http://tachyons.io/docs/themes/skins/][Skins / Themes / Docs / TACHYONS]]. - [[https://www.swissted.com/][Swissted (punk rock and Swiss Modernism drawings)]]. - [[http://tachyons.io/][TACHYONS - Css Toolkit (Minimalistic Swiss-inspired)]]. - [[http://www.typewolf.com/blog/most-popular-fonts-of-2014][Ten most popular webfonts of 2014]]. - [[http://inkbotdesign.com/100-best-design-blogs/][The 100 Best Design Blogs to Follow]]. - [[http://www.codelitt.com/blog/the-foundations-of-a-good-ui/][The Foundations of a Good UI]]. - [[http://www.methodsandtools.com/archive/archive.php?id=126][The Psycology of UX]]. - [[http://typographica.org/][Typographica (type reviews, books, commentary)]]. - [[https://news.ycombinator.com/item?id=12887416][Unsplash – Beautiful photos free to use under the Unsplash License (Hacker News)]]. - [[https://uxplanet.org/][UX Planet]]. - [[https://blogs.scientificamerican.com/sa-visual/visualizing-science-illustration-and-beyond][Visualizing Science: Illustration and Beyond - Scientific American Blog Network]]. - [[https://dribbble.com/][What are you working on? Dribbble is show and tell for designers]]. - [[https://blog.prototypr.io/why-showing-your-process-is-so-important-1e4129a5f5d2#.7o5bfjwd7][Why Showing Your Process is So Important!]]. * [2015-03-07 Sat] Recipes :PROPERTIES: :CUSTOM_ID: recipes :END: ** Jeera rice (cumin rice) *** Sizzle spices (40 seconds) - 1 tablespoon oil - 1 teaspoon cumin seeds - 4 cloves - 2 black cardamon pods - 1 cinnamon stick *** Sautee onion (2 mins or browned/opaque) - 1 small yellow onion (chopped) *** Sautee rice + salt (1 minute) - 2 cups of basmati rice - 1.2 teaspoon of salt *** Boil, then partially cover and simmer (8 minutes or water gone) - 4 cups water *** Rest 5 minutes (covered) ** Slow-cooked lamb 1. Preheat oven: 240°C (no fan) 220°C (fan). 2. Lamb face up in tray. 3. Cook for 30 mins (or brown). 4. Take lamb out. 5. Add to tray: broth, onions, rosemary. 6. Lamb face down (broth covers 1/3 or 1/4). 7. Cover with lid (or baking/parchment paper then 2 layers of foil). 8. Bake for 3.5 hours at 180°C (no fan). 9. Take out. 10. Turn lamb face up (over again). Check if liquid needs top-up. 11. Cook for 2 more hours. 12. Check if ready. Does meat fall off the bone with fork? 13. If not, keep for another 30 mins. Check again. 14. You are done \o/. ** Tom Kha Gai soup - Chicken or Prawns - 2 kaffir lime leaves - 1 lemongrass stalk - 1 1/2 cocunut milk - 3/4 sliced fresh galaghal - 1 1/2 chicken stock or water - 1/2 cup mushrooms - 3 1/2 tbsp sugar - 1/2 cup of cilantro - 1-4 thai chillies - 1-2 tbsp chili oil - 1 green onion ** Veg-Fruit juice - Lime - Ginger - Apple - Chilly - Celery - Fig - Blueberries ** Berry Hempster - Hemp milk - Hemp protein - Strawberry - Blueberry - Date ** How to cook [[https://www.youtube.com/watch?v%3DDaN4ifTG3H0][Beef Chow Fun]]. ** [[http://www.dailymail.co.uk/home/you/article-2248267/Recipe-Cavolo-nero-anchovies-chilli-garlic.html][Cavolo nero with anchovies, chilli and garlic]]. ** Vietnamese Pork Lettuce Wraps (my own versions) - Pork Mince. - Chopped garlic. - Chopped chillies. - Chopped ginger. - 4 tablespoons of soy sauce. - 2 tablespoons of apple cider vinegar. - Sesame oil (for cooking mince). - Half tablespoon of coconut sugar. - Lettuces (for wrapping). * [2015-03-07 Sat] Music backlog :PROPERTIES: :CUSTOM_ID: music-backlog :END: :MODIFIED: [2021-07-11 Sun] :END: **** TODO [[https://zenodo.org/record/4008297][CatMeows: A Publicly-Available Dataset of Cat Vocalizations | Zenodo]]. **** TODO [[https://twitter.com/cognazor/status/1196464349109530625][Zontali on Twitter: "Name one of your most emotionally resonant songs, and I ...]]. **** TODO [[https://generative.fm/][Generative.fm]]. **** TODO [[http://ivanish.ca/diminished-fifth/][Diminished Fifth]]. **** TODO [[http://www.archiveofindianmusic.org/][Archive of Indian music]]. **** TODO Budhaditya Mukherjee. **** TODO Debashish Bhattcharya. **** TODO Halim Jafar Khan and his Disciples - Sitar Quintet - LP published in India in 1968. **** TODO Harjinderpal Singh. **** TODO Jayanthi Kumaresh. **** TODO [[https://www.youtube.com/watch?v=jMEjPKBvhzE#t=0][Kayhan Kalhor]]. **** TODO [[http://youtu.be/qQcKzwSmGy0][Malaya Chalo]]. **** TODO Mehboob Nadeem. **** TODO Nirmalya Dey. **** TODO [[https://www.youtube.com/watch?v=dPSr3swtLDk][Zia Mohiuddin]]. * [2015-03-06 Fri] UX scrapbook bookmarks :PROPERTIES: :CUSTOM_ID: ux-scrapbook-bookmarks :END: :MODIFIED: [2021-01-09 Sat] :END: - [[http://www.vox.com/2015/2/8/7475667/27-fonts-give-or-take-that-explain-your-world][27 fonts* (give or take) that explain your world]]. - [[https://timetravel.pixelfika.com/][5 Years of Design (good for inspiration)]]. - [[http://engineering.flipboard.com/2015/02/mobile-web/][60 FPS on mobile web (plus layouts)]]. - [[http://rix.si/][Another minilimalistic one-pager]]. - [[https://exposure.co/][Another minimalistic gallery]]. - [[https://www.behance.net/search?search=ios&utm_source=ios%20dev%20tools&utm_medium=website&utm_campaign=ios%20dev%20tools&at=11lvzs&ct=ios%20dev%20tools][Behance]]. - [[https://stories.uplabs.com/compact-powerful-great-examples-of-floating-action-buttons-in-interfaces-7079b9926cb5#.7ch9p8n82][Compact & Powerful: Great Examples of Floating Action Buttons in Interfaces]]. - [[http://www.flagofplanetearth.com/#intro-shift][Flag of Planet Earth]]. - [[http://generative-placeholders.glitch.me/][Generative Placeholders]]. - [[https://twitter.com/stroughtonsmith/status/1320966432600006656][Graphic design from other cultures]]. - [[https://kevin.is/committed-to-github/][Kevin.is (Simple layout)]]. - [[http://mengto.com/img/snoflake-menu.jpg][Meng To's I Love Food I]]. - [[http://mengto.com/img/exp-menu.jpg][Meng To's I Love Food II]]. - [[https://lmjabreu.com/][Minimalistic blog layout]]. - [[http://antirez.com/latest/0][Minimalistic blog layout]]. - [[http://www.piotrpisarzphotography.com/][Minimalistic gallery]]. - [[http://indie.vc][Minimalistic one-pager]]. - [[http://www.wired.com/2015/04/legendary-redesign-helvetica-reborn-30-years][Neue Haas Unica (reborn)]]. - [[http://www.monotype.com/libraries/neue-haas-unica/][Neue Haas Unica]]. - [[https://uxdesign.cc/neumorphism-in-user-interfaces-b47cef3bf3a6][Neumorphism in user interfaces - UX Collective]]. - [[https://medium.com/@sgblank/organizational-debt-is-like-technical-debt-but-worse-3c0c86eae3eb][Organizational Debt is Like Technical debt — But Worse]]. - [[http://spootnik.org/][Pierre-Yves Ritschard's minialistic blog]]. - [[http://www.fonts2u.com/raleway-heavy.font][Raleway Font]]. - [[http://nsainsbury.svbtle.com/java-developers][Svbtle]]: A post on java developers. Enjoyed its minimalistic layout. - [[http://whereis-whoishiring-hiring.me/][whereis-whoishiring-hiring.me (minimalistic categorization)]]. * [2015-10-09 Fri] Travel blog bookmarks :PROPERTIES: :CUSTOM_ID: travel-blog-bookmarks :END: :MODIFIED: [2016-07-04 Mon] :END: - [[http://hiddentraveltreasures.com/][Hidden Travel Treasures]]. - [[http://onestep4ward.com/][One Step 4Ward]]. - [[http://tigrest.com][Tigrest Travel Blog]]. * [2015-03-06 Fri] Travel bookmarks :PROPERTIES: :CUSTOM_ID: travel-bookmarks :END: :MODIFIED: [2020-08-05 Wed] :END: - [[http://www.buzzfeed.com/ariannarebolini/totally-breathtaking-trails-to-hike-before-you-die#.chOolMjWA][21 Totally Breathtaking Trails]]. - [[http://cnnespanol.cnn.com/2015/09/15/5-increibles-escapadas-a-islas-que-quizas-nunca-has-considerado/][5 increíbles escapadas a islas que quizás nunca has considerado]]. - [[https://news.ycombinator.com/item?id=10863990][52 Places to Go in 2016 (Hacker News)]]. - [[http://www.nytimes.com/interactive/2016/01/07/travel/places-to-visit.html?_r=0][52 Places to Go in 2016]]. - [[http://www.lonelyplanet.com/walking-and-trekking/best-of-walking-and-trekking/content/travel-tips-and-articles/a-beginners-guide-to-the-art-of-hiking][A beginner's guide to the art of hiking]]. - [[http://abitofculture.net/][abitofculture.net]]. - [[http://www.alexinwanderland.com/][Alex in wanderland]]. - [[http://imgur.com/a/m9YjK][Amazing places around the world]]. - [[http://www.backpacksandbunkbeds.co.uk/][Backpacks and Bunkbeds]]. - [[http://beyondblighty.com/][Beyond blighty]]. - [[http://www.blouinartinfo.com/travel][BLOUINARTINFO+TRAVEL]]. - [[http://continentalbreakfasttravel.com/][Continental Breakfast travel]]. - [[http://www.girltweetsworld.com/][Girl tweets world]]. - [[http://www.quora.com/How-does-it-feel-to-travel-alone][How does it feel to travel alone? (Quora)]]. - [[http://www.lonelyplanet.com/round-the-world-travel/best-of-round-the-world-travel/content/travel-tips-and-articles/how-to-pack-light-tips-from-a-master-packer][How to pack light: tips from a master packer]]. - [[http://fourhourworkweek.com/2013/07/14/how-to-travel-21-contrarian-rules/][How to travel: 21 Contrarian rules]]. - [[http://www.railjournal.com/][International Railway Journal]]. - [[https://izi.travel/en/app?content_lang=fr&content_uuid=ede5d243-ace6-459c-b1cc-f45744c48a5d][izi.TRAVEL: A tour guide in your pocket]]. - [[http://joestrippin.blogspot.co.uk/][Joe's Trippin' A few tales from the road by a modern day nomad]]. - [[http://www.legalnomads.com/][Legal nomads]]. - [[http://www.needanotherholiday.com/][Need another holiday]]. - [[http://www.neverendingfootsteps.com/][Never ending footsteps]]. - [[https://www.lonelyplanet.com/travel-tips-and-articles/new-in-travel-the-best-new-openings-of-2017-11-to-20][New in Travel: the best new openings of 2017 (11 to 20)]]. - [[https://www.lonelyplanet.com/travel-tips-and-articles/new-in-travel-the-best-new-openings-of-2017-21-to-35][New in Travel: the best new openings of 2017 (21 to 35)]]. - [[https://www.lonelyplanet.com/travel-tips-and-articles/new-in-travel-the-best-new-openings-of-2017-one-to-10][New in Travel: the best new openings of 2017 (one to 10)]]. - [[http://www.ontheluce.com/][On The Luce]]. - [[http://www.spiegel.de/international/paradise-lost-tourists-are-destroying-the-places-they-love-a-1223502.html][Paradise Lost: Tourists Are Destroying the Places They Love - SPIEGEL ONLINE]]. - [[http://www.pichette.org/][pichette.org's travel blog]]. - [[https://www.eliotandme.com/poster][Posters: Create travel gifts/posters and souvenirs (eliot)]]. - [[https://restlessjo.wordpress.com/][Restless Jo]]. - [[http://www.seemytravels.com/][See my travels]]. - [[http://upgrd.com/thecrewlounge][The Crew Lounge]]. - [[https://thegrownupgapyear.wordpress.com/][The Grown-up gap year]]. - [[http://www.thehappytalent.com/][The Happy Talent. A Travel blog]]. - [[http://thetravelhack.com/][The Travel Hack]]. - [[http://thetravelbunny.com/][The Travelbunny]]. - [[https://helpstay.com/journal/][The Volunteer Journal | Swap Skills For Accommodation]]. - [[http://www.lonelyplanet.com/travel-photography/best-of-travel-photography/content/travel-tips-and-articles/the-worlds-best-places-to-see-autumn-colours][The world's best places to see autumn colours]]. - [[https://www.lonelyplanet.com/thorntree][Thorn Tree travel forum (Lonely Planet's)]]. - [[http://travelwithkat.com/][Travel with Kat]]. - [[http://www.traveldudes.org/][Traveldudes]]. - [[http://travelingspoon.com/][Traveling Spoon]]. - [[http://www.travelistly.com/tv][Travelistly TV (high quality travel content)]]. - [[http://www.lonelyplanet.com/travel-tips-and-articles/tried-and-tested-tips-for-a-trouble-free-road-trip][Tried and tested tips for a trouble free road trip]]. - [[http://www.two-fortheroad.com/][Two for the road]]. - [[https://www.lonelyplanet.com/travel-tips-and-articles/ultimate-travel-list-lonely-planets-top-10-sights-in-the-world][Ultimate travel list: Lonely Planet's top 10 sights in the world]]. - [[http://vagabondbaker.com/][Vagabond Baker]]. - [[https://www.quora.com/What-are-common-items-that-savvy-travelers-bring-with-them-that-less-savvy-ones-dont][What are common items that savvy travelers bring with them that less-savvy ones don't? (Quora)]]. - [[https://www.quora.com/What-are-some-must-eat-dishes-in-your-country][What are some must-eat dishes in your country? - Quora]]. - [[https://www.quora.com/What-are-your-top-10-travel-tips][What are your top 10 travel tips? (Quora)]]. - [[http://world.dailysecret.com/world/en][World daily secret]]. - [[https://plus.google.com/collection/IW-dY][World food and drink]]. - [[http://www.xdaysiny.com/][X Days in Y]]. - [[http://www.ytravelblog.com/][ytravel]]. * [2015-03-06 Fri] Startup bookmarks :PROPERTIES: :CUSTOM_ID: startup-bookmarks :END: :MODIFIED: [2023-07-09 Sun] :END: - [[https://news.ycombinator.com/item?id%3D10101209][16 Startup Metrics (Hacker News)]]. - [[http://a16z.com/2015/08/21/16-metrics/][16 Startup Metrics]]. - [[http://sidejobr.com/help/19-amazing-sites-get-free-stock-photos/][19 Amazing Sites To Get Free Stock Photos]]. - [[https://moz.com/blog/301-redirection-rules-for-seo][301 Redirects Rules Change: What You Need to Know for SEO]]. - [[https://www.appcues.com/blog/increase-user-engagement][6 ways to increase user engagement for product-led growth]]. - [[https://landscape.io][A Dashboard for your Code]]. - [[https://news.ycombinator.com/item?id=9923709][A guide to PR for startups (Hacker News)]]. - [[http://www.craigkerstiens.com/2015/07/21/An-intro-PR-guide-for-startups/][A guide to PR for startups]]. - [[https://news.ycombinator.com/item?id=22895842][A Guide to Pricing Plans | Hacker News]]. - [[https://news.ycombinator.com/item?id=22449314][A two-person startup already uses twenty-eight other tools | Hacker News]]. - [[https://airtable.com/][Airtable: cloud DB with a spreadsheet web UI]]. - [[https://news.ycombinator.com/item?id=17899510][All Things Sales: Mini-lessons for startup founders (Hacker News)]]. - [[https://www.canva.com/][Amazingly Simple Graphic Design Software – Canva]]. - [[https://chrissacca.com/2018/12/an-email-i-will-never-open][An email I will never open (Chris Sacca)]]. - [[https://github.com/abaraka/RESTClient][An iOS REST Client that is based on MVVM using ReactiveCocoa]]. - [[http://www.raywenderlich.com/55384/ios-7-best-practices-part-1][An iOS Weather app case study]]. - [[https://hbr.org/2015/04/how-to-launch-your-digital-platform][Answer these questions about potential digital platform]]. - [[https://github.com/aphyr/distsys-class][aphyr/distsys-class: Class materials for a distributed systems lecture]]. - [[https://news.ycombinator.com/item?id=25547716][API pagination design | Hacker News]]. - [[https://appfigures.com/][AppFigures:]] App tracking platform. - [[https://news.ycombinator.com/item?id=22328822][Apple Edge Cache (CDNs) | Hacker News]]. - [[https://news.ycombinator.com/item?id=19497788][Application-Level Logging Best Practices (Hacker News)]]. - [[https://github.com/AppScale/appscale][AppScale, The Open Source Implementation of Google App Engine]]. - [[https://arc.io/pricing][Arc (crowdfunded CDN)]]. - [[https://arenzana.org/2019/06/artisanal-web-hosting/][Artisanal Web Hosting]]. - [[https://news.ycombinator.com/item?id=14146850][Ask HN: Best business advice for software developers (Hacker News)]]. - [[https://news.ycombinator.com/item?id=12376596][Ask HN: How do you handle DDoS attacks? (Hacker News)]]. - [[https://news.ycombinator.com/item?id=23390966][Ask HN: How does your company manage its encryption keys? | Hacker News]]. - [[https://news.ycombinator.com/item?id=24965115][Ask HN: How to effectively get feedback from users? | Hacker News]]. - [[https://news.ycombinator.com/item?id=9561127][Ask HN: Simple alternative to Google Analytics]]. - [[https://news.ycombinator.com/item?id=9667247][Ask HN: What tools do you use to build HTML emails?]] - [[https://news.ycombinator.com/item?id=18236188][Ask HN: What's your advice for someone who's raising capital for the first time? (Hacker News)]]. - [[https://www.owasp.org/index.php/Authentication_Cheat_Sheet][Authentication Cheet Sheet]]. - [[https://business.axdraft.com/en/business][AXDRAFT (Free legal documents for startups)]]. - [[https://docs.google.com/spreadsheet/ccc?key%3D0Al7M8fgKPXoidENFa0M5VnJpb3pMeHQtS0RDcHFvY1E&usp%3Dsharing#gid%3D0][BaaS comparison]]. - [[http://www.kinvey.com/images/kinvey_backend-as-a-service_mobileecosystem_2100px.png][BaaS ecosystem map]]. - [[https://barnacl.es/][Barnacles]]. - [[https://news.ycombinator.com/item?id=10481507][Bayesian ranking of items with up and downvotes or 5 star ratings (Hacker News)]]. - [[http://julesjacobs.github.io/2015/08/17/bayesian-scoring-of-ratings.html][Bayesian ranking of items with up and downvotes or 5 star ratings]]. - [[http://bbcsfx.acropolis.org.uk/][BBC Sound Effects Archive Resource • Research & Education Space]]. - [[https://en.wikipedia.org/wiki/Bcrypt][bcrypt: password hashing function alternative to md5 and sha1 (Wikipedia)]]. - [[https://hakaselogs.me/2018-12-01/building-small-containers-for-kubernetes][Building a small container for a golang service for kubernetes]]. - [[https://hybridcattt.com/blog/website-essentials/][Building a Well-Rounded Website: Essentials (wonderful recommendations for your site)]]. - [[https://news.ycombinator.com/item?id=25180180][Building Your Color Palette | Hacker News]]. - [[https://carrd.co/][Carrd - Simple, free, fully responsive one-page sites for pretty much anything]]. - [[http://wordsafety.com/][Check for word safety (wordsafety.com)]]. - [[https://news.ycombinator.com/item?id=17920287][Choosing Your First Marketing Hire (Hacker News)]]. - [[http://www.clinkhostels.com/london/clink78/][Clink78 hostel]]. - [[https://news.ycombinator.com/item?id=12396520][Common Startup Timing Mistakes and How to Avoid Them (Hacker News)]]. - [[https://tld-list.com/][Compare Prices of All Top-Level Domains | TLD List]]. - [[http://rancher.com/comparing-monitoring-options-for-docker-deployments/][Comparing five monitoring options for docker]]. - [[https://www.compose.io/][Compose.io]]. - [[https://www.contentful.com/][Contentful: Like a CMS — except for the bad parts]]. - [[http://umap.openstreetmap.fr/en/][Create OpenStreetMaps with uMap]]. - [[https://curlbuilder.com/][curl online command line builder]]. - [[https://danielvassallo.com/][Daniel Vassallo - (quit Amazon story and advice)]]. - [[https://github.com/yaronn/blessed-contrib][Dashborads using ASCII and JS]]. - [[https://github.com/sag333ar/SRKLocationManager][Detect iOS Device location in just one line]]. - [[https://niltalk.com/][Disposable chats in Go]] (more links [[https://news.ycombinator.com/item?id%3D9372918][here]]). - [[http://paulgraham.com/ds.html][Do Things that Don't Scale]]. - [[https://www.reddit.com/r/UKPersonalFinance/comments/9xyiv7/does_anyone_have_recommendations_for_accounting/][Does anyone have recommendations for accounting software? : UKPersonalFinance]]. - [[https://news.ycombinator.com/item?id=14070189][Does it scale? Who cares (2011) (Hacker News)]]. - [[https://www.domainsfortherestofus.com/][Domains for the Rest of Us (domain name generator)]]. - [[https://speakerdeck.com/appltn/done-is-better-than-perfect][Done is better than perfect]]. - [[https://www.eidel.io/2023/07/09/vc-funding/][Don’t Take VC Funding - It Will Destroy Your Company | Oliver Eidel]]. - [[https://twitter.com/rsms/status/1324142698161303552][dynamic website/service with Redis leader and follower replicas]]. - [[https://news.ycombinator.com/item?id=19154082][Earnest Capital is live (Hacker News)]]. - [[https://www.fastly.com/][Edge Cloud Platform (Fastly)]]. - [[https://mxb.dev/blog/emergency-website-kit/][Emergency Website Kit | Max Böck - Frontend Web Developer]]. - [[https://encore.dev][Encore • APIs made simple]]. - [[https://hackmd.io/EmPIHGhTRh6pDSJ1VEgkkA][Ethical apps code of conduct - HackMD]]. - [[https://news.ycombinator.com/item?id=23851870][Everything you need to know about OAuth 2.0 | Hacker News]]. - [[https://usefathom.com/][Fathom Analytics - Simple, Privacy-focused Web Analytics]]. - [[https://www.litscape.com/word_tools/pattern_match.php][Find words that match your pattern.]]. - [[https://rivalseek.com/][Find your competition]]. - [[https://www.fiverr.com/][Fiverr (logos, graphic design, etc)]]. - [[http://flagtheory.com/][Flag Theory: Freedom, Privacy and Wealth]]. - [[https://creativemarket.com/][Fonts, Graphics, Themes and More ~ Creative Market]]. - [[https://graphicriver.net/][Fonts, Logos & Icons from GraphicRiver]]. - [[https://news.ycombinator.com/item?id=17266006][For Static Sites, There’s No Excuse Not to Use a CDN (Hacker News)]]. - [[https://cruip.com/][Free HTML landing page templates for startups - Cruip]]. - [[http://blog.shyahi.com/post/62901878131/putting-everything-together-free-tools-for][Free tools for startups (Shyahi blog)]]. - [[http://www.freevectors.net/][Free vectors]]. - [[http://www.backa.co/][Gain valuable, actionable feedback on your startup ideas]]. - [[http://www.glyphish.com/][Glyphish icon collection]]. - [[http://www.reddit.com/r/golang/comments/20e2to/cheap_go_hosting_with_postgresql/][Go hosting (Reddit comments)]]. - [[https://www.goatcounter.com/][GoatCounter web analytics]]. - [[http://www.gofundme.com/][gofundme]]. - [[https://getgophish.com/][Gophish - Open Source Phishing Framework]]. - [[https://github.com/facebook/graphql][GraphQL, a query language and execution engine tied to any backend service]]. - [[https://github.com/fullstorydev/grpcui][grpcui: An interactive web UI for gRPC]]. - [[https://github.com/fullstorydev/grpcurl][grpcurl: Like cURL, but for gRPC]]. - [[https://gumroad.com][Gumroad. Helps creators sell, generate digital licenses, grow audiences, etc]]. - [[https://news.ycombinator.com/item?id=9865338][HN: Things to Know When Making a Web Application in 2015]]. - [[http://kukuruku.co/hub/ios/how-i-got-to-the-app-store-top-with-a-simple-currency-app][How I got to the app store top with a simple currency app]]. - [[https://blog.usejournal.com/how-i-made-8-000-per-month-podcasting-and-why-you-probably-dont-want-to-855966a557aa?gi=58d80835cfc8][How I Made $8,000 per Month Podcasting, and Why You Probably Don’t Want To]]. - [[http://www.sentia.com.au/blog/how-much-does-it-cost-to-build-an-app][How much does it cost to build an app? (Sentia Blog)]]. - [[https://a16z.com/2016/08/24/options-ownership/][How Startup Options (and Ownership) Works]]. - [[https://news.ycombinator.com/item?id=18490437][How to Acquire Your First 100 Customers (Hacker News)]]. - [[http://bulgerpartners.com/how-to-be-prepared-for-technical-due-diligence-what-to-anticipate-and-how-to-excel/][How to Be Prepared for Technical Due Diligence: What to Anticipate and How to Excel]]. - [[https://news.ycombinator.com/item?id=24780152][How to Build a Great Series A Pitch and Deck | Hacker News]]. - [[https://clearfounder.com/how-to-diy-a-product-launch-video-with-no-experience-and-for-free/][How to DIY a Product Launch Video with No Experience, and for Free]]. - [[https://news.ycombinator.com/item?id=18880043][How to get your money’s worth from your startup lawyer (Hacker News)]]. - [[https://blog.streamroot.io/how-to-implement-a-multi-cdn-strategy-everything-you-need-to-know/][How to implement a multi-CDN strategy: everything you need to know]]. - [[https://news.ycombinator.com/item?id=21591002][How to Kickstart and Scale a Marketplace | Hacker News]]. - [[https://crew.co/backstage/blog/the-psychology-of-pricing][How to price anything: The psychology of why we’ll pay what we pay]]. - [[https://www.sendwithus.com/resources/guide][How to Send Email Like a Startup]]. - [[http://startupclass.samaltman.com/][How to start a startup lectures]]. - [[http://www.iconarchive.com/][Icon archive]]. - [[https://www.iconfinder.com][Icon finder]]. - [[https://imagetragick.com/][ImageTragick (ImageMagick vulnerabilities and mitigations)]]. - [[https://irreal.org/blog/][Irreal: Bad Password Policies (salt + hash with bcrypt)]]. - [[https://kaffeine.herokuapp.com/][Kaffeine pings your Heroku app every 30 minutes so it will never go to sleep]]. - [[https://news.ycombinator.com/item?id=22871180][Keycloak: Open-source identity and access management | Hacker News]]. - [[https://news.ycombinator.com/item?id=19372623][Launch HN: Axdraft (YC W19) - Legal documents for startups in minutes (Hacker News)]]. - [[http://launchaco.com/build/][Launchaco - Name a business]]. - [[https://layer.com][Layer, messaging platform]]. - [[https://www.legalletters.co/][Legal Letters—At a fraction of the cost]]. - [[http://blog.sueraisty.com/lessons-learned-from-co-founding-a-tech-startup/][Lessons I learned from Co-Founding a startup]]. - [[https://news.ycombinator.com/item?id=23560823][Lightweight Alternatives to Google Analytics | Hacker News]]. - [[https://github.com/neiesc/ListOfMinimalistFrameworks][List of Minimal frameworks]]. - [[https://hatchful.shopify.com/][Logo Maker & Logo Creator - Free Logo Generator Online]]. - [[https://www.namecheap.com/logo-maker/][Logo Maker - Create a Free Logo in Minutes - Namecheap]]. - [[http://logodust.com/][Logodust: Free Logo Designs For Your Startup]]. - [[https://news.ycombinator.com/item?id=13065015][Logojoy: AI-powered logo creator (Hacker News)]]. - [[https://www.logoshi.com/][Logoshi: Online Logo Maker]]. - [[http://www.looker.com][Looker (Data analysis)]]. - [[https://picsum.photos/][Lorem Picsum: Lorem Ipsum... but for photos]]. - [[https://lmjabreu.com/][Luis Abreu, iOS Design/UX Specialist]]. - [[https://news.ycombinator.com/item?id=21225223][Making Instagram.com faster: Part 3 – cache first (Hacker News)]]. - [[https://www.mapbox.com/][Mapbox. Maps for iOS, Android and Web]]. - [[https://github.com/mapsme/omim/blob/master/README.md][MAPS.ME (open sourced)]]. - [[https://github.com/jessesquires/JSQMessagesViewController][Messaging UI for iOS]]. - [[https://muratbuffalo.blogspot.com/2019/12/my-distributed-systems-seminars-reading.html][Metadata: My Distributed Systems Seminar's reading list for Spring 2020]]. - [[https://news.ycombinator.com/item?id=23803046][Migrating Away from Google Analytics | Hacker News]]. - [[https://ldpreload.com/blog/names-to-reserve][Names to reserve for your own service]]. - [[https://netflix.github.io/mantis/][Netflix's Mantis: a platform to build an ecosystem of realtime stream processing applications]]. - [[https://www.netlify.com/][Netlify: All-in-one platform for automating modern web projects.]]. - [[https://www.netlify.com][Netlify: Build, deploy, and manage modern web projects]]. - [[https://www.digitalocean.com/community/tools/nginx][NGINX Config generator | DigitalOcean]]. - [[http://mobilenighthawk.com/][Nighthawk (Debug iOS apps remotely from your browser)]]. - [[https://github.com/nim-lang/nimforum][nimforum: Lightweight alternative to Discourse written in Nim]]. - [[https://www.track.tax/][No more tax surprises - Track]]. - [[http://officesnapshots.com/][Office Snapshots]]. - [[http://blog.fogcreek.com/how-to-onboard-software-engineers-interview-with-kate-heddleston/][Onboarding engineers]]. - [[https://onesignal.com/][OneSignal]]. - [[https://www.crowdcube.com/][Online investing, equity crowdfunding, business finance : Crowdcube]]. - [[https://gusto.com/][Online Payroll Services, HR, and Benefits | Gusto]]. - [[https://www.openhunt.co/][Open Hunt: an open and community-run alternative to Product Hunt.]]. - [[https://baremetrics.com/open-startups][Open Startups: companies embracing transparency and openness]]. - [[http://serverfault.com/questions/219620/which-is-the-best-webserver-for-serving-static-content-and-load-balancing][Options to serve static content]]. - [[https://medium.com/@sgblank/organizational-debt-is-like-technical-debt-but-worse-3c0c86eae3eb][Organizational Debt is Like Technical debt — But Worse]]. - [[http://facebook.github.io/origami/examples/][Origami for UI patterns and interactions]]. - [[http://www.paintcodeapp.com][PaintCode (drawings into ObjC code)]] - [[http://bit.ly/PaintCodeRocks][coupon]]. - [[http://eatcodeplay.com/why-we-killed-off-code-reviews/][Pair programming over code-reviews]]. - [[https://www.parse.com][parse.com]]. - [[http://paymentfont.io/][paymentfont.io (Payment icons)]]. - [[http://www.benfrederickson.com/distance-metrics/?hn=1][People Who Like This Also Like]]... - [[https://news.ycombinator.com/item?id%3D9453477][People Who Like This Also Like... (Hacker News)]]. - [[http://permutive.com/][Permutive (ad-server for sponsored content)]]. - [[https://pioneer.app/][Pioneer - The network for ambitious outsiders]]. - [[https://porkbun.com/][porkbun.com | An oddly satisfying experience (domain registry)]]. - [[https://news.ycombinator.com/item?id=10381584][Pragmatic app pricing (Hacker News)]]. - [[http://www.marco.org/2015/10/13/pragmatic-pricing][Pragmatic app pricing ]]. - [[https://mixpanel.com/][Product and User Behavioral Analytics for Mobile, Web, & More | Mixpanel]]. - [[https://www.producthunt.com/][Product Hunt: a curation of the best new products, every day]]. - [[http://www.theatlantic.com/business/archive/2015/01/the-psychological-difference-between-1200-and-1167/384993/?single_page=true][Psychological differences in price]]. - [[https://twitter.com/bmweis/status/1162738837539426304][Questions to ask when joining a startup to help you understand the potential value of your equity]]. - [[http://www.quora.com/What-are-the-best-productivity-tools-for-entrepreneurs][Quora: What are the best productivity tools for entrepreneurs]]? - [[https://get.gaug.es/][Real Time Web Analytics & Marketing Attribution Tools - Gauges]]. - [[https://news.ycombinator.com/item?id=18402411][RemoteMac.io – Dedicated Mac mini (Hacker News)]]. - [[https://responsevault.com/][ResponseVault - Spreadsheet. Grid Form Builder.]]. - [[http://rethinkdb.com/faq/][RethinkDB FAQ]]. - [[https://news.ycombinator.com/item?id=9185338][RethinkDB HN comments]]. - [[https://retool.com][Retool: Build internal tools fast]]. - [[https://news.ycombinator.com/item?id=19388489][Roll Your Own Analytics (Hacker News)]]. - [[https://www.pcmaffey.com/roll-your-own-analytics/][Roll Your Own Analytics]]. - [[https://spin.atomicobject.com/2019/06/12/ip-software-dev-contract/][Securing Intellectual Property Rights in a Software Development Contract]]. - [[https://www.sendwithus.com/resources/guide/][Send email like a startup]]. - [[https://shareasimage.com/][Share as image]]. - Show HN: How I made simple Geolocation service which handles 6m+ req/mo for $5. - [[https://news.ycombinator.com/item?id=22441289][Show HN: Profit Hunt - Get inspired by profitable online projects | Hacker News]]. - [[https://simplescraper.io/][Simplescraper — Scrape Websites and turn them into APIs]]. - [[https://news.ycombinator.com/item?id=19457709][So you want your app/website to work in China]]. - [[https://github.com/spaceuptech/space-cloud][space-cloud: Open source, high performance web service which provides instant Realtime APIs on the database of your choice.]]. - [[https://www.splunk.com/][Splunk: SIEM, AIOps, Application Management, Log Management, Machine Learning, and Compliance]]. - [[http://logo.squarespace.com/][Squarespace Logo]]. - [[http://blog.samaltman.com/startup-advice-briefly][Startup advice, briefly]]. - [[https://www.defmacro.org/2019/03/26/startup-checklist.html][Startup idea checklist | defmacro]]. - [[https://github.com/leonar15/startup-checklist][Startup Incorporation Checklist]]. - [[https://www.reddit.com/r/UKPersonalFinance/comments/9nibvw/striking_off_company_am_i_missing_anything][Striking off company - am I missing anything? : UKPersonalFinance]]. - [[https://www.firebase.com/docs/android/guide/structuring-data.html][Structuring JSON data in your Firebase database]]. - [[http://t.co/5WUoz5BwtT][Submit.co: Press coverage for your startup]]. - [[http://submit.co/][submit.co: Where to get press coverage for your startup]]. - [[http://swagger.io/][Swagger]]: Represent REST API. - [[https://tailwindui.com/][Tailwind UI]]. - [[http://taskjuggler.org/][TaskJuggler - A Free and Open Source Project Management Software - About TaskJuggler]]. - [[https://technically.dev/posts/what-your-developers-are-using.html][Technically: what your developers are using (stacks, tools, and beyond)]]. - [[https://news.ycombinator.com/item?id=11964763][Telephony, SMS, and MMS APIs (Hacker News)]]. - [[http://textbelt.com/][TextBelt:]] A free, open source API for outgoing texts.. - [[https://news.ycombinator.com/item?id=12448844][The Correct Way to Validate Email Addresses (Hacker News)]]. - [[https://medium.com/fluxx-studio-notes/the-first-rule-of-pricing-is-you-do-not-talk-about-pricing-1875caa39b89#.exvbm4vfa][The first rule of pricing is: you do not talk about pricing]]. - [[https://news.ycombinator.com/item?id=22608106][The good parts of AWS: a visual summary | Hacker News]]. - [[https://news.ycombinator.com/item?id=9501892][The Psychology of Pricing: A Gigantic List of Strategies (HN comments)]]. - [[http://www.nickkolenda.com/psychological-pricing-strategies][The Psychology of Pricing: A Gigantic List of Strategies]]. - [[https://thehungryjpeg.com/aff/Madiha/][TheHungryJPEG.com (Premium Graphic Design Resources)]]. - [[http://blog.venanti.us/web-app-2015/][Things to Know When Making a Web Application in 2015]]. - [[https://news.ycombinator.com/item][TLDR Stock Options]]. - [[https://dev.to/sahilrajput/tools-for-developers-gkp][Tools for Developers (DEV Community)]]. - [[https://github.com/torodb/torodb][ToroDB]]. - [[https://wiki.hetzner.de/index.php/Traffic/en][Traffic/en – Hetzner DokuWiki (CDN)]]. - [[https://twitter.com/migueldeicaza/status/1314004192844021765][Twitter: Cheapest and reliable way of serving data over http]]. - [[https://news.ycombinator.com/item?id=24391612][Understanding OAuth2 and OpenID Connect | Hacker News]]. - [[https://unsplash.com/][Unsplash: Beautiful Free Images & Pictures]]. - [[http://docs.aws.amazon.com/AmazonS3/latest/dev/S3Torrent.html][Using BitTorrent with Amazon S3]]. - [[http://www.valvesoftware.com/company/Valve_Handbook_LowRes.pdf][Valve employee handbook]]. - [[https://www.waveapps.com/][Wave Financial: Financial Software for Small Businesses]]. - [[https://news.ycombinator.com/item?id=23378524][We ditched Google Analytics | Hacker News]]. - [[http://blog.workshape.io/we-use-rethinkdb-at-workshapeio/][We use RethinkDB at Workshape.io]]. - [[https://clicky.com/][Web Analytics in Real Time (Clicky)]]. - [[http://statcounter.com][Web Analytics Made Easy - Statcounter]]. - [[https://apify.com/][Web Scraping, Data Extraction and Automation · Apify]]. - [[https://www.quora.com/What-are-some-of-the-things-VCs-listen-for-when-hearing-pitches-that-instill-confidence-in-them-about-the-startup-founders-pitching/answer/Patrick-Mathieson][What are some of the things VCs listen for when hearing pitches that instill confidence in them about the startup founders pitching?]]. - [[https://news.ycombinator.com/item?id=17875285][What does the GDPR actually mean for startups? (Hacker News)]]. - [[https://dev.to/allison_seboldt/what-hosting-do-you-use--5bmh][What hosting do you use? - DEV Community]]. - [[http://www.talkingquickly.co.uk/2015/04/what-id-tell-myself-about-startups/][What I'd tell myself about startups if I could go back 5 years]]. - [[https://www.reddit.com/r/UKPersonalFinance/comments/e1f0tn/what_is_the_best_payment_processor_for_a_sme/][What is the best "payment processor" for a SME e-commerce company in the UK?]]. - [[https://twitter.com/romanzolotarev/status/1054342116917329921?s=12][What is your favorite domain registrar? (Twitter)]]. - [[https://zerokspot.com/weblog/2020/02/29/mobile-app-subscription-pricing/][What's a good (mobile) app subscription price? - zerokspot.com]]. - [[https://www.reddit.com/r/UKPersonalFinance/comments/ehd14k/whats_the_best_financial_package_i_could_offer/][What's the best financial package I could offer our employees?]]. - [[https://news.ycombinator.com/item?id=13063842][What’s the Second Job of a Startup CEO? (Hacker News)]]. - [[https://news.ycombinator.com/item?id=18713844][Writing copy for landing pages (Hacker News)]]. - [[http://www.ycombinator.com/documents/#sales][YC Sales agreement]]. - [[https://spin.atomicobject.com/2019/11/14/more-than-rest-for-api-success/][You Need More than REST for API Success]]. * [2015-03-06 Fri] Romania travel bookmarks :PROPERTIES: :CUSTOM_ID: romania-travel-bookmarks :END: :MODIFIED: [2019-12-01 Sun] :END: - [[https://www.abandonedamerica.us/abandoned-romania][Abandoned Romania]]. - [[http://bran-castle.com/][Bran Castle]]. * [2015-03-06 Fri] Productivity tips backlog :PROPERTIES: :CUSTOM_ID: productivity-tips-backlog :END: :MODIFIED: [2016-01-11 Mon] :END: **** TODO [[https://github.com/tonsky/AnyBar][AnyBar: OS X menubar status indicator (color dot)]]. **** TODO [[https://github.com/benvan/mercury][mercury (fuzzy tab search)]]. * [2015-03-06 Fri] Productivity bookmarks :PROPERTIES: :CUSTOM_ID: productivity-bookmarks :END: :MODIFIED: [2020-03-10 Tue] :END: - [[http://10fastfingers.com/][10 fast fingers]] (improve typing skills). - [[http://dayoneapp.com/][Day One Journal]] - [[http://yanpritzker.com/2011/11/17/dotfiles-for-ultimate-productivity-in-bash-and-vim/ ][Dotfiles for insane productivity in bash, git, and vim]]. - [[https://twitter.com/EricaJoy/status/1235635291378999296][EricaJoy on Twitter: "so folks, what are your #1 tools for remote work?]]. - [[https://news.ycombinator.com/item?id=18179972][How to Get Things Done When You Don't Feel Like It (Hacker News)]]. - [[https://news.ycombinator.com/item?id=20780939][How to return to the flow faster (Hacker News)]]. - [[https://codejamming.org/2019/how-to-return-to-flow][How to return to the flow faster | Code Jamming]]. - [[http://maebert.github.io/jrnl/][jrnl]]: Likely what I've been looking for journaling from command line. - [[https://www.noisli.com/][Noisli - Improve Focus and Boost Productivity with Background Noise]]. - [[https://app.getpocket.com/][Pocket]]. - [[https://dev.to/karaluton/reflecting-on-one-year-of-remote-work-1nkp][Reflecting On One Year of Remote Work - DEV Community]]. - [[https://blog.todoist.com/2015/11/30/ultimate-guide-personal-productivity-methods/][The Ultimate Guide to Personal Productivity Methods]]. - [[https://news.ycombinator.com/item?id=22105229][Tricks to start working despite not feeling like it | Hacker News]]. - [[https://github.com/skwp/dotfiles][Yan's dot files]]: For peaking. - [[http://yanpritzker.com/2006/10/03/five-ways-to-get-insane-productivity-boosts/][Yan's productivity tips]]: Also to try. - [[https://www.zotero.org][Zotero]]. * [2015-03-06 Fri] Privacy bookmarks :PROPERTIES: :CUSTOM_ID: privacy-bookmarks :END: :MODIFIED: [2021-09-30 Thu] :END: - [[https://www.lastpass.com/][#1 Password Manager, Vault, & Digital Wallet App (LastPass)]]. - [[https://blog.lopp.net/modest-privacy-protection-proposal/][A Modest Privacy Protection Proposal]]. - [[https://www.neustadt.fr/essays/against-a-user-hostile-web/][Against an Increasingly User-Hostile Web - Neustadt.fr]]. - [[https://restoreprivacy.com/google-alternatives/][Alternatives to Google Products (Restore Privacy)]]. - [[https://amiunique.org/fp][Am I unique?]]. - [[https://news.ycombinator.com/item?id=17896692][An Intensive Introduction to Cryptography (Hacker News)]]. - [[https://github.com/yishilin14/asc-key-to-qr-code-gif][asc-key-to-qr-code-gif: Convert ASCII-armored PGP keys to animated QR code]]. - [[https://news.ycombinator.com/item?id=23521399][Ask HN: A way to adblock “we're using cookies” popups? | Hacker News]]. - [[https://github.com/Kickball/awesome-selfhosted][Awesome selfhosted (locally hosting and managing applications instead of renting from SaaS providers)]]. - [[https://www.bellingcat.com/resources/how-tos/2019/12/26/guide-to-using-reverse-image-search-for-investigations/][bellingcat - Guide To Using Reverse Image Search For Investigations - bellingcat]]. - [[https://nullprogram.com/blog/2018/09/06/][Brute Force Incognito Browsing « null program]]. - [[https://www.mullvad.net/en/guides/first-steps-towards-online-privacy/][Change your online habits - Guides | Mullvad VPN]]. - [[https://count.ly/][Countly | Product Analytics for Mobile, Web, Desktop and IoT]]. - [[https://crypt.ee][Cryptee (Private, Secure, Encrypted Documents & Photos)]]. - [[https://cryptpad.fr/][CryptPad: Collaboration suite, encrypted and open-source]]. - [[https://dbp.io/essays/2013-06-29-hackers-replacement-for-gmail.html][dbp.io: A Hacker's Replacement for GMail]]. - [[https://nrempel.com/de-googling-my-life/][De-Googling My Life]]. - [[https://simpleoptout.com/][Deep links to opt-out of data sharing by 60+ companies – Simple Opt Out]]. - [[https://degoogle.jmoore.dev/][degoogle | A huge list of alternatives to Google products.]]. - [[http://digital-era.net/][Digital Era]]. - [[https://www.dnsleaktest.com][DNS leak test]]. - [[https://doesmysiteneedhttps.com/][Does my site need HTTPS?]]. - [[https://news.ycombinator.com/item?id=18100243][DuckDuckGo Traffic (Hacker News)]]. - [[https://etherpad.org/][Etherpad (Open Source online editor)]]. - [[https://ethical.net/resources/][Ethical Alternatives & Resources - ethical.net]]. - [[https://usefathom.com/][Fathom Analytics - Simple, Privacy-focused Web Analytics]]. - [[https://miguelmota.com/blog/getting-started-with-wireguard/][Getting Started with WireGuard » Miguel Mota | Software Developer]]. - [[https://github.com/AGWA/git-crypt][git-crypt: Transparent file encryption in git]]. - [[https://github.com/tycrek/degoogle][GitHub - tycrek/degoogle: Repo for the r/privacy "degoogle" megathread]]. - [[https://markosaric.com/firefox/][Give Firefox A Chance For A Faster, Calmer And Distraction-Free Internet]]. - [[https://www.computerworld.com/article/3339618/apple-ios/how-to-stay-as-private-as-possible-on-apples-ipad-and-iphone.html][How to stay as private as possible on Apple's iPad and iPhone | Computerworld]]. - [[https://www.ncsc.gov.uk/blog-post/three-random-words-or-thinkrandom-0][Ian M discusses what makes a good password (NCSC)]]. - [[https://prism-break.org/en/categories/ios/][iOS - Platforms - PRISM Break (more privacy tools)]]. - [[https://news.ycombinator.com/item?id=17737148][K-anonymity (Hacker News)]]. - [[https://github.com/Kickball/awesome-selfhosted][Kickball/awesome-selfhosted: Free Software network services and web applications which can be hosted locally.]]. - [[https://www.kill-the-newsletter.com/][Kill the Newsletter!]]. - [[https://kolabnow.com/feature/calendar][Kolab (calendar)]]. - [[https://mailbox.org/en/][mailbox.org (email + calendar host)]]. - [[https://news.ycombinator.com/item?id=18810035][Migrating from Google Analytics (Hacker News)]]. - [[https://github.com/mssun/passforios/wiki#importing-ascii-armor-encrypted-key][mssun/passforios Wiki]]. - [[https://www.mullvad.net/en/][Mullvad VPN]]. - [[http://adi.is/s/cpunk20/#21][New privacy tools]]. - [[https://riseup.net/en/security/message-security/openpgp/best-practices][OpenPGP Best Practices - riseup.net]]. - [[https://www.nytimes.com/wirecutter/reviews/our-favorite-ad-blockers-and-browser-extensions-to-protect-privacy/][Our Favorite Ad Blockers and Browser Extensions for Privacy]]. - [[https://panopticlick.eff.org][Panopticlick (Is your browser safe against tracking?)]]. - [[https://mhaffner.github.io/post/pi-hole-troubleshooting/][Pi-hole troubleshooting: An overview of my recent installation | Matthew Haffner]]. - [[https://news.ycombinator.com/item?id=19258717][Pi-Hole – A black hole for Internet advertisements (Hacker News)]]. - [[https://plausible.io/][Plausible · Simple, open-source web analytics]]. - [[https://www.privacytools.io/][Privacy Tools - Encryption Against Global Mass Surveillance]]. - [[https://news.ycombinator.com/item?id=27294703][Privacy – A curated list of services and alternatives that respect privacy]]. - [[https://keyserver.mattrude.com/guides/web-key-directory/][Publishing A Public Key via Web Key Directory (WKD) - OpenPGP Keyserver]]. - [[https://news.ycombinator.com/item?id=27707857][Purelymail – cheap, no-nonsense email | Hacker News]]. - [[https://www.qubes-os.org/][Qubes OS: A reasonably secure operating system]]. - [[https://www.runnaroo.com/][Runaroo (metasearch engine)]]. - [[https://www.runnaroo.com/][Runnaroo | A Better Private Search Engine]]. - [[https://searx.space/][Searx search engine instances]]. - [[https://abot.app/blog/elk-nginx-logs-setup][Setup ELK for NGINX logs with Elasticsearch, Logstash, and Kibana (analytics alternative)]]. - [[https://simpleanalytics.io][Simple Analytics - Simple, clean, and privacy-friendly analytics]]. - [[https://smallstep.com/blog/everything-pki.html][smallstep - Everything you should know about certificates and PKI but are too afraid to ask]]. - [[https://ssd.eff.org/][Surveillance Self-Defense | Tips, Tools and How-tos for Safer Online Communications]]. - [[https://addons.mozilla.org/en-US/firefox/addon/temporary-containers/][Temporary Containers – Get this Extension for Firefox (en-US)]]. - [[https://thatoneprivacysite.net/][That One Privacy Site]]. - [[https://www.remembear.com][The easiest way to remember passwords | RememBear]]. - [[https://tineye.com/][TinEye Reverse Image Search]]. - [[https://riseup.net/en][Tools for people and groups working on liberatory social change (riseup.net)]]. - [[http://digital-era.net/tor-use-best-practices/][Tor use - best practices]]. - [[https://medium.com/@ahawkins/trying-to-secure-my-digital-life-b2e5a2876c12][Trying to Secure My Digital Life – Adam Hawkins – Medium]]. - [[https://twitter.com/namseoknation/status/1268306421197746179][twitter: YOUR RIGHTS!!! (this is a UK version, but i’m sure some things may apply!! )]]. - [[https://news.ycombinator.com/item?id=28410807][uBlock Origin review | Hacker News]]. - [[https://www.reddit.com/r/VPN/][Virtual Private Networks (Reddit)]]. - [[https://webbkoll.dataskydd.net/en/][Webbkoll: How privacy-friendly is your site?]]. - [[https://whyprivacymatters.org/][Why Privacy Matters | Privacy is important. Here are some simple reasons why.]]. * [2015-03-06 Fri] Lifestyle/wellbeing/health bookmarks :PROPERTIES: :CUSTOM_ID: lifestyle-bookmarks :END: :MODIFIED: [2021-06-27 Sun] :END: - "Do not spoil what you have by desiring what you have not; what you now have was once among the things you only hoped for." - Epicurus - [[https://www.thesleepjudge.com/23-weird-plants-for-your-bedroom-that-will-help-you-sleep-like-a-baby/][23 Weird Plants For Your Bedroom That Will Help You Sleep Like A Baby]]. - [[http://www.theflowstatecollective.com/flow-habits/a-simple-guide-to-meditation][A simple guide to meditation]]. - [[https://twitter.com/farbodsaraf/status/1067980298040807424?s=12][Advice I needed when I was young]]. - [[http://www.anxietyculture.com/][Anxiety Culture]]. - [[https://anxietynomore.co.uk/][Anxiety No More (Support and Help for a natural anxiety cure)]]. - [[https://news.ycombinator.com/item?id=18837334][Ask HN: How did you decide what problems to solve in your lifetime? | Hacker News]]. - [[https://betteretiquette.blogspot.com/][Better etiquette: Topical Etiquette Tips, Helpful Household Hints, International Travel Tips, Dine Like a Diplomat...]] - [[https://en.wikipedia.org/wiki/Blue_Zone][Blue Zone: Where some claim people live much longer than average]]. - [[https://www.brainpickings.org/][Brain Pickings]]. - [[https://en.wikipedia.org/wiki/Caffeine-induced_anxiety_disorder][Caffeine-induced anxiety disorder - Wikipedia]]. - [[https://en.wikipedia.org/wiki/Calisthenics#Common_exercises][Calisthenics - Wikipedia]]. - [[http://camdez.com/blog/2010/01/15/lifehacking-expanded/][Cameron Desautel on lifehacking]]. - [[http://camdez.com/blog/categories/productivity/][Cameron Desautel on productivity]]. - [[https://harryrschwartz.com/2019/11/16/canadian-permanent-residency][Canadian Permanent Residency]]. - [[https://github.com/kdeldycke/awesome-falsehood][Curated list of falsehoods programmers believe in]]. - [[https://www.youtube.com/watch?v=j2C8MkY7Co8&feature=youtu.be][Dr. Hamilton Demonstrates "The Hold" - How To Calm A Crying Baby (YouTube)]]. - [[https://news.ycombinator.com/item?id=23508581][Dream Homes from the Past Century | Hacker News]]. - [[https://www.recipes-news.co.nz/news/2019/11/6/game-changer-or-fame-gainer][Game Changer or Fame Gainer? — News & Features]]. - [[https://betterhumans.coach.me/how-to-set-up-your-iphone-for-productivity-focus-and-your-own-longevity-bb27a68cc3d8][How to Configure Your iPhone to Work for You, Not Against You]]. - [[https://www.quora.com/How-do-I-get-six-pack-abs-in-one-year][How to get six pack abs in one year - Quora]]. - [[https://docs.google.com/document/d/1j4rj883slFvh1zZLGedqQFM0wqCrHlIEPE62K0LkKak/edit][ICEBREAKERS, via The Art of Noticing by Rob Walker]]. - [[https://www.quora.com/What-is-the-best-way-to-improve-life/answer/Jon-Brosio][Jon Brosio's answer to What is the best way to improve life? - Quora]]. - [[https://www.dezeen.com/2019/05/02/minimod-curucaca-mapa-prefab-house-brazil/][MAPA hides prefab Minimod Curucaca in Brazilian forest]]. - [[https://news.ycombinator.com/item?id=17632668][Melatonin: Much More Than You Wanted to Know (Hacker News)]]. - [[http://www.mindbodygreen.com/][Mind body green]]. - [[https://news.ycombinator.com/item?id=18844791][Most lives are lived by default (2012) | Hacker News]]. - [[https://www.mayoclinic.org/diseases-conditions/panic-attacks/symptoms-causes/syc-20376021][Panic attacks and panic disorder - Symptoms and causes - Mayo Clinic]]. - [[https://news.ycombinator.com/item?id=17679451][Periodic fasting starves cisplatin‐resistant cancers to death (Hacker News)]]. - [[https://news.ycombinator.com/item?id=24050837][Planning for My Kidnapping | Hacker News]]. - [[https://news.ycombinator.com/item?id=17231806][Posing for photos (all about the squinch)]]. - [[http://www.nytimes.com/2015/01/11/fashion/no-37-big-wedding-or-small.html][Quiz: The 36 Questions That Lead to Love]]. - [[http://www.quora.com/What-methods-can-I-use-to-avoid-getting-so-tired-when-I-do-the-same-amount-of-a-work-as-my-peers-who-do-not-get-so-tired][Quora on increasing energy levels]]. - [[https://news.ycombinator.com/item?id=27503597][Show HN: I made a community sourced fitness routine database | Hacker News]]. - [[https://www.cdc.gov/handwashing/show-me-the-science-hand-sanitizer.html][Show Me the Science – When & How to Use Hand Sanitizer in Community Settings]]. - [[https://twitter.com/msdanifernandez/status/1330962637731971073][Side sleepers with neck problems ONLY (pillow thread)]]. - [[https://medium.com/s/story/six-years-with-a-distraction-free-iphone-8cf5eb4f97e3][Six Years With a Distraction-Free iPhone – Member Feature Stories – Medium]]. - [[https://medium.com/coach-me-app/top-100-habits-to-track-in-2018-4940bf459d5][The 101 Best Habits to Track in 2018 – Coach.me App – Medium]]. - [[http://www.mydomaine.com/best-indoor-plants-for-clean-air/slide7][The Best Indoor Plants to Clear the Air, Literally]]. - [[https://www.independent.co.uk/life-style/fall-asleep-two-minutes-how-to-military-secret-trick-a8520991.html][The military secret to falling asleep in two minutes (The Independent)]]. - [[https://medium.com/@JohnLeFevre/the-only-new-years-resolutions-you-ll-ever-need-9246aa419263][The Only New Year’s Resolutions You’ll Ever Need – John LeFevre – Medium]]. - [[https://joshldavis.com/2013/05/20/the-path-to-dijkstras-handwriting/][The Path to Dijkstra’s Handwriting]]. - [[http://articles.mercola.com/sites/articles/archive/2011/08/16/dirty-little-secret-orange-juice-is-artificially-flavored-to-taste-like-oranges.aspx][The Shocking Truth About Freshly Squeezed Orange Juice]]. - [[http://www.quora.com/How-does-it-feel-to-travel-alone][Travelling alone (Quora)]]. - [[https://english.emmaclit.com/2017/05/20/you-shouldve-asked/comment-page-9/][You should’ve asked | Emma]]. - [[http://www.zerowastehome.com/][Zero Waste Home]]. * [2015-03-06 Fri] Graphics bookmarks :PROPERTIES: :CUSTOM_ID: graphics-bookmarks :END: :MODIFIED: [2024-03-04 Mon] :END: - [[http://jnordberg.github.io/gif.js/][gif.js]]. - [[http://philogb.github.io/jit/static/v20/Jit/Examples/Icicle/example2.html][Icicles]]: Data viz. - [[https://twitter.com/valerybriz/status/1369449701641248769][inkpanther2 graphics or logo commissions]]. - [[https://www.reddit.com/r/cricut/comments/13b0qkg/list_of_best_websites_for_downloading_free_svgs/][List of best websites for downloading free SVGs]]. - [[http://mbostock.github.io/protovis/][Protoviz]]: Data viz. - [[http://www.inkscapeforum.com/viewtopic.php?f=22&t=13126][Svg animation info]]: Potentially useful for some ideas in mind. - [[http://stackoverflow.com/questions/14804950/include-one-svg-inside-another][Svg within svg]]: Potentially useful for some ideas in mind. - [[https://www.reddit.com/r/cricutcrafting/wiki/svg/][where to find svgs]]. * [2015-03-06 Fri] Nexus Q bookmarks :PROPERTIES: :CUSTOM_ID: nexus-q-bookmarks :END: - [[http://wiki.cyanogenmod.org/w/Install_CM_for_steelhead][How to Install CyanogenMod on the Google Nexus Q ("steelhead")]]. - [[http://nexusq.wikidot.com/troubleshooting][Nexus Q troubleshooting]]. - [[http://forum.xda-developers.com/showthread.php?t%3D2408799][Unlocking->insecure boot->root->flash cm10 with amplifier support your Q without apk]]. * [2015-03-06 Fri] Golang bookmarks :PROPERTIES: :CUSTOM_ID: golang-bookmarks :END: :MODIFIED: [2020-04-15 Wed] :END: - [[http://spf13.com/presentation/7-common-mistakes-in-go-2015/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+spf13+%28Steve+Francia%27s+Blog%29][7 Common mistakes in Go]]. - [[https://github.com/mingrammer/commonregex][A collection of common regular expressions for Go]]. - [[https://github.com/avelino/awesome-go][A curated list of awesome Go packages]]. - [[https://github.com/guardrailsio/awesome-golang-security][A curated list of awesome golang Security related resources]]. - [[https://iosexample.com/a-drawer-implement-on-swiftui/][A Drawer implement on SwiftUI]]. - [[https://github.com/montanaflynn/stats][A statistics package with common functions that are missing from the Golang standard library]]. - [[http://dave.cheney.net/2015/11/29/a-whirlwind-tour-of-gos-runtime-environment-variables][A whirlwind tour of Go’s runtime environment variables]]. - [[https://dev.to/shindakun/attempting-to-learn-go---now-sending-rest-requests-akp][Attempting to Learn Go - Now Sending GET/POST REST Requests]]. - [[https://stackoverflow.com/questions/59100973/python-grpc-equivalent-of-golangs-perrpccredentials][authentication - python gRPC equivalent of golang's PerRPCCredentials]]. - [[http://www.jerf.org/iri/post/2945][Avoiding Reflection (And Such) In Go]]. - [[https://github.com/iangudger/basicGoAPI][BasicGoAPI (ie. REST)]]. - [[https://chrislovecnm.com/golang/bazel/bazel-hello-world/][Bazel Golang Hello World (Kubernetes musings by chrislovecnm)]]. - [[http://beego.me/docs/intro/releases.md][Beego, platform for web apps]]. - [[https://gobuffalo.io/][Buffalo & Rapid Web Development in Go]]. - [[https://www.youtube.com/watch?v=eTjNtNnVOGY][Building a RESTful API in Go Using Only the Standard Library (Episode 1)]]. - [[http://blog.wercker.com/2013/08/07/building-an-api-with-golang-rethinkdb-wercker.html][Building an API with Golang, RethinkDB and wercker]]. - [[https://dev.to/codehakase/building-small-containers-for-kubernetes-290j][Building Small Containers for Kubernetes (golang http)]]. - [[https://github.com/elliotchance/c2go][c2go: A tool for transpiling C to Go.]]. - [[https://godoc.org/golang.org/x/tools/cmd/vet][Command vet (reports suspicious constructs)]]. - [[http://www.kotancode.com/2015/09/10/complex-json-handling-in-go/][Complex json handling in Go]]. - [[https://github.com/adrianduke/configr][Configr: abstraction on top of configuration sources]]. - [[http://jen20.com/2015/02/06/configuring-emacs-for-go-part-1.html][Configuring emacs and evil mode for Go development (Part 1)]]. - [[https://www.scaledrone.com/blog/posts/creating-an-api-client-in-go][Creating an API Client in Go]]. - [[http://dave.cheney.net/2015/08/22/cross-compilation-with-go-1-5][Cross compilation with Go 1.5]]. - [[http://biasedbit.com/blog/golang-custom-transports/][Custom transports and timeouts]]. - [[https://medium.com/@deckarep/dancing-with-go-s-mutexes-92407ae927bf#.uixrkc790][Dancing with Go’s Mutexes]]. - [[https://medium.com/better-programming/debug-go-like-a-pro-213d4d74e940][Debug Go Like a Pro - Better Programming - Medium]]. - [[https://blog.gopheracademy.com/advent-2015/debugging-with-delve/][Debugging Go programs with Delve]]. - [[https://github.com/elcct/defaultproject][defaultproject (REST/web starter)]]. - [[https://blog.golang.org/defer-panic-and-recover][Defer, Panic, and Recover]]. - [[https://arenzana.org/2019/01/emacs-go-mode][Emacs Go Mode (Isma details his Emacs Golang setup)]]. - [[http://words.volant.is/articles/authentication-golang-web-applications/][End-user authentication for Go web applications]]. - [[https://entgo.io/][ent · An entity framework for Go]]. - [[https://blog.golang.org/error-handling-and-go][Error handling in Go]]. - [[http://www.darrencoxall.com/golang/executing-commands-in-go/][Executing commands in Go]]. - [[https://news.ycombinator.com/item?id=17765413][Exploring Error Handling Patterns in Go (Hacker News)]]. - [[http://blog.matttproud.com/2015/02/exploring-gos-runtime-how-process.html][Exploring Go's runtime]]. - [[https://hackernoon.com/face-recognition-with-go-676a555b8a7e][Face recognition with Go – Hacker Noon]]. - [[https://github.com/valyala/fasthttp][fasthttp: Fast HTTP implementation for Go]]. - [[https://github.com/gorilla/mux][GitHub - gorilla/mux: A powerful URL router and dispatcher for golang.]]. - [[https://github.com/montanaflynn/stats][GitHub - montanaflynn/stats: A well tested and comprehensive Golang statistics library package with no dependencies.]]. - [[https://github.com/ndabAP/vue-go-example][GitHub - ndabAP/vue-go-example: Vue.js and Go example project]]. - [[https://github.com/Nerzal/gocloak][GitHub - Nerzal/gocloak: golang keycloak client]]. - [[https://github.com/sethgrid/multibar][GitHub - sethgrid/multibar: Display multiple progress bars in Go (golang).]]. - [[https://peter.bourgon.org/go-best-practices-2016/][Go best practices, six years in]]. - [[https://gobyexample.com/][Go by Example]]. - [[https://news.ycombinator.com/item?id%3D9399286][Go Challenge 3 HN comments]]. - [[https://github.com/golang/go/wiki/CodeReviewComments][Go Code Review Comments]]. - [[https://gotalks.googleplex.com/codelab/flag.article][Go command Line Flags]]. - [[http://blog.golang.org/pipelines][Go Concurrency Patterns: Pipelines and cancellation]]. - [[https://github.com/grpc/grpc-go/tree/master/examples/features/authentication][Go grpc authentication]]. - [[https://timr.co/go-interfaces-the-tricky-parts][Go interfaces, the tricky parts]]. - [[https://github.com/otium/ytdl][Go library for downloading YouTube videos]]. - [[https://github.com/alecthomas/gometalinter][Go Meta Linter]]. - [[http://www.gregosuri.com/2015/12/04/go-proverbs-illustrated/][Go Proverbs Illustrated]]. - [[https://blog.jpalardy.com/posts/go-slice-gotcha/][Go Slice Gotcha]]. - [[http://gohugo.io/templates/go-templates][Go Template Primer]]. - [[http://golang.rakyll.org/go-tool-flags/][Go tooling essentials (useful flags in tooling)]]. - [[https://www.youtube.com/watch?v=uBjoTxosSys][Go Tooling in Action - YouTube]]. - [[https://medium.com/go-walkthrough/go-walkthrough-encoding-json-package-9681d1d37a8f#.9rix3aqzg][Go Walkthrough: encoding/json package]]. - [[https://medium.com/go-walkthrough/go-walkthrough-fmt-55a14bbbfc53#.egmp9nwqv][Go Walkthrough: fmt (formatting strings)]]. - [[https://medium.com/@matzhouse/go-grpc-and-docker-c1fb2ec8e9f0][Go, gRPC and Docker]]. - [[http://go-bootstrap.io/][go-bootstrap to generate a lean and mean Go web project]]. - [[https://medium.com/@dgryski/go-fuzz-github-com-arolek-ase-3c74d5a3150c#.5ybv38lzm][go-fuzz github.com/arolek/ase tutorial]]. - [[https://github.com/cathalgarvey/go-minilock][Go-miniLock: The Minilock File Encryption System, Ported to Pure Go]]. - go-rename. - [[https://github.com/emicklei/go-restful][Go-restful]]. - [[https://github.com/jroimartin/gocui/blob/master/README.md][GOCUI - Go Console User Interface]]. - [[http://goji.io/][Goji: A web microframework for Golang]]. - [[https://github.com/luciotato/golang-notes/blob/master/OOP.md][Golang concepts from an OOP point of view]]. - [[https://news.ycombinator.com/item?id=12522652][Golang landmines]]. - [[http://golangtoolbox.com/][Golang toolbox (high quality Go packages)]]. - [[http://xahlee.info/golang/golang_index.html][Golang Tutorial (Xah Lee's)]]. - [[https://davidsbond.github.io/2019/06/14/creating-grpc-interceptors-in-go.html][Golang: Creating gRPC interceptors (David Bond)]]. - [[http://xahlee.info/golang/golang_rune.html][Golang: Rune]]. - [[https://www.youtube.com/playlist?list=PL2ntRZ1ySWBf-_z-gHCOR2N156Nw930Hm][GopherCon 2015 videos]]. - [[https://www.youtube.com/watch?v=5v2fqm_8jYI][GopherCon 2016: Jack Lindamood - Practical Advice for Go Library Authors (YouTube)]]. - [[https://www.youtube.com/watch?v=5v2fqm_8jYI][GopherCon 2016: Jack Lindamood - Practical Advice for Go Library Authors]]. - [[https://about.sourcegraph.com/go/gophercon-2018-how-to-write-a-parser-in-go/][GopherCon 2018 - How to Write a Parser in Go]]. - [[https://github.com/gopherjs/gopherjs][Gopherjs: A compiler from Go to JavaScript]]. - [[https://github.com/visualfc/goqt][GoQt: golang Qt bindings]]. - gorepl-mode. - [[https://github.com/securego/gosec][gosec - Golang Security Checker]]. - [[https://news.ycombinator.com/item?id=21603483][Go’s Features of Last Resort | Hacker News]]. - [[https://eli.thegreenplace.net/2020/graceful-shutdown-of-a-tcp-server-in-go/][Graceful shutdown of a TCP server in Go - Eli Bendersky's website]]. - [[https://github.com/levigross/grequests][GRequests: A Go "clone" of the great and famous Requests library]]. - [[https://grpc.io/docs/guides/auth/][gRPC authentication documentation]]. - [[https://github.com/apps/guardrails][GuardRails is a GitHub app that provides security feedback in your pull requests]]. - [[https://www.alexedwards.net/blog/how-to-hash-and-verify-passwords-with-argon2-in-go][How to Hash and Verify Passwords With Argon2 in Go - Alex Edwards]]. - [[https://news.ycombinator.com/item?id=17061713][How to start a Go project in 2018 | Hacker News]]. - [[https://golang.org/doc/code.html][How to Write Go Code]]. - [[https://medium.com/pantomath/how-we-use-grpc-to-build-a-client-server-system-in-go-dd20045fa1c2][How we use gRPC to build a client/server system in Go (auth and TLS included)]]. - [[http://www.gohugo.io/][HUGO: a static website engine in Go]]. - [[http://nathanleclaire.com/blog/2015/10/10/interfaces-and-composition-for-effective-unit-testing-in-golang/][Interfaces and Composition for Effective Unit Testing in Golang]]. - [[https://github.com/kubernetes/kubernetes/blob/master/Godeps/Godeps.json][Kubernetes godeps]]. - [[https://commandcenter.blogspot.com/2012/06/less-is-exponentially-more.html][Less is exponentially more (Rob Pike's Go reasoning)]]. - [[https://lets-go.alexedwards.net/][Let's Go! Learn to Build Professional Web Applications With Golang]]. - [[http://dave.cheney.net/2015/11/05/lets-talk-about-logging][Let's talk about logging]]. - [[http://www.alexedwards.net/blog/making-and-using-middleware][Making and Using HTTP Middleware in Go]]. - [[https://github.com/alexflint/go-restructure][Match regular expressions into struct fields]]. - [[http://bouk.co/blog/monkey-patching-in-go/][Monkey Patching in Go]]. - [[https://github.com/golang/go/wiki/PanicAndRecover][PanicAndRecover]]. - [[http://maciekmm.net/html-golang-stream-processing/][Parsing HTML with Go using stream processing]]. - [[https://www.sohamkamani.com/blog/2018/02/25/golang-password-authentication-and-storage/][Password authentication and storage in Go (Golang)]]. - [[https://www.amazon.com/Peaceful-Parent-Happy-Kids-Connecting/dp/0399160280/][Peaceful Parent, Happy Kids: How to Stop Yelling and Start Connecting]]. - [[https://peter.bourgon.org/go-best-practices-2016/][Peter Bourgon · Go best practices, six years in]]. - [[https://news.ycombinator.com/item?id=19218097][Practical Go: Real-world advice for writing maintainable Go programs (Hacker News)]]. - [[https://github.com/bradfitz/exp-httpclient/blob/master/problems.md][Problems with Go net/http Client API]]. - [[https://github.com/m3ng9i/ran][Ran: a simple static web server written in Go]]. - [[https://blog.gopheracademy.com/advent-2015/reducing-boilerplate-with-go-generate/][Reducing boilerplate with go generate]]. - [[https://research.swtch.com/interfaces][research!rsc: Go Data Structures: Interfaces]]. - [[https://www.youtube.com/watch?feature=youtu.be][RESTful Web API Basics in Go]]. - [[http://www.linkedin.com/pulse/restful-webservice-using-golang-sqlite-uttam-gandhi][Restful webservice using golang with sqlite]]. - [[http://revel.github.io/][Revel:]] A high-productivity web framework for the Go language. - [[https://github.com/bazelbuild/rules_go/blob/master/go/core.rst#go_binary][rules_go/core.rst at master · bazelbuild/rules_go]]. - [[https://golang.org/pkg/runtime/pprof/][runtime.pprof for profiling]]. - [[https://bitbucket.org/seanerussell/sashay][Sashay Go codegen]]. - [[https://syslog.ravelin.com/making-something-faster-56dd6b772b83][Seven steps to 100x faster Go]]. - [[https://github.com/grpc/grpc-go/issues/106][Simple password authentication example · Issue #106 · grpc/grpc-go]]. - [[https://github.com/dghubble/sling][Sling: Go REST client library for creating and sending API requests]]. - [[https://machiel.me/using-tags-in-go/][Small introduction to tags in Go]]. - [[https://news.ycombinator.com/item?id=13213902][So you want to expose Go on the Internet (Hacker News)]]. - [[https://www.cockroachlabs.com/blog/rounding-implementations-in-go/][Survey of Rounding Implementations in Go | Cockroach Labs]]. - [[https://github.com/yvasiyarov/swagger][Swagger Go documentation generator]]. - [[https://news.ycombinator.com/item?id%3D9716964][Ten useful techniques in Go (HN comments)]]. - [[http://arslan.io/ten-useful-techniques-in-go][Ten useful techniques in Go]]. - [[https://github.com/gizak/termui][termui, Go terminal dashboard]]. - [[https://dev.to/dannypsnl/testing-in-go-35ei][Testing in Go - DEV Community]]. - [[https://sourcegraph.com/blog/live/gopherconindia/112025389257 ][The 5 stages of learning Go]]. - [[https://dave.cheney.net/2014/03/25/the-empty-struct][The empty struct (Dave Cheney)]]. - [[http://golangcookbook.com/][The Go Cookbook]]. - [[http://go-talks.appspot.com/github.com/ChrisHines/talks/structured-logging/structured-logging.slide#1][The Hunt for a Logger Interface]]. - [[https://dave.cheney.net/2017/04/29/there-is-no-pass-by-reference-in-go][There is no pass-by-reference in Go | Dave Cheney]]. - [[http://openmymind.net/Things-I-Wish-Someone-Had-Told-Me-About-Go/][Things I wish someone told me about Go]]. - [[https://scripter.co/time-formatting-in-go/][Time formatting in Go ❚ A Scripter's Notes]]. - [[https://news.ycombinator.com/item?id=21225401][Uber Go Style Guide (Hacker News)]]. - [[http://divan.github.io/posts/go_concurrency_visualize/][Visualizing Concurrency in Go]]. - [[https://groups.google.com/forum/#!msg/golang-nuts/R7ryo7RdBPY/t7XFNGyRDQAJ][What's So Bad About Stdlib's Log Package? (Groups discussion)]]. - [[https://www.youtube.com/watch?v=YmbbmyxSlcg][Writing Unit Tests for your net/http Handlers]]. * [2015-03-06 Fri] GitHub bookmarks :PROPERTIES: :CUSTOM_ID: github-bookmarks :END: - [[https://help.github.com/articles/adding-a-cname-file-to-your-repository/][Adding a CNAME file to your repository]]. - [[https://help.github.com/articles/tips-for-configuring-a-cname-record-with-your-dns-provider/][Tips for configuring a CNAME record with your DNS provider]]. - [[https://help.github.com/categories/github-pages-basics/][Github pages basics]]. - [[http://stackoverflow.com/questions/23375422/how-to-setup-github-pages-to-redirect-dns-requests-from-subdomain-e-g-www-to][SO DNS response]]. * [2015-03-06 Fri] Courses bookmarks :PROPERTIES: :CUSTOM_ID: courses-bookmarks :END: :MODIFIED: [2019-01-05 Sat] :END: - [[http://www.chesscademy.com][Chessacademy]]. - [[https://lagunita.stanford.edu/courses/Engineering/Compilers/Fall2014/about][Compilers (Stanford Lagunita)]]. - [[https://egghead.io/technologies/angular2][Egghead.io]]. - [[http://www.gravitycircuscentre.com/][Gravity Circus Centre]]. - [[http://idler.co.uk/shop/live-courses/][Idler courses]]. - [[https://www.coursera.org/learn/learning-how-to-learn?ranMID=40328&ranEAID=4246lDpjhco&ranSiteID=4246lDpjhco-7V8Bq5eW0eb.NabcjrH6FA&siteID=4246lDpjhco-7V8Bq5eW0eb.NabcjrH6FA&utm_content=10&utm_medium=partners&utm_source=linkshare&utm_campaign=4246lDpjhco][Learning How to Learn: Powerful mental tools to help you master tough subjects (Coursera)]]. - [[http://lingua.ly/][lingua.ly]]. - [[https://www.coursera.org/learn/the-science-of-well-being][The Science of Well-Being (Coursera)]]. - [[http://tutsplus.com/][Tuts+ courses]]. * [2015-03-05 Thu] Reload inputrc :PROPERTIES: :CUSTOM_ID: reload-inputrc :END: Reload .iputrc from bash prompt: C-x C-r. [[http://www.gnu.org/software/bash/manual/bashref.html#Miscellaneous-Commands][More at bashref manual]]. * [2015-03-05 Thu] Learning Emacs lisp :PROPERTIES: :CUSTOM_ID: learning-emacs-lisp :END: :MODIFIED: [2015-04-13 Mon] :END: - Use nreverse and nconc to operate on lists in-place. - Set buffer local variables: #+BEGIN_SRC emacs-lisp (setq-local my-clever-var) #+END_SRC - Execute before saving buffer: #+BEGIN_SRC emacs-lisp (add-hook 'write-file-hooks (lambda () (message "about to save!"))) #+END_SRC - Possibly use to start processes and send file content: #+BEGIN_SRC emacs-lisp (make-comint NAME PROGRAM &optional STARTFILE &rest SWITCHES) #+END_SRC - Creating markers: #+BEGIN_SRC emacs-lisp (setq my-marker (copy-marker (point))) # (marker-buffer my-marker) # (marker-position my-marker) 10251 (#o24013, #x280b, ?⠋) #+END_SRC - Get org heading at point: #+BEGIN_SRC emacs-lisp (org-get-heading 'no-tags 'no-todo) #+END_SRC - Remove string text properties. From manual: #+BEGIN_QUOTE (substring-no-properties STRING &optional FROM TO) Return a substring of STRING, without text properties. It starts at index FROM and ends before TO. TO may be nil or omitted; then the substring runs to the end of STRING. If FROM is nil or omitted, the substring starts at the beginning of STRING. If FROM or TO is negative, it counts from the end. #+END_QUOTE - Skip org entry metadata/drawers: #+BEGIN_SRC emacs-lisp (org-end-of-meta-data-and-drawers) #+END_SRC - Random access to org entry using id (or CUSTOM_ID): #+BEGIN_SRC emacs-lisp (org-open-link-from-string "[[#%exciting-custom-id]]") #+END_SRC - From [[http://endlessparentheses.com/debugging-emacs-lisp-part-1-earn-your-independence.html][Debugging Elisp Part 1: Earn your independence]]: #+BEGIN_QUOTE - Go to where the function is defined. - Press C-u C-M-x. Edebug breakpoint for function. - Invoke function in question. - n/c will get you around. - q when done. #+END_QUOTE - Pretty printing objects: #+BEGIN_SRC emacs-lisp (let ((my-var (list "val1" "val2" "val3"))) (pp-to-string my-var)) #+END_SRC - Search and/or replace in curent buffer: #+BEGIN_SRC emacs-lisp (re-search-forward "needle" nil t) (match-beginning 0) ;; Start location of match from last search. (match-end 0) ;; End location of match from last search. (replace-match "love") ;; needle-in-haystack #+END_SRC - Restrict buffer editing to a region: #+BEGIN_SRC emacs-lisp (narrow-to-region (point) (point-max)) #+END_SRC - Restore restriction: #+BEGIN_SRC emacs-lisp (save-restriction (narrow-to-region (point) (point-max)) #+END_SRC - Restore point, mark, and current buffer: #+BEGIN_SRC emacs-lisp (save-excursion (goto-char (point-max)) (insert "Hello elisp.")) #+END_SRC - Concatenating strings: #+BEGIN_SRC emacs-lisp (concat "Hello " "elisp " "world.") #+END_SRC - Grabbing thing at point: #+BEGIN_SRC emacs-lisp (thing-at-point 'word) (thing-at-point 'symbol) (thing-at-point 'line) #+END_SRC - Unit test with ert. - Basic iteration with dolist: #+BEGIN_SRC emacs-lisp (dolist (v '("a" "b" "c")) (print v)) #+END_SRC - Output to other buffer: #+BEGIN_SRC emacs-lisp (with-current-buffer (get-buffer-create "*some buffer*") (princ '(some list to print) (current-buffer))) #+END_SRC - For a temporary buffer, use with-temp-buffer: #+BEGIN_SRC emacs-lisp (with-temp-buffer (insert "abc") (point)) #+END_SRC - Cons cells [[http://emacslife.com/read-lisp-tweak-emacs/beginner-2-understand-emacs-lisp.html#sec-4-4][bookmark]]. - Check for substring: #+BEGIN_SRC emacs-lisp (string-match-p REGEXP STRING &optional START) #+END_SRC - Matching substrings and accessing groups: #+BEGIN_SRC emacs-lisp (setq haystack "Always click [[http://reddit.com/r/emacs][here]].") (setq needle-re "\\[\\[\\(.*\\)]\\[\\(.*\\)]]") "\\[\\[\\(.*\\)]\\[\\(.*\\)]]" (string-match needle-re haystack) 13 (#o15, #xd, ?\C-m) (match-string 0 haystack) "[[http://reddit.com/r/emacs][here]]" (match-string 1 haystack) "http://reddit.com/r/emacs" (match-string 2 haystack) "here" #+END_SRC - Return argument unchanged (noop): #+BEGIN_SRC emacs-lisp (identity ARG) #+END_SRC - Org insert today's timestamp #+BEGIN_SRC emacs-lisp (org-insert-time-stamp (current-time)) #+END_SRC - [[http://ergoemacs.org/emacs/elisp_determine_OS_version.html][OS version in .emacs]]: Determine OS in emacs lisp. - First element #+BEGIN_SRC emacs-lisp (car LIST) #+END_SRC - All but first element #+BEGIN_SRC emacs-lisp (cdr LIST) #+END_SRC - Add NEWELT to front of PLACE #+BEGIN_SRC emacs-lisp (push NEWELT PLACE) #+END_SRC - Invoke 'FUNCTION for each in SEQUENCE #+BEGIN_SRC emacs-lisp (mapcar FUNCTION SEQUENCE) #+END_SRC - Search/replace #+BEGIN_SRC emacs-lisp (while (search-forward "Hello") (replace-match "Bonjour")) #+END_SRC - Save to kill ring = copy. - Point = cursor position. - Mark = a buffer position. - Kill = cut text. - Yank = paste. - Buffer:File = 1:1. - Window:Buffer = 1:1. - Frame:Window = 1:many. - Font lock = syntax highlighting. * [2015-03-06 Fri] Apple Watch bookmarks :PROPERTIES: :CUSTOM_ID: apple-watch-bookmarks :END: - [[http://lionet.livejournal.com/137350.html][Swift, Apple Watch, and Dynamic Graphs]]. * [2015-03-05 Thu] iOS bookmarks :PROPERTIES: :CUSTOM_ID: ios-bookmarks :END: :MODIFIED: [2021-07-07 Wed] :END: - [[https://medium.com/ios-apprentice/11-insanely-great-ios-developers-sites-95686a523ea8][11 Insanely Great iOS Developers Sites]]. - [[https://medium.com/flawless-app-stories/30-great-ui-kits-for-ios-engineers-41b2732896b9][30 great UI Kits for iOS engineers – Flawless App Stories – Medium]]. - [[https://github.com/iosphere/ISHHoverBar][A floating UIToolBar replacement as seen in the iOS 10 Maps app]]. - [[http://phonegap-tips.com/articles/debugging-ios-phonegap-apps-with-safaris-web-inspector.html][Access mobile Safari via web inspector]]. - [[https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/DocumentPickerProgrammingGuide/AccessingDocuments/AccessingDocuments.html][Accessing Documents/Files (iOS)]]. - [[https://developer.apple.com/library/ios/technotes/tn2259/_index.html][Adding in-app purchase]]. - [[http://furbo.org/2015/05/11/an-import-ant-change-in-xcode/][An @import-ant Change in Xcode]]. - [[https://developer.apple.com/documentation/mapkit/mkgeojsondecoder][An object that decodes GeoJSON objects into MapKit types]]. - [[https://developer.apple.com/documentation/imageio/3333271-cganimateimageaturlwithblock][Animated Gifs with CGAnimateImageAtURLWithBlock]]. - [[https://developer.apple.com/library/ios/documentation/General/Conceptual/DevPedia-CocoaCore/AppID.html][App IDs]]. - [[https://devimages.apple.com.edgekey.net/app-store/review/guidelines/App-Review-Guidelines-The-Comic-Book.pdf][App review guidelines (comic book)]]. - [[https://developer.apple.com/library/ios/documentation/general/conceptual/CocoaEncyclopedia/Introduction/Introduction.html#//apple_ref/doc/uid/TP40010810-CH1-SW1][Apple docs]]. - [[https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingMethods.html#//apple_ref/doc/uid/20001282-BCIGIJJF][Apple's coding guidelines for Cocoa]]. - [[https://developer.apple.com/library/ios/documentation/general/conceptual/CocoaEncyclopedia/Initialization/Initialization.html#//apple_ref/doc/uid/TP40010810-CH6-SW3][Apple's Concepts in Objective-C programming]]. - [[https://developer.apple.com/library/ios/documentation/userexperience/Conceptual/MobileHIG/index.html#//apple_ref/doc/uid/TP40006556][Apple's mogile HIG guidelines]]. - [[https://developer.apple.com/library/ios/samplecode/PhotoScroller/Introduction/Intro.html][Apple's PhotoScroller]]. - [[https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/AttributedStrings/AttributedStrings.pdf][Attributed String Programming Guide]]. - [[http://www.knowstack.com/autolayout-visual-format-language-objective-c-sample-code/][Autolayout Visual Format Language – Objective C Sample Code]]. - [[https://developer.apple.com/library/prerelease/ios//documentation/AVFoundation/Reference/AVCaptureSession_Class/index.html][AVCaptureSession]]. - [[https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVCaptureVideoPreviewLayer_Class/index.html][AVCaptureVideoPreviewLayer]]. - [[http://www.raywenderlich.com/22167/beginning-core-image-in-ios-6][Beginning Core Image in iOS 6]]. - [[https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/TestingYouriOSApp/TestingYouriOSApp.html#//apple_ref/doc/uid/TP40012582-CH8-SW1][Beta testing your app]]. - [[http://www.objc.io/issues/23-video/capturing-video/][Capturing video on iOS]]. - [[https://github.com/steventroughtonsmith/cartool][Cartool (Inspect car files)]]. - [[https://github.com/clayallsopp/CLAFluxDispatcher][CLAFluxDispatcher: A port of Facebook's Flux Dispatcher to Objective-C]]. - [[http://clang.llvm.org/docs/Block-ABI-Apple.html][Clang 3.7 documentation BLOCK IMPLEMENTATION SPECIFICATION]]. - [[https://github.com/luisobo/clean-architecture][Clean architecture for iOS]]. - [[https://www.cocoacontrols.com/][Cocoa controls]]. - [[http://cocoadocs.org/][Cocoadocs]]. - [[http://www.objc.io/issue-6/cocoapods-under-the-hood.html][Cocoapods under the hood]]. - [[http://cocoapods.org/][Cocoapods]]. - [[http://codepilot.cc][Code pilot]]. - [[https://www.codeschool.com/paths/ios][Code School iOS courses]]. - [[https://www.codeschool.com/learn/ios][Codeschool iOS]]. - [[http://en.wikipedia.org/wiki/Color_difference][Color difference]]. - [[http://componentkit.org/][ComponentKit is an Objective-C++ view framework for iOS that is heavily inspired by React]]. - [[http://componentkit.org/][ComponentKit]]. - [[https://github.com/ethanhuang13/NSAttributedStringBuilder][Composing NSAttributedString with SwiftUI-style syntax]]. - [[https://developer.apple.com/documentation/foundation/nsdata/3174960-compressed][Compressing data with Foundation APIs]]. - [[http://www.cakesolutions.net/teamblogs/2014/03/08/cmsamplebufferref-from-cgimageref][Create a CMSampleBufferRef from CGImageRef]]. - [[https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/CreatingiTunesConnectRecord.html][Creating iTunes Connect Record]]. - [[https://github.com/facebook/css-layout][css-layout: Facebook's layout transpiled to C, Java and C#]]. - [[https://developer.apple.com/documentation/security/password_autofill/customizing_password_autofill_rules][Customizing Password AutoFill Rules]]. - [[http://www.davemark.com/?p=1829][DaveLots of iOS resources]]. - [[https://itunes.apple.com/gb/course/developing-ios-7-apps-for/id733644550][Developing iOS 7 Apps for iPhone and iPad (Standford lectures)]]. - [[https://developer.apple.com/library/ios/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/UsingTextClasses/UsingTextClasses.html][Displaying Text Content in iOS]]. - [[https://cocoapods.org/pods/DJKFlipper][DJKFlipper]]. - [[http://www.effectiveobjectivec.com/][Effective Objective-C]]. - [[http://www.slideshare.net/j796160836/everything-about-bluetooth-40-central][Everything about bluetooth central (slideshare)]]. - [[http://spin.atomicobject.com/2016/01/25/ios-memory-leak-xcode/#.VqaGcF_w1AE.hackernews][Finding iOS memory leaks with Xcode's Instruments]]. - [[https://speakerdeck.com/sergeyzenchenko/flux-for-ios][Flux for iOS by Sergey Zenchenko]]. - [[https://github.com/techery/FLUX][FLUX implementation in Objective-C]]. - [[https://github.com/mattt/FormatterKit][FormatterKit: a collection of well-crafted NSFormatter subclasses for things like units of information, distance, and relative time intervals]]. - [[http://www.objc.io/issue-5/getting-to-know-textkit.html][Getting to know TextKit]]. - [[https://www.kairadiagne.com/2019/04/27/getting-up-to-speed-with-uicollectionviewlayout.html][Getting up to speed with UICollectionView layouts]]. - [[http://giorgiocalderolla.com/blog.html][Giorgio Calderolla]]. - [[https://github.com/WeTransfer/WeScan][GitHub - WeTransfer/WeScan: Document Scanning Made Easy for iOS]]. - [[http://www.emdentec.com/blog/2014/2/25/hacking-uinavigationbar][Hacking UINavigationBar]]. - [[https://realm.io/news/altconf-conrad-kramer-writing-iOS-sdk/][How (Not) to Write an iOS SDK]]. - [[http://goshdarnblocksyntax.com/][How do I declare a block in Objcetive-C?]] - [[https://www.hackingwithswift.com/example-code/uikit/how-to-detect-dark-mode-in-ios][How to detect dark mode in iOS]]. - [[https://www.appcoda.com/files-app-integration/][How to Integrate Your App with Files App in iOS 11 | Swift Tutorial]]. - [[http://easynativeextensions.com/how-to-launch-your-app-from-the-ios-8-share-menu/][How to launch your app from the iOS 8 Share Menu – updated for iOS 8.4]]. - [[https://medium.com/flawless-app-stories/how-to-make-auto-layout-more-convenient-in-ios-df3b42fed37f][How to make Auto Layout more convenient in iOS]]. - [[http://levibostian.com/blog/create-cocoapod/][I created my first CocoaPods library!]]. - [[https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html][Icon Matrix]]. - [[http://www.raywenderlich.com/69855/image-processing-in-ios-part-1-raw-bitmap-modification][Image Processing in iOS Part 1: Raw Bitmap Modification]]. - [[http://www.raywenderlich.com/71151/image-processing-ios-part-2-core-graphics-core-image-gpuimage][Image Processing in iOS Part 2: Core Graphics, Core Image, and GPUImage]]. - [[http://nshipster.com/image-resizing/][Image resizing techniques]]. - [[https://github.com/indragiek/INDANCSClient][INDANCSClient: Objective-C Apple Notification Center Service Implementation (Bluetooth LE)]]. - [[https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-SW10][Info PList key reference]]. - [[http://injectionforxcode.com][Injection for Xcode]]. - [[https://www.cocoawithlove.com/blog/introducing-cwlviews.html][Introducing CwlViews]]. - [[http://www.colourphil.co.uk/lab_lch_colour_space.shtml][Introduction to color spaces]]. - [[https://developer.apple.com/videos/play/wwdc2016/413][Introduction to Xcode (Apple WWDC 2016)]]. - [[http://stackoverflow.com/questions/40904676/how-to-merge-two-video-with-transparency][ios - how to merge two video with transparency - Stack Overflow]]. - [[http://puzzles.design/][iOS 10 UI]]. - [[https://www.safaribooksonline.com/library/view/ios-6-programming/9781449342746/ch03s03.html][iOS 6 Programming Cookbook]]. - [[http://shop.oreilly.com/product/0636920044338.do][iOS 9 programming cookbook]]. - [[https://medium.com/ios-apprentice/the-valuable-toolset-for-ios-development-ba312d12577d][iOS Apprentice]]. - [[https://iosdev.tools/][iOS Dev Tools]]. - [[http://ios.devtools.me][iOS Dev Tools]]. - [[http://iosdevweekly.com][iOS dev weekly]]. - [[http://www.appcoda.com/ios-programming-101-send-email-iphone-app/][iOS Programming 101: How To Send Email in Your iPhone App]]. - [[http://www.bignerdranch.com/we-write/ios-programming.html][iOS Programming]]. - [[https://www.bignerdranch.com/we-write/ios-programming/][iOS Programming: The Big Nerd Ranch Guide (4th Edition)]]. - [[https://www.bignerdranch.com/we-write/ios-programming/][iOS Programming: The Big Nerd Ranch Guide]]. - [[https://github.com/stanislaw/iOS-Projects-Catalogue][iOS projects catalogues]]. - [[http://www.mysamplecode.com/2012/12/ios-scrollview-example-with-paging.html][iOS ScrollView Example with Paging]]. - [[https://www.apple.com/business/site/docs/iOS_Security_Guide.pdf][iOS Security]]. - [[https://github.com/phonegap/ios-deploy][ios-deploy: Install and debug iOS apps without using Xcode]]. - [[http://ios-goodies.com][ios-goodies.com]]. - [[http://iosdevtips.co][iosdevtips.co]]. - [[https://github.com/boredzo/iso-8601-date-formatter][iso-8601-date-formatter: A Cocoa NSFormatter subclass converting to and from ISO-8601-formatted strings ]]. - [[https://github.com/jessedc/JCTiledScrollView][JCTiledScrollView]]. - [[http://joppar.com/mobile-app-development-resources-guide/][joppar.com]]. - [[https://github.com/krzysztofzablocki/KZFileWatchers][KZFileWatchers (observer file changes)]]. - [[http://en.wikipedia.org/wiki/Lab_color_space][Lab color space]]. - [[https://github.com/JiriTrecak/Laurine][Laurine: Localization code generator]]. - [[https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingProfiles/MaintainingProfiles.html][Maintaining profiles]]. - [[http://khanlou.com/2016/02/many-controllers/][Many Controllers Make Light Work (Analytics)]]. - [[http://iphone.meer.li/designs/featured?page=3][Meerli]]. - [[https://www.mikeash.com/book.html][Mike Ash]]. - [[https://sarunw.com/posts/modality-changes-in-ios13/][Modality changes in iOS13 | Sarun]]. - [[https://github.com/2359media/ios-dev-guide/blob/master/iOS%20Topics%20and%20References.md][More aggregation of awesomeness on github]]. - [[https://github.com/muccy/MUKContentRedux][MUKContentRedux: provides a store for immutable data which can be updated only applying actions]]. - [[http://nshipster.com/xcode-plugins/][NSHipster's Xcode plugins post]]. - [[http://www.hpique.com/2013/12/nsnotificationcenter-part-2/][NSNotificationCenter part 2: Implementing the observer pattern with notifications]]. - [[http://nsscreencast.com/episodes][NSScreencasts]]. - [[https://github.com/objc-zen/objc-zen-book][Objc-C Zen book]]. - [[http://www.objc.io/][Objc.io]]. - [[http://oclint.org/][Objective-C linter]]. - [[http://www.amazon.co.uk/Objective-C-Programming-Ranch-Guide-Guides/dp/032194206X][Objective-C Programming: The Big Nerd Ranch Guide (Big Nerd Ranch Guides)]]. - [[http://www.osstatus.com/?utm_campaign=iOS%2BDev%2BWeekly&utm_medium=email&utm_source=iOS_Dev_Weekly_Issue_201][OSStatus: Lookup Apple API errors fast]]. - [[https://www.paintcodeapp.com/][PaintCode - Turn your drawings into Objective-C or Swift drawing code]]. - [[http://phatblat.com/2016/05/10/uisearchcontroller.html][phatblat's post on UISearchController]]. - [[https://developer.apple.com/documentation/uikit/view_controllers/preserving_your_app_s_ui_across_launches][Preserving Your App's UI Across Launches | Apple Developer Documentation]]. - [[http://sugartin.info/2011/10/13/sending-a-mail-useing-gmail/][Programatically send an email using CFNetwork and GMail]]. - [[https://github.com/mattneub/Programming-iOS-Book-Examples][Programming iOS Book examples]]. - [[https://tanaschita.com/posts/20191015-quick-guide-on-supporting-dark-mode-on-ios/][Quick guide on supporting Dark Mode on iOS]]. - [[http://www.raywenderlich.com/tutorials][Ray Wendelich]]. - [[https://realm.io/addons/][realm (mobile database), plus map view, search list view, and grid view]]. - [[https://medium.com/@alexdunn/replace-xcode-with-neovim-c81f89a50a23][Replace Xcode with Neovim]]. - [[https://github.com/ReSwift/ReSwift][ReSwift Redux-like implementation of the unidirectional data flow architecture in Swift]]. - [[http://revealapp.com][Reveal]]. - [[http://rypress.com/tutorials/objective-c/functions][Ry’s Objective-C Tutorial: Functions]]. - [[https://nalexn.github.io/save-your-next-app/][Save your next app from rebuilding from scratch - Alexey Naumov]]. - [[https://blog.alltheflow.com/scrollable-uistackview/][Scrollable UIStackView]]. - [[https://blog.frozenfirestudios.com/setting-up-a-cloudkit-project-ca9ac1883511][Setting up a CloudKit Project – Frozen Fire Studios]]. - [[https://blog.couchbase.com/sharing-data-ios-app-extensions-sync-capability/][Share data between iOS Apps & App Extensions across devices]]. - [[https://github.com/ShareSDKPlatform/ShareSDK][ShareSDK is the most comprehensive Social SDK]]. - [[http://www.atomicbird.com/blog/sharing-with-app-extensions][Sharing data between iOS apps and app extensions]]. - [[https://github.com/facebook/Shimmer][Shimmer: Shimmer is an easy way to add a shimmering effect to any view in your app]]. - [[https://medium.com/xcblog/simctl-control-ios-simulators-from-command-line-78b9006a20dc][simctl: Control iOS Simulators from Command Line - XCBlog - Medium]]. - [[https://blog.goposse.com/simpleanimatingwithsnapkit-e38ed2980ac2#.n6gzo6syp][Simple Animation With SnapKit]]. - [[https://github.com/jessedc/SliceTool/blob/master/SliceTool.m][SliceTool]]. - [[http://www.cimgf.com/2011/03/01/subduing-catiledlayer/][Subduing CATiledLayer]]. - [[http://subjc.com][Subjective-C]]. - [[https://medium.com/apple-developer-academy-federico-ii/syncing-data-on-ios-devices-with-coredata-and-cloudkit-bed296fc26e0][Syncing data on iOS devices with CoreData and CloudKit]]. - [[http://www.invisionapp.com/tethr?utm_source=ios%20dev%20tools&utm_medium=website&utm_campaign=ios%20dev%20tools&at=11lvzs&ct=ios%20dev%20tools][TETHR]]. - [[http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html][The Complete Tutorial on iOS/iPhone Custom URL Schemes]]. - [[http://savvyapps.com/blog/ultimate-guide-choosing-objective-c-or-swift][The Ultimate Guide to Choosing Objective-C or Swift for Your Project]]. - [[https://github.com/jlamarche/Tile-Cutter][Tile-Cutter]]. - [[https://benoitpasquier.com/tools-tips-to-scale-ios-project-and-team/][Tools and tips to scale your iOS project along with your team]]. - [[https://developer.apple.com/library/mac/releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html][Transitioning to ARC]]. - [[https://github.com/Ekhoo/Translucid][Translucid: Simple and light weight UIView that animate text with an image]]. - [[https://github.com/zh-wang/TwitterGifComposer][Twitter GIF composer]]. - [[http://masilotti.com/ui-testing-xcode-7/][UI Testing in Xcode 7]]. - [[https://developer.apple.com/documentation/uikit/uicollectionviewcompositionallayout][UICollectionViewCompositionalLayout - UIKit | Apple Developer Documentation]]. - [[http://stackoverflow.com/questions/14912938/uicolor-cmyk-and-lab-values][UIColor CMYK and Lab Values?]]. - [[https://twitter.com/twostraws/status/1135639902337478656][UIImage has a new initializer, UIImage(systemName:) that takes a string and returns one of over 1500 different system icons.]]. - [[https://github.com/PaulSolt/UIImage-Conversion][UIImage-Conversion]]. - [[https://spin.atomicobject.com/2020/03/23/uiscrollview-content-layout-guides/][UIScrollView with Content Layout Guides]]. - [[https://twitter.com/smileyborg/status/1115120700493144065][UITableView and UICollectionView: update your data model *inside* the batch updates block]]. - [[http://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions][Ultimate guide to resolutions]]. - [[https://itunesconnect.apple.com/docs/UsingApplicationLoader.pdf][Using Application Loader]]. - [[https://developer.apple.com/library/ios/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/CustomTextProcessing/CustomTextProcessing.html][Using Text Kit to Draw and Manage Text]]. - [[https://github.com/ColinEberhardt/VCTransitionsLibrary][VCTransitionsLibrary]]. - [[https://medium.com/@hacknicity/view-controller-presentation-changes-in-ios-13-ac8c901ebc4e][View Controller Presentation Changes in iOS 13 - Geoff Hackworth - Medium]]. - [[http://commandshift.co.uk/blog/2013/01/31/visual-format-language-for-autolayout/][Visual Format laguange for Auto Layout]]. - [[https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/VisualFormatLanguage.html][Visual Format Language (Apple reference)]]. - [[http://nsscreencast.com][Weekly bite-sized screencasts on iOS dev]]. - [[http://stackoverflow.com/questions/649454/what-is-the-best-way-to-average-two-colors-that-define-a-linear-gradient][What's the best way to average two colors that define a linear gradient?]]. - [[https://developer.apple.com/library/ios/qa/qa1713/_index.html][When to use App ID wildcards]]. - [[https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/WorkingwithBlocks/WorkingwithBlocks.html][Working with blocks]]. - [[https://developer.apple.com/videos/wwdc/2012/][WWDC 2012 Xcode tips]]. - [[https://developer.apple.com/videos/wwdc/2014/][WWDC 2014]]. - [[https://github.com/ohoachuck/wwdc-downloader][WWDC 2015, 2014, 2013 and Tech-talks 2013 (videos and pdf downloader)]]. - [[https://developer.apple.com/reference/xctest][XCTest documentation]]. - [[https://github.com/KonradCLAPP/YawImageViewer][YawImageViewer]]. - [[http://bpoplauschi.wordpress.com][Yet another iOS Blog]]. - [[https://github.com/YouXianMing/Animations][YouXianMing's animation collection]]. - [[https://www.cloudcity.io/blog/2015/10/15/developing-ios-app-using-ble-standard/][Zero to BLE on iOS – Part Two]]. - [[https://github.com/zhhlmr/ZHPopupView][ZHPopupView]]. * [2015-03-05 Thu] Kerala travel bookmarks :PROPERTIES: :CUSTOM_ID: kerala-travel-bookmarks :END: - Bagel Shop, 30 Pali Mala Road, off Carter Road, Bandra (W) (+91 22 2605-0178). Daily 9.00AM-10.00PM. Meal for two R500-R800. - Hotel Natraj, 22-24 City Station Road, Udaipur (near Bapu Bazaar), +91-294-2487488, +91-94147-57893, - Kala Ghoda Café,10 Ropewalk Lane, Kala Ghoda (+91 22 2263-3866). Daily 8.30AM-11.30PM. Meal for two R600. - Kochin (Fort Kochin) - old port town with Chinese, Portuguese, Dutch, British and Jewish heritage. - Munnar - hill station and centre of tea, coffee and spice growing. Great hiking and spectacular views. - Periyar Wildlife Sanctuary. - Suzette, Atlanta Building, Nariman Point (+91 22 2288-0055). Daily 9.00AM-11.00PM. Also at Bandra. Meal for two R600-R1,000. - Varkala - chilled out beach resort. - Yoga House, 53 Chimbai Road, behind St Andrew's Church, off Hill Road, Bandra (W)(+91 22 6554- 5001). Daily 7.00AM-10.30PM. * [2015-03-05 Thu] India travel bookmarks :PROPERTIES: :CUSTOM_ID: india-travel-bookmarks :END: :MODIFIED: [2021-01-02 Sat] :END: - [[https://news.ycombinator.com/item?id=13119986][A Guide to the Breads of India (Hacker News)]]. - A route: blore - pune - mumbai - ahmedabad - mt abu - udaipur - jaipur - amritsar - chandigarh - jammu - srinagar - kargil - leh. - [[https://www.abandonedamerica.us/abandoned-bhangarh-fort-india-grounds][Abandoned Bhangarh Fort, India | Grounds View]]. - [[https://www.abandonedamerica.us/abandoned-bhangarh-fort-india-temple][Abandoned Bhangarh Fort, India | Temple Detail]]. - [[https://www.abandonedamerica.us/abandoned-bundi-palace-india-grand][Abandoned Bundi Palace, India | Grand Wedge]]. - [[https://www.abandonedamerica.us/abandoned-cannon-factory-india-elephant][Abandoned Cannon Factory, India | Elephant Columns]]. - [[https://www.abandonedamerica.us/abandoned-cannon-factory-india-interior][Abandoned Cannon Factory, India | Interior Room]]. - [[https://www.abandonedamerica.us/abandoned-jahangir-mahal-palace-orchha][Abandoned Jahangir Mahal Palace, Orchha India | Lovely Symmetry]]. - [[https://www.abandonedamerica.us/abandoned-laxminarayan-temple-orchha-india][Abandoned Laxminarayan Temple, Orchha India | Hallway View]]. - [[https://www.abandonedamerica.us/abandoned-raniji-ki-baori-stepwell][Abandoned Raniji Ki Baori Stepwell, Bundi India | Columns]]. - [[https://en.wikipedia.org/wiki/Akshardham_%28Delhi%29][Akshardham (Delhi)]]. - [[https://www.google.com/culturalinstitute/browse/?f.media_type=museumview&q.8129907598665562501=139704082&q.openid=media_type][Archeological survey of india sites]]. - [[https://duckduckgo.com/?q=belur+mysore&t=ffab&iax=images&ia=images][Belur temple mysore]]. - [[https://en.wikipedia.org/wiki/bhaja_caves][Bhaja caves, pune, maharashtra]]. - [[http://en.wikipedia.org/wiki/bhang][Bhang]]. - [[http://en.wikipedia.org/wiki/bodh_gaya][Bodh gaya]]. - [[http://joegoauk.blogspot.co.uk/2013/07/budbudyanchi-tali-bubbling-pond-at.html][Budbudyanchi tali (bubbling pond) at netravali, sanguem, goa]]. - [[https://en.wikipedia.org/wiki/chand_baori][Chand baori (Wikipedia)]]. - [[http://www.amusingplanet.com/2012/10/chand-baori-step-well-in-rajasthan-india.html][Chand baori]]. - Chandipur Beach. - [[https://duckduckgo.com/?q=Chittorgarh&t=ffab&ia=images][Chittorgarh]]. - [[https://www.tripsavvy.com/how-to-travel-on-the-darjeeling-himalayan-railway-toy-train-1539631][Darjeeling Himalayan Railway Toy Train: Essential Guide]]. - [[https://en.wikipedia.org/wiki/Daulatabad,_Maharashtra][Daulatabad fort]]. - [[https://www.reddit.com/r/travel/comments/5cmc8e/girlfriend_and_i_traveled_around_asia_and_europe/][dawnoflife07's India trip/pictures]]. - [[https://en.wikipedia.org/wiki/Descent_of_the_Ganges_(Mahabalipuram)][Descent of the Ganges (Mahabalipuram)]]. - [[http://www.odditycentral.com/pics/dining-with-the-dead-at-indias-new-lucky-restaurant.html][Dining with the Dead at the New Lucky Restaurant]]. - [[http://www.bdlmuseum.org/][Dr. Bhau Daji Lad museum]]. - Emergencies: +1-650-253-5555. - Gaya, Bihar. - [[https://en.wikipedia.org/wiki/Gwalior][Gwalior]]. - [[https://duckduckgo.com/?q=halibid+temple&t=ffab&iax=images&ia=images][Halibid temple]]. - [[https://en.wikipedia.org/wiki/Hampi][Hampi]]. - [[https://india.zeef.com/gautam.garg][India on zeef]]. - [[https://www.lonelyplanet.com/articles/india-best-step-wells-to-visit][India's most beautiful stepwells and how to visit them - Lonely Planet]]. - [[http://www.irctctourism.com/][IRCTC Tourism (A government of India enterprise)]]. - [[https://en.m.wikipedia.org/wiki/Jil_jil_jigarthanda][Jil jil jigarthanda]]. - [[https://duckduckgo.com/?q=Jodhpur&t=ffsb&ia=images][Jodhpur]]. - [[https://twitter.com/GiriShikhara/status/605754976959275011/photo/1][Kalyani/Pushkarini at Hulikere near Halebeedu,KA built by Hoysalas]]. - [[https://en.wikipedia.org/wiki/Karni_Mata][Karni Mata (rats temple)]]. - [[https://duckduckgo.com/?q=Khajuraho&t=ffab&ia=images][Khajuraho]]. - Khandala. - [[https://twitter.com/wrathofgnon/status/1268080568387817472][Khotachi Wadi]]. - [[https://duckduckgo.com/?q=kovalam+beach&t=ffab&iax=1&ia=images][Kovalam beach]]. - Lonavala. - Mahabaleshwar. - [[https://en.wikipedia.org/wiki/Mahabalipuram][Mahabalipuram]]. - [[https://www.lonelyplanet.com/india/himachal-pradesh/manali][Manali travel | India, Asia - Lonely Planet]]. - [[https://en.wikipedia.org/wiki/Manali,_Himachal_Pradesh][Manali, Himachal Pradesh]]. - [[https://en.wikipedia.org/wiki/Manali,_Himachal_Pradesh][Manali]]. - Mumbai - Bademita: chicken tikka. - Mumbai - Bagdadi restaurant. - Mumbai - Banaganga lake (Banganga cross lane). - Mumbai - Bhel puri (find in stalls). - Mumbai - Cafe Britannia (Kumtha St or Adi Murzaban Path with Shahid Bhaghat Singh Rd). - Mumbai - Crawford market: revivat Indian thali. - Mumbai - [[http://www.lonelyplanet.com/india/mumbai-bombay/travel-tips-and-articles/eat-mumbai-make-the-most-of-indias-foodie-capital][Eat Mumbai – make the most of India's foodie capital]]. - Mumbai - Elephanta caves. - Mumbai - [[http://www.finelychopped.net/2011/09/colours-of-bandras-pali-market-lallu.html][Pali Market]]. - Mumbai - The times of India: masala dosa. - Mumbai - University of Mumbai. - Mumbai - Vada pav (find in stalls). - Mumbai - Victoria station: chai. - Mumbai- [[http://www.theguardian.com/travel/2012/mar/01/10-best-street-food-mumbai-india][10 of the best food in Mumbai]]. - [[http://hippie-inheels.com/india-travel-bucket-list/][My India travel Bucket List]]. - Nagpur. - [[https://www.tripadvisor.co.uk/Restaurant_Review-g297630-d5326840-Reviews-New_Taj_Mahal_Cafe-Mangalore_Dakshina_Kannada_District_Karnataka.html][New Taj Mahal cafe, Mangalore Buns (banana)]]. - [[https://duckduckgo.com/?q=Orchha&t=ffab&ia=images][Orchha]]. - Panchgani. - [[https://en.wikipedia.org/wiki/pandavleni_caves][Pandavleni caves, nashik, maharashtra]]. - [[https://en.wikipedia.org/wiki/havelock_island][Radhanagar beach]]. - [[https://en.m.wikipedia.org/wiki/Rishikesh][Rishikesh]]. - [[https://en.wikipedia.org/wiki/Sabarmati_Ashram][Sabarmati Ashram]]. - [[http://satyagrahabali.org/Satyagraha_brochure_email_English.pdf][Satyagraha Ashram]] (founded by Gandhi). - [[https://www.lonelyplanet.com/india/himachal-pradesh/shimla][Shimla (forest/trees) - Lonely Planet]]. - [[https://www.quora.com/What-are-the-best-places-in-Pune-for-couples-to-spend-whole-day][Things to do in Pune (Quora)]]. - [[https://www.lonelyplanet.com/india/uttarakhand-uttaranchal][Uttarakhand travel | India, Asia - Lonely Planet]]. - Varanasi. - [[https://twitter.com/archpics/status/1016803768413949952][Vijaya Nagara, India Centuries-old temples and statues surround Hampi, in southwest India, making up what’s left of the once-powerful city.]]. - [[https://duckduckgo.com/?q%3dvipassana%2bpagoda&iax%3d1&ia%3dimages][Vipassana pagoda]]. - [[http://ajantaali.blogspot.com/][Welcome Ajanta, India (Shishu's site)]]. - [[https://en.wikipedia.org/wiki/Western_Ghats][Western Ghats]]. * [2015-03-05 Thu] Git bookmarks :PROPERTIES: :CUSTOM_ID: git-bookmarks :END: :MODIFIED: [2020-12-23 Wed] :END: - [[https://citizen428.net/10-common-git-problems-and-how-to-fix-them-e8d809299f08][10 Common Git Problems and How to Fix Them – citizen428.blog]]. - [[http://wildlyinaccurate.com/a-hackers-guide-to-git][a hackers guide to git]] - [[https://blog.scottnonnenberg.com/better-git-configuration/][Better Git configuration | Scott Nonnenberg]]. - [[http://nakkaya.com/2009/09/24/git-delete-last-commit/][delete last commit]] - [[https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/][Get up to speed with partial clone and shallow clone - The GitHub Blog]]. - [[http://jr0cket.co.uk/slides/getting-started-with-git.html#/][Getting Started with Git & Github]]. - [[https://easyengine.io/tutorials/git/git-resolve-merge-conflicts/][Git - Quickest Way to Resolve Most Merge Conflicts]]. - [[https://commonflow.org/][Git Common-Flow]]. - [[http://www.git-tower.com/learn/?utm_source=tower+blog&utm_medium=sidebar&utm_campaign=learn-git][git course]]: another git online tutorial, by git-tower folks. - [[https://jwiegley.github.io/git-from-the-bottom-up/][Git from the Bottom Up]]. - [[https://codewords.recurse.com/issues/two/git-from-the-inside-out][Git from the inside out]]. - [[https://ochronus.com/git-tips-from-the-trenches/][git from the trenches]]. - [[https://spin.atomicobject.com/2019/01/10/git-merging-vs-rebasing/?utm_source=feedblitz&utm_medium=FeedBlitzRss&utm_campaign=atomicspin][Git Merging vs. Git Rebasing: The Beginner's Guide]]. - [[http://caspervonb.com/tools/git-recipes-for-the-common-mistakes-and-mishaps/][git recipes for common mistakes and mishaps]]. - [[https://www.kevinkuszyk.com/2018/12/10/git-tips-6-using-git-with-multiple-email-addresses/][Git Tips #6 - Using Git with Multiple Email Addresses]]. - [[https://github.com/k88hudson/git-flight-rules][GitHub - k88hudson/git-flight-rules: Flight rules for git]]. - [[https://github.com/susam/gitpr][GitHub - susam/gitpr: A quick reference guide on fork and pull request workflow]]. - [[https://about.gitlab.com/2015/02/17/gitlab-annex-solves-the-problem-of-versioning-large-binaries-with-git/][GitLab Annex solves the problem of versioning large binaries with git]]. - [[https://www.moxio.com/blog/43/ignoring-bulk-change-commits-with-git-blame][Ignoring bulk change commits with git blame - Moxio]]. - [[https://git.wiki.kernel.org/index.php/git_faq][kernel's git faq]]. - [[http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html][model git commit message]] - [[https://github.com/blog/2042-git-2-5-including-multiple-worktrees-and-triangular-workflows][Multiple worktrees and triangular workflows (multiple branches checked out)]]. - [[http://ndpsoftware.com/git-cheatsheet.html][ndp software's git cheatsheet]] - [[https://ohshitgit.com/][Oh, shit, git!]]. - [[https://harryrschwartz.com/2020/06/11/renaming-your-default-git-branch][Renaming Your Default Git Branch (Harry R. Schwartz)]]. - [[http://git-scm.com/blog/2010/03/08/rerere.html][rerere: reuse recorded resolution]]. - [[http://www.matheuslima.com/things-you-didnt-know-about-git][things you didn't know about git]]. - [[https://twitter.com/dmartincy/status/1188604333430104064][TIL about git-subline-merge]]. - [[https://www.sbf5.com/~cduan/technical/git/][Understanding Git Conceptually]]. - [[https://upcase.com/mastering-git][Upcase's mastering Git course]]. - [[https://willschenk.com/articles/2020/using_askgit/][Using Askgit (sql interface to your git repository)]]. * [2015-03-04 Wed] Language learning bookmarks :PROPERTIES: :CUSTOM_ID: language-learning-bookmarks :END: :MODIFIED: [2018-10-30 Tue] :END: - [[https://www.hackingchinese.com/about/practical-guide-to-learning-mandarin/][Hacking Chinese: A Practical Guide to Learning Mandarin (Hacking Chinese)]]. - HN's comments on [[https://news.ycombinator.com/item?id%3d8806678][learning laguages]]. - [[https://www.michelthomas.com/how-it-works.php][How it Works - Language Learning with The Michel Thomas Method]]. - [[http://fourhourworkweek.com/2007/11/07/how-to-learn-but-not-master-any-language-in-1-hour-plus-a-favor/][How to learn (But Not Master) Any Language in 1 Hour (Plus: A Favor)]]. - [[https://reader.manabi.io/][Manabi Reader – Learn Japanese by Reading on iOS]]. - [[https://woodypianoshack.com/][Welcome - Woody Piano Shack]]. * [2015-02-18 Wed] Git conflict resolution déjà vu? :PROPERTIES: :CUSTOM_ID: git-conflict-resolution-deja-vu :END: use git [[http://git-scm.com/blog/2010/03/08/rerere.html][rerere]]. here's a [[https://medium.com/@porteneuve/fix-conflicts-only-once-with-git-rerere-7d116b2cec67][post]]. * [2015-01-17 Sat] Graphics design tools bookmarks :PROPERTIES: :CUSTOM_ID: graphics-design-tools-bookmarks :END: :MODIFIED: [2021-07-11 Sun] :END: - [[https://twitter.com/nixcraft/status/1413395599534088194][Alternatives to Adobe products on Linux, macOS and Windows]]. - [[http://www.aseprite.org/][Aseprite]]. - [[https://github.com/LisaDziuba/Awesome-Design-Tools/][Awesome-Design-Tools: The best design tools for everything]]. - [[http://leaverou.github.io/contrast-ratio][Contrast ratio]]. - [[https://designcode.io][Design+code]]. - [[https://www.animatron.com/][HTML5 animations]]. - [[http://blog.mengto.com/quick-ios-prototyping-flinto/][Ios prototyping with flinto]]. - [[https://krita.org/][Krita]]. - [[https://www.getleonardo.com/][Leonardo]]. - [[https://makeappicon.com/][MakeAppIcon - Generate app icons of all sizes with a click!]]. - [[https://www.madewithmischief.com/][Mischief]]. - [[http://mypaint.intilinux.com/][Mypaint]]. - [[https://natron.inria.fr/][Natron]]. - [[https://www.getormr.com/features/][Ormr]]. - [[https://screen.guru][Screen Guru - Take clean screenshot of any websites]]. - [[http://bohemiancoding.com/sketch/][Sketch for Mac]]. - [[http://www.sketchup.com/][Sketchup]]. - [[http://www.tvpaint.com][TVPaint]]. * [2015-04-23 Thu] Emacs key bindings and maps :PROPERTIES: :CUSTOM_ID: emacs-key-bindings-and-maps :END: ** based on [[http://www.masteringemacs.org/article/mastering-key-bindings-emacs][masteringemacs.org]]. ** bonus tip prefix key, followed by c-h, lists keys in prefix. ** keymap maps key to action. ** keymap found in buffer and most major modes. ** keys - undefined: self explanatory. - prefix key: ie. c-x (part of complete key). - complete key: complete input executes associated command. ** mapping - (define-key keymap key def): add to current buffer map. - (local-set-key key command): add to active buffer (no map option). - (local-unset-key key) - (global-set-key key command): add to global keymap (all buffers). - (global-unset-key key) ** key codes - kbd: macro transaltes human-readable key to emacs readable. - function and navigation keys must be surrounded by <>. - example: (kbd "c-c p") or (kbd "") of (kbd ""). ** remapping - use remap to replace mapping (ie. kill-line with my/kill-line). - (define-key keymap [remap original-function] 'my-own-function). ** reserved keys - "c-c ?" generally reserved for you, but third party packages use it. - function keys (ie. f1-f12). - hyper and super (ancient). ** lookup order - in a nutshell: minor mode keys, local keys, global keys. - full order: 1. overriding-terminal-local-map: terminal-specific key binds. 2. overriding-local-map: override all other local keymaps (avoid if possible). 3. char property at point: useful for yasnippet. 4. emulation-mode-map-alists: advanced multi-mode keymap. 5. minor-mode-overriding-map-alist: minor modes in major modes. 6. minor-mode-map-alist: as previous (preferred for minor modes) <----- 7. current-local-map: buffers current local map. 8. current-global-map: last place to look (ie. global). ** mode hooks - (local-set-key (kbd "c-c q") 'my-awesome-method)) in hook-method. - for key-chord-define, use current-local-map. * [2014-12-30 Tue] Video backlog :PROPERTIES: :CUSTOM_ID: online-video-backlog :END: :MODIFIED: [2019-01-12 Sat] :END: **** TODO [[https://www.youtube.com/watch?v=wBraurRo_bg][Frank Ostaseski: "Inviting the Wisdom of Death into Life"]]. **** TODO [[https://news.ycombinator.com/item?id=17210164][YouTube’s top creators are burning out (Hacker News)]]. **** TODO [[https://www.youtube.com/playlist?list=PL94E35692EB9D36F3][Donald Knuth Lectures - YouTube]]. **** TODO Rashomon by Akira Kurosawa. **** TODO [[https://vimeo.com/97903574][Seeing spaces]]. **** TODO [[https://www.youtube.com/watch?v=HHYs78uIx3M][An exclusive seminar with Julian Assange]]. **** TODO [[https://www.youtube.com/watch?v=LrObZ_HZZUc][The (Secret) City of London, Part 1: History]]. **** TODO [[https://www.youtube.com/watch?v=z1ROpIKZe-c][The (Secret) City of London, Part 2: History]]. **** TODO [[https://www.youtube.com/watch?v=kXBJLH2xrBM][The UK Gold]]. **** TODO [[https://www.youtube.com/watch?v=Jio7DK15Q1E&feature=youtu.be][Terra Plana - Learning the skill of barefoot running]]. **** TODO [[https://www.youtube.com/watch?v=Zwx1PaWbD4U][The Science of Compassion ॐ Mata Amritanandamayi ॐ Documentary]]. **** TODO [[https://www.youtube.com/playlist?list=PLZdCLR02grLrEwKaZv-5QbUzK0zGKOOcr][Rich Hickey Talks (clojure)]]. **** TODO [[https://egghead.io/lessons/javascript-redux-the-single-immutable-state-tree][Redux: The Single Immutable State Tree screencast]]. **** TODO [[https://channel9.msdn.com/Shows/Going+Deep/Anders-Hejlsberg-and-Lars-Bak-TypeScript-JavaScript-and-Dart][Anders Hejlsberg and Lars Bak: TypeScript, JavaScript, and Dart]]. **** TODO [[http://www.slowhustle.com/how-to-travel-the-slow-hustle-way-insights-from-50-episodes/][How To Travel… The Slow Hustle Way]]. **** TODO [[https://www.youtube.com/watch?time_continue%3D1&v%3DnUjgKoOYxos][2015-12-10 Emacs Chat - John Wiegley]]. **** TODO [[http://emacsnyc.org/2015/03/02/how-i-use-org-capture-and-stuff.html][How To Order Salads From Inside Emacs]]. **** TODO [[http://emacsnyc.org/2014/04/07/an-introduction-to-emacs-lisp.html][An introduction to Emacs Lisp]]. **** TODO [[https://vimeo.com/139910837?ref%3Dtw-share][12 Challenging Steps to Being a Better Interviewer – Cate Huston at The Lead Developer 2015]]. **** TODO [[https://www.youtube.com/watch?v%3D8o46HH-TfNY][Born Rich: Children Of The Insanely Wealthy]]. **** TODO [[https://www.youtube.com/watch?v%3DFtieBc3KptU&feature%3Dyoutu.be&a][Emacs for writers]]. **** TODO [[https://www.youtube.com/watch?v%3dbkdt9bfh5gs][Frugal fire 002: justin mccurry (rootofgood)]]. **** TODO Graham Hancock – The War on Consciousness. **** TODO [[http://www.nfb.ca/film/griefwalker?utm_content%3dbuffer24b02&utm_medium%3dsocial&utm_source%3dtwitter.com&utm_campaign%3dbuffer][Griefwalker]]. **** TODO [[https://www.youtube.com/watch?v%3DSwkjqGd8NC4][How to win the loser's game]]. **** TODO [[https://www.youtube.com/playlist?list%3DPLBDA2E52FB1EF80C9][John Green's "Crash Course History" videos]]. **** TODO [[https://www.youtube.com/watch?v%3DunX4FQqM6vI][Matthieu Ricard Leads a Meditation on Altruistic Love and Compassion]]. **** TODO [[https://www.youtube.com/watch?v%3DjUlWDxhSlt8][Matthieu Ricard: "Altruism" | Talks at Google]]. **** TODO Nick Hanauer – Rich People Don’t Create Jobs. **** TODO [[https://www.youtube.com/watch?v%3DcsyL9EC0S0c][Programming is terrible — Lessons learned from a life wasted]]. **** TODO Rupert Sheldrake – The Science of Delusion. **** TODO [[https://www.youtube.com/watch?v%3DVXTpTRuPiPQ][Surya Namaskar stretches]]. **** TODO [[http://audio-video.gnu.org/video/misc/2015-01__gnu_guix__the_emacs_of_distros.webm][The Emacs of distros]]. **** TODO [[https://www.youtube.com/watch?v%3D17jymDn0W6U&sns%3Dem][The Known Universe by AMNH]]. **** DONE [[https://www.youtube.com/watch?v=ttLgyKk7yMA][Juliet Schor Iris Nights: Re-Thinking Materialism]]. **** DONE [[https://archive.org/details/The.Internets.Own.Boy.The.Story.of.Aaron.Swartz.2014.WEBRiP.XViD.AC3LEGi0N][The Internets own boy]]. **** DONE [[https://www.youtube.com/watch?v%3DFw8BV4VFOwM][BBC's secret of levitation]]. **** DONE [[https://vimeo.com/15351476][Hold Fast]]. **** DONE [[https://www.youtube.com/watch?v=8crol-ydfmi][This is water, commencement speech]]. **** DONE [[https://www.youtube.com/watch?v=dkyjvv7huzw][This is water]]. * [2014-09-12 Wed] Flight-booking bookmarks :PROPERTIES: :CUSTOM_ID: flight-booking-bookmarks :END: :MODIFIED: [2018-09-12 Wed] :END: - [[http://www.azair.com/][Azair: Budget air tickets from low-cost airlines]]. - [[http://flights.google.com/][Google Flights]]. - [[https://matrix.itasoftware.com][Matrix - ITA Software by Google]]. - [[https://www.travelzoo.com/uk/][Travelzoo: Travel & entertainment deals: hotels, holidays, cruises, restaurants, shows]]. * [2014-09-18 Thu] Frugal bookmarks :PROPERTIES: :CUSTOM_ID: frugal-bookmarks :END: :MODIFIED: [2020-12-21 Mon] :END: - [[https://www.acornishmum.com/9-great-frugal-blogs-in-the-uk/][9 Great Frugal Blogs in The UK - A Cornish Mum]]. - [[https://www.reddit.com/r/UKFrugal/comments/ha28n9/any_tips_for_buying_cheap_red_wine/][Any tips for buying Cheap Red Wine? : UKFrugal]]. - [[https://mobile.asda.com/][Asda Mobile | Pay as you go SIM (Order your free SIM)]]. - [[https://www.getrichslowly.org/best-cheap-coffee/][Beating the latte factor: My quest for the best cheap coffee]]. - [[https://www.biggreensmile.com/departments/dishwashing.aspx?deptid=DISHES][Big green smile (eco bulk buys)]]. - [[https://www.broadband.co.uk][Broadband.co.uk Dedicated to finding the best broadband for you]]. - [[https://www.reddit.com/r/BuyItForLife/][Buy it for life: Durable, Quality, Practical (Reddit)]]. - [[http://www.pricegrabber.com/][Check online store ratings and save money with deals at PriceGrabber.com]]. - [[https://frugalmoneyman.com/2018/03/23/emergency-fund-before-yolo/][Emergency Fund Before YOLO - Frugal Money Man]]. - [[https://www.reddit.com/r/FreeEBOOKS][FreeEBOOKS (subreddit)]]. - [[https://frugalfun4boys.com/][Frugal Fun For Boys and Girls - Learning, Play, STEM Activities, and Thing to Do! (home experiments for kids)]]. - [[https://www.frugalqueeninfrance.com/][Frugal Queen in France]]. - [[https://m.aliexpress.com/][Global Online Shopping for Apparel, Phones, Computers, Electronics, Fashion and more on Aliexpress]]. - [[https://www.telegraph.co.uk/gardening/problem-solving/adopt-wayward-plant/][How to Adopt a Wayward Plant (The Telegraph)]]. - [[https://www.getrichslowly.org/best-quality-for-less/][How to find the best quality for less, but it for life, (Get Rich Slowly)]]. - [[https://ethical.net/ethical/homemade-sustainable-cleaning-products/][How to Make Your Own Sustainable Cleaning Products (ethical.net)]]. - [[https://cookingonabootstrap.com/2015/11/12/how-to-shop-on-a-budget/][How To Shop On A Budget – from A Girl Called Jack (Jack Monroe)]]. - [[https://iforcemarketzone.com][iForce marketzone]]. - [[https://m.youtube.com/watch][Keeping your house cooled (video)]]. - [[https://meanqueen-lifeaftermoney.blogspot.com/p/my-money-saving-tips.html][Life After Money: My money saving tips]]. - [[https://www.molecountrystores.co.uk][Mole Country Stores: Agricultural and Rural Retailer (clothing)]]. - [[https://thehumblepenny.com/][The Humble Penny (Create Financial Joy)]]. - [[https://www.twotogether-railcard.co.uk/][Two together railcard]]. - [[https://www.reddit.com/r/UKFrugal/comments/ctgzl6/ukfrugal_health_and_beauty_list/][UKFrugal: Health and Beauty list : UKFrugal]]. - [[https://www.choosefi.com/want-to-buy-it-for-life-consider-this/][Want To Buy It For Life? (lots of item suggestions)]]. - [[https://www.reddit.com/r/UKPersonalFinance/comments/ekavj5/what_are_the_best_bits_about_lidl/][What are the best bits about lidl? : UKPersonalFinance]]. - [[https://www.quora.com/What-should-you-not-say-when-buying-a-car][What should you not say when buying a car? - Quora]]. * [2014-09-18 Thu] Charities bookmarks :PROPERTIES: :CUSTOM_ID: charities-bookmarks :END: - [[https://uk.whogivesacrap.org][Toilet paper that builds toilets (Who Gives A Crap UK)]]. * [2014-09-18 Thu] Origami bookmarks :PROPERTIES: :CUSTOM_ID: origami-bookmarks :END: :MODIFIED: [2019-03-30 Sat] :END: - [[https://www.youtube.com/watch?v%3DlA5v3podPwo&feature%3Dem-subs_digest][Origami - How to make a WASTEBASKET]]. - [[https://www.origami-fun.com/][Origami That's Fun And Easy]]. * [2014-12-30 Tue] Movie backlog :PROPERTIES: :CUSTOM_ID: movie-backlog :END: :MODIFIED: [2022-12-17 Sat] :END: **** TODO Take your pill. **** TODO Chalk line. **** TODO [[https://trace.moe/][Anime Scene Search Engine - trace.moe]]. **** TODO [[https://poorlydrawnlines.com/][Poorly Drawn Lines]]. **** TODO [[https://www.rottentomatoes.com/m/vhyes][VHYes (2019) - Rotten Tomatoes]]. **** TODO [[https://en.m.wikipedia.org/wiki/The_Sandman_(comic_book)][The Sandman (comic book) - Wikipedia]] **** TODO [[https://m.imdb.com/title/tt12326830/][The Sandman (TV Series 2020– ) - IMDb]] **** TODO [[https://m.imdb.com/title/tt1751634/][The Sandman (TV Series 2021– ) - IMDb]] **** TODO Korean [[https://www.reddit.com/r/squidgame/comments/pwjyum/god_bless_squid_game][films/shows to watch]] **** TODO Gemini man. **** TODO [[https://www.rottentomatoes.com/m/tigertail][Tigertail (2020) - Rotten Tomatoes]]. **** TODO [[https://www.rottentomatoes.com/m/buffaloed][Buffaloed (2019) - Rotten Tomatoes]]. **** TODO [[https://www.rottentomatoes.com/m/12_hour_shift][12 Hour Shift (2020) - Rotten Tomatoes]]. **** TODO [[https://twitter.com/ddoniolvalcroze/status/1347367344239042563][What's your favorite Kurosawa film?]]. **** TODO [[https://www.netflix.com/gb/title/81347666][Korean Pork Belly Rhapsody | Netflix]]. **** TODO [[https://www.netflix.com/gb/title/80202946][Back to Life | Netflix]]. **** TODO [[https://editorial.rottentomatoes.com/guide/the-best-movies-of-2020/][The Best Movies of 2020 – Best New Films of the Year]]. **** DONE [[https://www.amazon.co.uk/If-Something-Happens-Lauren-Nieuwland][if something happens]]. **** TODO [[https://docs.google.com/spreadsheets/d/1TrLhiplUxXgqe0Cc7T4MdibZVKF4yeLZ1ptHzkz6d48/edit#gid=256281926][The Essentials Movie Recs - Google Sheets]]. **** TODO [[https://www.imdb.com/title/tt1239426/][Hipsters (2008) - IMDb]]. **** TODO [[https://www.imdb.com/title/tt1217565/][Den radio (2008) - IMDb]]. **** TODO [[https://www.imdb.com/title/tt0415481/][Alyosha Popovich i Tugarin Zmey (2004) - IMDb]]. **** TODO [[https://www.imdb.com/title/tt0062759/][Brilliantovaya ruka (1969) - IMDb]]. **** TODO [[https://www.imdb.com/title/tt0079944/][Stalker (1979) - IMDb]]. **** TODO [[https://www.imdb.com/title/tt0069293/][Solaris (1972) - IMDb]]. **** TODO [[https://www.imdb.com/title/tt3689910/][Miss Hokusai (2015) - IMDb]]. **** TODO [[https://www.imdb.com/title/tt2106476/][The Hunt (2012) - IMDb]]. **** TODO [[https://www.imdb.com/video/vi3155205401][Attack the Block: Trailer #2]]. **** TODO [[https://www.imdb.com/title/tt6499752/][Upgrade (2018) - IMDb]]. **** TODO [[https://www.rottentomatoes.com/m/the_way_back][The Way Back (2011) - Rotten Tomatoes]]. **** TODO [[https://www.imdb.com/title/tt0488085/][Big Nothing (2006) - IMDb]]. **** TODO [[https://www.imdb.com/title/tt2937898/][A Most Violent Year (2014) - IMDb]]. **** TODO [[https://www.imdb.com/title/tt4364194/][The Peanut Butter Falcon (2019) - IMDb]]. **** TODO [[https://www.imdb.com/title/tt1372301/][Technotise - Edit i ja (2009) - IMDb]]. **** TODO [[https://www.imdb.com/title/tt1176416/][Tetsuo: The Bullet Man (2009) - IMDb]]. **** TODO [[https://www.imdb.com/video/vi165218585][Sleep Dealer]]. **** TODO [[https://www.imdb.com/title/tt0353014/][Sky Blue]]. **** TODO [[https://www.imdb.com/title/tt0338337/][Paycheck (2003) - IMDb]]. **** TODO [[https://www.imdb.com/title/tt0339579/][Returner (2002) - IMDb]]. **** TODO [[https://www.imdb.com/title/tt0284978/][Cypher (2002) - IMDb]]. **** TODO [[https://www.imdb.com/title/tt0091419/][The Little Shop of Horrors (1986) - IMDb]]. **** TODO [[https://www.netflix.com/gb/title/81302258][To the Lake]]. **** TODO [[https://www.imdb.com/title/tt0050613/][Throne of Blood (1957) - IMDb]]. **** TODO [[https://www.imdb.com/title/tt9170108/][Raised by Wolves (TV Series 2020– ) - IMDb]]. **** TODO [[https://www.imdb.com/title/tt1675434/][Untouchable (2011) - IMDb]]. **** TODO [[https://www.imdb.com/title/tt1605783/][Midnight in Paris (2011) - IMDb]]. **** TODO [[https://www.imdb.com/title/tt0401711/][Paris, je t'aime (2006) - IMDb]]. **** TODO [[https://www.amazon.com/Alice-in-Paris/dp/B077JDNP5Y][Watch Alice in Paris | Prime Video]]. **** TODO [[https://www.imdb.com/title/tt9170638/][Plan Coeur (TV Series 2018– ) - IMDb]]. **** TODO [[https://twitter.com/ericajoy/status/1307432451304644609][what good shows are streaming rn?]]. **** TODO [[https://decider.com/movie/first-cow/][First Cow | Where to Stream and Watch | Decider]]. **** TODO [[https://www.rollingstone.com/movies/movie-reviews/she-dies-tomorrow-movie-review-1034272/]['She Dies Tomorrow' Movie Review: A Person-to-Person Paranoia Pandemic]]. **** TODO [[https://www.theringer.com/2020/7/14/21323785/palm-springs-the-years-most-fun-movie-plus-introducing-the-connect-shea-serrano-jason-concepcion][‘Palm Springs,’ 2020’s Most Fun Movie]]. **** TODO [[https://eu.usatoday.com/story/entertainment/movies/2020/05/09/spaceship-earth-why-crazy-hulu-doc-must-watch-quarantine-viewing/3102031001/]['Spaceship Earth': Why crazy new doc is must-watch quarantine viewing]]. **** TODO [[https://eu.freep.com/story/entertainment/movies/julie-hinds/2016/08/25/dont-breathe-horror-film-detroit/89304296/]['Don't Breathe' is latest movie to use Detroit as its scary setting]]. **** TODO [[https://www.imdb.com/title/tt11394188/][Spaceship Earth (2020) - IMDb]]. **** TODO [[https://zerokspot.com/reviews/][Reviews - zerokspot.com]]. **** TODO [[https://lars.ingebrigtsen.no/2015/08/07/tsp2013-only-lovers-left-alive/][TSP2013: Only Lovers Left Alive – Random Thoughts]]. **** TODO [[https://lars.ingebrigtsen.no/2015/07/25/tsp2008-burn-after-reading/][TSP2008: Burn After Reading – Random Thoughts]]. **** TODO [[https://lars.ingebrigtsen.no/2015/07/31/tsp2009-the-limits-of-control/][TSP2009: The Limits of Control – Random Thoughts]]. **** TODO [[https://lars.ingebrigtsen.no/2015/07/11/tsp2002-adaptation/][TSP2002: Adaptation. – Random Thoughts]]. **** TODO [[https://lars.ingebrigtsen.no/2015/08/08/tsp2014-trainwreck/][TSP2015: Trainwreck – Random Thoughts]]. **** TODO [[https://twitter.com/alixabeth/status/1290264151361761285][If you could wave a wand and instantly have more episodes of one TV series that has already concluded, which series would you pick?]]. **** TODO [[https://en.wikipedia.org/wiki/The_Advisors_Alliance][The Advisors Alliance - Wikipedia]]. **** TODO [[https://www.flixist.com/the-300-coda-my-top-50-movies-of-2018-and-my-top-40-first-time-watches-of-older-films/amp/][The 300 Coda: My Top 50 Movies of 2018 and My Top 40]]. **** TODO [[https://en.wikipedia.org/wiki/Green_Room_(film)][Green Room (film) - Wikipedia]]. **** TODO [[https://moviebabble.com/2020/07/09/relic-is-a-masterclass-in-independent-horror/]['Relic' is a Masterclass in Independent Horror | MovieBabble]]. **** TODO [[https://www.imdb.com/title/tt0387898/][Hidden (Caché) (2005) - IMDb]]. **** TODO [[https://lars.ingebrigtsen.no/2020/06/10/otb1-tokyo-story/][OTB#1: Tokyo Story – Random Thoughts]]. **** TODO [[https://www.netflix.com/gb/title/81008221][Into the Night | Netflix Official Site]]. **** TODO [[https://www.imdb.com/title/tt8101850/][Undone (TV Series 2019– ) - IMDb]]. **** TODO [[https://moviebabble.com/2020/05/20/quarantine-staff-picks-part-7/][Quarantine Staff Picks: Part 7 | MovieBabble]]. **** TODO [[https://moviebabble.com/2020/05/14/quarantine-staff-picks-part-6/][Quarantine Staff Picks: Part 6 | MovieBabble]]. **** TODO [[https://moviebabble.com/2020/05/07/quarantine-staff-picks-part-5-wolf-stalker-loaded-weapon/][Quarantine Staff Picks: Part 5 | MovieBabble]]. **** TODO [[https://moviebabble.com/2020/04/30/quarantine-staff-picks-part-4-the-player-my-friend-dahmer-gone-with-the-wind/][Quarantine Staff Picks: Part 4 | MovieBabble]]. **** TODO [[https://moviebabble.com/2020/04/23/quarantine-staff-picks-part-3/][Quarantine Staff Picks: Part 3 | MovieBabble]]. **** TODO [[https://moviebabble.com/2020/04/16/quarantine-staff-picks-part-2-once-upon-a-time-in-the-west-first-love-blue-ruin/][Quarantine Staff Picks: Part 2 | MovieBabble]]. **** TODO [[https://moviebabble.com/2020/04/08/quarantine-staff-picks-part-1/][Quarantine Staff Picks: Part 1 | MovieBabble]]. **** TODO [[https://moviebabble.com/2020/05/28/quarantine-staff-picks-part-8-little-women-blood-and-wine/][Quarantine Staff Picks: Part 8 | MovieBabble]]. **** TODO [[https://www.hustwit.com/about][Gary Hustwit (filmography)]]. **** TODO [[https://news.ycombinator.com/item?id=23445245][Helvetica, a documentary on typography]]. **** TODO [[https://twitter.com/FILMSHAWTY/status/1266029625626497031][twitter: black documentaries that assist in understanding racism, prejudice, police brutality, and more]]. **** TODO [[https://moviebabble.com/][MovieBabble - The Casual Way to Discuss Movies]]. **** TODO [[http://bitdepth.org/][bitdepth]]. **** TODO [[https://www.imdb.com/title/tt7282468/][Burning (2018) - IMDb]]. **** TODO [[https://www.rottentomatoes.com/m/american_honey][American Honey (2016) - Rotten Tomatoes]]. **** TODO Undone. **** TODO [[https://en.wikipedia.org/wiki/The_Wire][The Wire - Wikipedia]]. **** TODO [[https://en.wikipedia.org/wiki/Ajin:_Demi-Human][Ajin: Demi-Human - Wikipedia]]. **** TODO Halt and Catch Fire. **** TODO [[https://www.essence.com/entertainment/a-beginners-guide-afrofuturism/][A Beginner's Guide To Afrofuturism: 7 Titles To Watch And Read]]. **** TODO [[https://wiki.sunbeam.city/doku.php][Sunbeam city wiki: Solarpunk]]. **** TODO [[https://twitter.com/ShamanOfThe/status/1250056585281523713][Goldmund on Twitter: Watched Fight Club, thought about it, and realized why ...]]. **** TODO [[https://twitter.com/chancethedev/status/1247619377735675904][Chance on Twitter: Post your favorite movie.]]. **** TODO [[https://lars.ingebrigtsen.no/2019/03/22/nflx2019-january-4th-lionheart/][NFLX2019 January 4th: Lionheart – Random Thoughts]]. **** TODO [[https://lars.ingebrigtsen.no/2019/03/22/nflx2019-january-18th-soni/][NFLX2019 January 18th: Soni – Random Thoughts]]. **** TODO [[https://lars.ingebrigtsen.no/2020/01/04/nflx2019-december-31st-ghost-stories/][NFLX2019 December 31st: Ghost Stories – Random Thoughts]]. **** TODO [[https://lars.ingebrigtsen.no/2019/11/22/nflx2019-november-15th-klaus/][NFLX2019 November 15th: Klaus – Random Thoughts]]. **** TODO [[https://lars.ingebrigtsen.no/2019/10/18/nflx2019-october-18th-seventeen/][NFLX2019 October 18th: Seventeen – Random Thoughts]]. **** TODO [[https://lars.ingebrigtsen.no/2019/08/24/nflx2019-august-2nd-otherhood/][NFLX2019 August 2nd: Otherhood – Random Thoughts]]. **** TODO [[https://lars.ingebrigtsen.no/2019/05/31/nflx2019-may-30th-chopsticks/][NFLX2019 May 30th: Chopsticks – Random Thoughts]]. **** TODO [[https://lars.ingebrigtsen.no/2019/05/25/nflx2019-may-24th-the-perfection/][NFLX2019 May 24th: The Perfection – Random Thoughts]]. **** TODO [[https://lars.ingebrigtsen.no/2019/08/23/nflx2019-july-31st-the-red-sea-diving-resort/][NFLX2019 July 31st: The Red Sea Diving Resort – Random Thoughts]]. **** TODO [[https://www.imdb.com/video/vi2416359961][Paris is Us]]. **** TODO [[https://www.bfi.org.uk/films-tv-people/sightandsoundpoll2012/directors][Directors’ top 100 | BFI]]. **** TODO [[https://en.wikipedia.org/wiki/It_Follows][It Follows - Wikipedia]]. **** TODO [[http://www.tasteofcinema.com/2016/the-20-best-cyberpunk-movies-of-all-time/][The 20 Best Cyberpunk Movies of All Time]]. **** TODO [[https://www.netflix.com/gb/title/80232926][Ragnarok | Netflix Official Site]]. **** TODO [[https://www.neondystopia.com/][Home – Neon Dystopia]]. **** TODO Patriot (Amazon) **** TODO The Expanse (Amazon) **** TODO The Boys (Amazon) **** TODO The Last Kingdom (Netflix) **** TODO The Witcher (Netflix) **** TODO Travelers (Netflix) **** TODO If I Only Hadn’t Met You (Netflix) **** TODO Peaky Blinders (Netflix) **** TODO Catch-22 (Hulu) **** TODO [[https://en.wikipedia.org/wiki/American_Factory][American Factory - Wikipedia]]. **** TODO [[https://www.netflix.com/gb/title/80221644][October Faction | Netflix Official Site]]. **** TODO [[https://www.netflix.com/gb/title/81016857][Transfers | Netflix]]. **** TODO [[https://www.netflix.com/gb/Title/81082327][Ad Vitam | Netflix Official Site]]. **** TODO [[https://www.netflix.com/gb/title/81000509][On Children | Netflix Official Site]]. **** TODO [[https://www.netflix.com/gb/title/80200596][Perfume | Netflix Official Site]]. **** TODO [[https://www.netflix.com/gb/title/81037848][The Gift | Netflix Official Site]]. **** TODO [[https://www.netflix.com/gb/title/80995039][Ares | Netflix Official Site]]. **** TODO [[https://en.m.wikipedia.org/wiki/Demon_Slayer:_Kimetsu_no_Yaiba][Demon Slayer: Kimetsu no Yaiba - Wikipedia]]. **** TODO [[https://en.wikipedia.org/wiki/Yuri_on_Ice][Yuri on Ice]]. **** TODO [[https://twitter.com/alicegoldfuss/status/1196527679127732224][Twitter: "Has anyone here seen Parasite?"]]. **** TODO [[https://www.imdb.com/title/tt2334879/][White House Down (2013) - IMDb]]. **** TODO [[https://www.imdb.com/title/tt2179136/][American Sniper (2014) - IMDb]]. **** TODO Hannibal Burress, Hasan Minhaj, Neal Brennan, Dave Chappelle. **** TODO [[https://en.wikipedia.org/wiki/The_Insider_(film)][The Insider (film) - Wikipedia]]. **** TODO [[https://twitter.com/alicegoldfuss/status/1166139660822663168][I need recommendations for shows/movies (preferably on Netflix)]]. **** TODO [[https://www.amazon.co.uk/gp/product/B000PE0H0E/][Taste of Tea]]. **** TODO [[http://japanology.tv/][Japanology Episodes List]]. **** TODO [[https://www3.nhk.or.jp/nhkworld/en/tv/japanologyplus/][Japanology Plus - TV | NHK WORLD-JAPAN Live & Programs]]. **** TODO [[https://www.newyorker.com/culture/on-television/with-the-netflix-series-our-planet-david-attenborough-delivers-an-urgent-message][David Attenborough's Our Planet]]. **** TODO [[https://en.wikipedia.org/wiki/Infernal_Affairs][Infernal Affairs - Wikipedia]]. **** TODO [[https://twitter.com/VictoriaAveyard/status/1106965397729767424][Victoria Aveyard on Twitter: "when your roommate asks for a Marvel watch list with commentary… "]]. **** TODO [[https://www.netflix.com/title/80240715?trkid=13710079&MSG_TITLE=80240715&lnktrk=EMP&g=34314DADF578FF8FA7BD72C94F6C8ED9645514B1&lkid=W2W_ROW_2_MDP_2][ROMA]]. **** TODO [[https://www.imdb.com/title/tt5715874/][The Killing of a Sacred Deer (2017)]]. **** TODO Private Life. **** TODO You Were Never Really Here. **** TODO Sorry to Bother You. **** TODO Game Night. **** TODO Support the Girls. **** TODO Steven Yeun, Burning. **** TODO A Simple Favor. **** TODO [[https://news.ycombinator.com/item?id=18271167][Ask HN: Mind blowing documentaries?]]. **** TODO [[http://www.theyshootpictures.com/21stcentury.htm][The 21st Century’s Most Acclaimed Films (including films from 2000)]]. **** TODO [[https://en.wikipedia.org/wiki/Koyaanisqatsi][Koyaanisqatsi]]. **** TODO [[https://www.imdb.com/title/tt4000670/][Mifune: The Last Samurai (2015) - IMDb]]. **** TODO [[https://www.imdb.com/title/tt1322313/][Sunshine Superman (2014) - IMDb]]. **** TODO [[https://www.netflix.com/gb/title/80100869][Under the Sun (Netflix)]]: "Under the Sun keeps forcing us to ponder why we watch representations of real life and what we think we’re learning about reality in the process". **** TODO [[https://www.netflix.com/gb/title/80107737][Peter and the Farm (Netflix)]]. **** TODO [[https://en.wikipedia.org/wiki/Lessons_of_Darkness][Lessons of Darkness - Wikipedia]]. **** TODO [[https://en.wikipedia.org/wiki/The_Story_of_Stuff][The story of stuff]]. **** TODO [[https://www.imdb.com/title/tt0120894/?ref_=nm_flmg_act_42][Immortality]]. **** TODO Ichi the killer. **** TODO Audition. **** TODO The Happiness of the Katakuris. **** TODO Agitator. **** TODO Gozu. **** TODO Outrage. **** TODO Minbo. **** TODO Blues harp. **** TODO Goyokin. **** TODO The hidden blade. **** TODO Wild Tales. **** TODO The Road. **** TODO Moon. **** TODO Who am I. **** TODO [[http://www.openculture.com/2010/07/tarkovksy.html][Tarkovsky films]]. **** TODO [[https://en.wikipedia.org/wiki/Snowpiercer][Snowpiercer]]. **** TODO [[https://en.wikipedia.org/wiki/Kubo_and_the_Two_Strings][Kubo and the two strings]]. **** TODO Spotlight. **** TODO Creed. **** TODO Innocence of memories. **** TODO The revenant. **** TODO Big short. **** TODO Pressure Cooker. **** TODO Bob and David. **** TODO Akira kurosawa director. **** TODO [[http://www.imdb.com/title/tt0042192/][All About Eve]]. **** TODO [[http://www.imdb.com/title/tt2321549/][Babadook]]. **** TODO [[https://en.wikipedia.org/wiki/Death_to_Smoochy][Death to Smoochy]]. **** TODO Enter the void, by gaspar noe. **** TODO [[http://www.imdb.com/title/tt1671513/][Four horsemen]]. **** TODO Hirokazu koreeda director. **** TODO Naomi kawaze director. **** TODO Nostalghia. **** TODO Sion sono director. **** TODO Solyaris **** TODO Stalker **** TODO Takashi kitano director. **** TODO Takashi miike director. **** TODO [[https://www.theconnection.tv/][The connection]]. **** TODO The mirror **** TODO [[http://www.imdb.com/title/tt0078269/?ref_%3Dfn_al_tt_1][The Silent Partner]]. **** TODO Uncle boonmee who can recall his past lives, by apichatpong weerasethakul. **** TODO Waking life, by rickard linklater. **** TODO [[http://xaharts.org/movie/best_movies.html][Xah Lee's movie list]]. **** DONE [[https://m.imdb.com/title/tt2543312/][Halt and Catch Fire (TV Series 2014–2017) - IMDb]]. **** DONE Twinsters. **** DONE Mindhunter (Netflix) **** DONE Altered Carbon (Netflix) **** OBSOLETE Narcos (Netflix) **** DONE The Marvelous Mrs. Maisel (Amazon) **** DONE Sneaky Pete (Amazon) **** DONE Ozark (Netflix) **** DONE Midnight Diner: Tokyo Stories (Netflix) **** DONE Dark (Netflix) **** DONE [[https://www.netflix.com/gb/title/80097140][Altered Carbon | Netflix Official Site]]. **** DONE [[https://www.reddit.com/r/UKPersonalFinance/comments/b4jwo6/the_men_who_made_us_spend_a_really_amazing_3_part/][The Men Who Made Us Spend - a really amazing 3 part documentary from the BBC on spending and consumerism]]. **** DONE [[https://en.wikipedia.org/wiki/Annihilation_(film)][Annihilation (film) - Wikipedia]]. **** DONE 13 Assasins <2018-12-27 Thu>. **** DONE 7 Samurai <2018-12-27 Thu>. **** DONE [[https://www.imdb.com/title/tt6839788/][Dogs of Berlin (TV Series 2018– ) - IMDb]]. **** DONE [[https://www.netflix.com/title/80209379?trkid=13710079&MSG_TITLE=80209379&lnktrk=EMP&g=E58636EBA68F4FFCE4B16798136D42876455394E&lkid=W2W_ROW_2_MDP_1][Tidying Up with Marie Kondo]]. **** DONE The True cost. **** DONE [[http://www.awaketheyoganandamovie.com/][Awake, the life of yogananda]]. **** DONE [[http://www.imdb.com/title/tt2562232/][Birdman]]. **** DONE [[http://www.imdb.com/title/tt1065073/][Boyhood]]. **** DONE She A Chinese. **** DONE [[http://www.imdb.com/title/tt0243655/][Wet Hot American Summer]]. * [2014-12-29 Mon] Microservices bookmarks :PROPERTIES: :CUSTOM_ID: microservices-bookmarks :END: :MODIFIED: [2018-09-03 Mon] :END: - [[https://datawire.io/creating-a-microservice-answer-these-10-questions-first/][Creating a Microservice? Answer these 10 Questions First]]. - [[http://philcalcado.com/2015/09/08/how_we_ended_up_with_microservices.html][How we ended up with microservices]]. - [[https://httpie.org/][HTTPie – command line HTTP client]]. * [2014-12-30 Tue] Books backlog :PROPERTIES: :CUSTOM_ID: books-backlog :END: :MODIFIED: [2021-02-06 Sat] :END: **** TODO [[https://books.apple.com/us/book/id1551005489][‎Swift Secrets on Apple Books]]. **** TODO [[https://www.amazon.co.uk/Island-Aldous-Huxley/dp/0099477777][Island: Amazon.co.uk: Aldous Huxley: 9780099477778: Books]]. **** TODO [[https://www.amazon.com/Hieroglyph-Stories-Visions-Better-Future-ebook/dp/B00H7LUR3K][Amazon.com: Hieroglyph: Stories and Visions for a Better Future eBook]]. **** TODO [[https://www.amazon.com/Meredith-Silicon-David-Oliver-Doswell/dp/B088T2ZZG5][Meredith: The Future of Silicon Valley (fiction)]]. **** TODO [[https://www.amazon.co.uk/Working-Public-Making-Maintenance-Software-ebook/dp/B08BDGXVK9/ref=sr_1_1][Working in Public: The Making and Maintenance of Open Source Software eBook]]. **** TODO [[https://www.amazon.com/No-More-Mr-Nice-Guy/dp/0762415339][No More Mr Nice Guy: A Proven Plan for Getting What You Want]]. **** TODO [[https://twitter.com/AllegedlyMiri/status/1301302388939259905][Thread on Wask Factory (more titles)]]. **** TODO [[https://en.wikipedia.org/wiki/The_Wasp_Factory][The Wasp Factory - Wikipedia]]. **** TODO [[https://twitter.com/mariskreizman/status/1305922866433724416][Book recommendation thread by Maris Kreizman]]. **** TODO [[https://www.amazon.com/dp/B0898YGR58][Extreme Privacy: What It Takes to Disappear: Bazzell, Michael: 9798643343707]]. **** TODO [[https://www.theatlantic.com/health/archive/2011/10/you-are-not-so-smart-why-we-cant-tell-good-wine-from-bad/247240/]['You Are Not So Smart': Why We Can't Tell Good Wine From Bad - The Atlantic]]. **** TODO [[https://stephaniekelton.com/book/][The Deficit Myth - Stephanie Kelton]]. **** TODO [[https://muratbuffalo.blogspot.com/2020/06/some-book-recommendations.html][Metadata: Forty book recommendations]]. **** TODO [[https://www.goodreads.com/list/show/89580.Solarpunk][Solarpunk (62 books)]]. **** TODO [[https://theanarchistlibrary.org/library/p-m-bolo-bolo][Bolo’bolo | The Anarchist Library]]. **** TODO [[https://archive.org/details/velvetmonkeywren00muir/page/260][The velvet monkey wrench : Muir, John, 1918-]]. **** TODO [[https://www.goodreads.com/list/show/131328.Solarpunk_Community_Discord_List][Solarpunk Community Discord List (108 books)]]. **** TODO [[https://www.amazon.co.uk/Launch-Internet-Millionaires-Anything-Paperback/dp/B00N4E4HQC/ref=sr_1_1][Launch: An Internet Millionaire's Secret Formula to Sell Almost anything online]]. **** TODO [[https://www.amazon.com/Psychology-Money-Timeless-lessons-happiness/dp/0857197681/][The Psychology of Money: The Psychology of Money: Timeless lessons on wealth, greed, and happiness]]. **** TODO [[https://thequilltolive.com/recommendations-2/][Recommendations | The Quill to Live]]. **** TODO [[https://fumbling.it/posts/my-2020-reading-list/][My 2020 Reading List · FumbLing]]. **** TODO [[https://www.goodreads.com/book/show/37903770-norse-mythology][Norse Mythology by Neil Gaiman]]. **** TODO [[https://www.goodreads.com/book/show/18216145-auto][Auto by David Wailing]]. **** TODO [[https://news.ycombinator.com/item?id=22573204][Ask HN: Book recommendations for understanding financial systems? | Hacker News]]. **** TODO [[https://en.wikipedia.org/wiki/Andromeda_(novel)][Andromeda (novel) - Wikipedia]]. **** TODO [[https://medium.com/solarpunks/solarpunk-a-reference-guide-8bcf18871965][SOLARPUNK : A REFERENCE GUIDE - Solarpunks - Medium]]. **** TODO [[https://en.wikipedia.org/wiki/The_Final_Circle_of_Paradise][The Final Circle of Paradise - Wikipedia]]. **** TODO [[https://twitter.com/mariskreizman/status/1193898883153354752][Here's a visual of my 35 favorite books of the decade.]]. **** TODO [[https://news.ycombinator.com/item?id=22559493][Cyberpunk: Then and Now | Hacker News]]. **** TODO [[https://www.amazon.co.uk/Accelerate-Software-Performing-Technology-Organizations/dp/1942788339/ref=sr_1_1][Accelerate: The Science of Lean Software and Devops]]. **** TODO [[https://hackernewsbooks.com/book/drive-the-surprising-truth-about-what-motivates-us/f10867f03ab0e2c362b3450119170a5a][Drive: The Surprising Truth About What Motivates Us | Hacker News Books]]. **** TODO [[https://en.wikipedia.org/wiki/Pachinko_(novel)][Pachinko (novel) - Wikipedia]]. **** TODO [[https://twitter.com/twostraws/status/1205416072058490880][Paul Hudson on Twitter: Can you recommend some manga?]]. **** TODO [[https://twitter.com/dan_abramov/status/1190762799338790913][Dan Abramov: Please point me to a book about programming that isn't boring]]. **** TODO [[https://www.amazon.com/gp/registry/wishlist/28JXH54TPGED7][John's Amazon wishlist]]. **** TODO [[https://www.amazon.co.uk/Super-Thinking-Upgrade-Reasoning-Decisions-ebook/dp/B07FRXC3KN/ref=sr_1_2][Super Thinking: Upgrade Your Reasoning and Make Better Decisions with Mental Models]]. **** TODO [[https://www.amazon.co.uk/s?k=Giulia+Enders][Gut: the inside story of our body's most under-rated organ]]. **** TODO [[https://twitter.com/evansandhoefner/status/1048426752404410368][Evan Sandhoefner on Twitter: Which books/papers/talks/etc have blown your mind / changed your worldview significantly?]]. **** TODO [[https://www.amazon.co.uk/Joy-Demand-Discovering-Happiness-Within/dp/0062378872/ref=sr_1_1][JOY ON DEMAND: The Art of Discovering the Happiness Within]]. **** TODO [[https://www.amazon.co.uk/Minute-Meditation-Expanded-Quiet-Change/dp/0399173420/ref=sr_1_2][8 Minute Meditation Expanded : Quiet Your Mind. Change Your Life]]. **** TODO [[https://www.amazon.co.uk/Mindfulness-Plain-English-20th-Anniversary/dp/0861719069/ref=sr_1_1][Mindfulness in Plain English: 20th Anniversary Edition: Amazon.co.uk]]. **** TODO [[https://twitter.com/bettina_bosch/status/1164430628852572161][Bettina Bauer: What is your favorite Science Fiction novel? (twitter)]]. **** TODO [[https://www.amazon.com/Altered-Traits-Science-Reveals-Meditation/dp/0399184384][Altered Traits: Science Reveals How Meditation Changes Your Mind, Brain, and Body]]. **** TODO [[https://www.amazon.com/Junk-Food-Japan-Addictive-Kurobuta/dp/1472919920][Junk Food Japan: Addictive Food from Kurobuta]]. **** TODO [[https://news.ycombinator.com/item?id=20332455][Ask HN: Recommend one book I need to read this summer?]]. **** TODO I am a cat (Soseki Natsume). **** TODO [[https://www.amazon.co.uk/Thinking-Systems-Primer-Diana-Wright/dp/184407725X][Thinking in Systems: A Primer: Amazon.co.uk: Diana Wright, Donella H. Meadows: 9781844077250: Books]]. **** TODO [[http://www.lisperati.com/casting-spels-emacs/html/casting-spels-emacs-1.html][Casting SPELs in Lisp (Emacs edition)]]. **** TODO [[http://landoflisp.com/][Land of lisp]]. **** TODO [[https://www.goodreads.com/book/show/558738.Juggling_for_the_Complete_Klutz][Juggling for the Complete Klutz by John Cassidy]]. **** TODO [[https://www.amazon.co.uk/Positioning-Battle-Your-Al-Ries-ebook/][Positioning: The Battle for Your Mind]]. **** TODO [[https://en.wikipedia.org/wiki/Snow_Crash][Snow Crash - Wikipedia]]. **** TODO [[https://www.powells.com/book/-9781119404507][The Little Book of Common Sense Investing, Updated and Revised]]. **** TODO [[https://www.amazon.com/Little-LISPer-Third-Daniel-Friedman/dp/0023397632][The Little LISPer, Third Edition: 9780023397639: Computer Science Books @ Amazon.com]]. **** TODO [[https://www.amazon.com/Anatomy-Peace-Resolving-Heart-Conflict/dp/1626564310][The Anatomy of Peace: Resolving the Heart of Conflict]]. **** TODO [[https://superfastthebook.com/][Superfast Lead at speed]]. **** TODO [[https://ofone.co/][A company of one]]. **** TODO [[https://www.goodreads.com/book/show/27220736-shoe-dog][Shoe Dog: A Memoir by the Creator of NIKE]]. **** TODO [[https://twitter.com/thegooddeath/status/1077325245940289537?s=12][Caitlin Doughty's top 8 books from 2018]]. **** TODO [[https://www.amazon.co.uk/Global-Economy-Youve-Never-Seen-ebook/dp/B07GVT67HB/ref=tmm_kin_swatch_0?_encoding=UTF8&qid=1545746296&sr=8-1][Global Economy as you've never seen it]]. **** TODO [[https://www.amazon.com/Replay-Ken-Grimwood/dp/068816112X][Replay]]. **** TODO [[https://www.amazon.com/Siddhartha-Novel-Hermann-Hesse/dp/0553208845][Siddhartha: A Novel]]. **** TODO [[https://en.wikipedia.org/wiki/Out_(novel)][Out (novel) by Natsuo Kirino]]. **** TODO [[https://www.pitt.edu/~dash/japantales.html][Folklore, Folktales, and Fairy Tales from Japan: A Digital Library]]. **** TODO [[https://www.goodreads.com/book/show/15811545-a-tale-for-the-time-being][A Tale for the Time Being by Ruth Ozeki]]. **** TODO [[https://www.amazon.com/dp/0571171044/ref=rdr_ext_tmb][Kitchen by Banan Yashimoto]]. **** TODO [[https://www.amazon.com/Overspent-American-Want-What-Dont/dp/0060977582/ref=sr_1_3/136-0317326-4068376?ie=UTF8&qid=1538250472&sr=8-3&keywords=juliet+schor&dpID=51%252BdTsv9XUL&preST=_SY291_BO1,204,203,200_QL40_&dpSrc=srch][The Overspent American: Why We Want What We Don't Need Paperback]]. **** TODO [[https://www.goodreads.com/book/show/13540802-enough][Enough by Patrick Rhone]]. **** TODO [[https://hotair.tech/about/][Hot Air has a nice selection]]. **** TODO [[https://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215][Domain-Driven Design: Tackling Complexity in the Heart of Software 1st Edition]]. **** TODO [[https://www.amazon.com/Seeing-like-State-Certain-Condition/dp/0300078153][Seeing like a State: How Certain Schemes to Improve the Human Condition Have Failed Paperback]]. **** TODO [[https://www.amazon.com/Conquest-Abundance-Abstraction-versus-Richness/dp/0226245349][Conquest of Abundance: A Tale of Abstraction versus the Richness of Being 2nd Edition]]. **** TODO [[https://books.google.co.uk/books?id=a6sRdYLlmqIC&pg=PA6&lpg=PA6&redir_esc=y][The Wisdom of No Escape: And the Path of Loving-Kindness]]. **** TODO [[https://www.amazon.com/Anatomy-Peace-Resolving-Heart-Conflict/dp/1626564310][The Anatomy of Peace: Resolving the Heart of Conflict]]. **** TODO [[https://en.wikipedia.org/wiki/The_Millionaire_Next_Door][The Millionaire Next Door]]. **** TODO [[https://www.amazon.co.uk/Refactoring-Improving-Existing-Addison-Wesley-Technology-ebook/dp/B007WTFWJ6/ref=sr_1_1?s=digital-text&ie=UTF8&qid=1515533074&sr=1-1&keywords=refactoring+fowler][Refactoring: Improving the Design of Existing Code]]. **** TODO [[https://news.ycombinator.com/item?id=12896313][Touched by the Goddess: On Ramanujan (Hacker News)]]. **** TODO [[https://www.amazon.com/Kundalini-Untold-Story-Himalayan/dp/0994002793][Kundalini -- An Untold Story: A Himalayan Mystic's Insight into the Power of Kundalini and Chakra Sadhana]]. **** TODO [[https://news.ycombinator.com/item?id=12365693][Show HN: Top books mentioned in comments on Hacker News]]. **** TODO [[https://en.wikipedia.org/wiki/The_Prime_of_Miss_Jean_Brodie_%2528novel%2529][The Prime of Miss Jean Brodie (novel)]]. **** TODO [[https://www.goodreads.com/book/show/53849.Plan_B][Plan B]]. **** TODO [[http://www.amazon.com/Deskbound-Standing-Up-Sitting-World/dp/1628600586][Deskbound]]. **** TODO [[http://www.amazon.com/The-Way-Wanderlust-Writing-Travelers/dp/1609521056][The Way of Wanderlust: The Best Travel Writing of Don George (Travelers' Tales)]]. **** TODO [[https://en.m.wikipedia.org/wiki/We_%28novel%29][We (novel)]]. **** TODO [[http://ramiro.org/vis/hn-most-linked-books/][Top Books on Amazon Based on Links in Hacker News Comments (Hacker News)]]. **** TODO I'm OK, You're OK (Thomas A. Harris). **** TODO Mistakes Were Made (but not by me) (Tavris/Aronson). **** TODO Crucial Conversations (Patterson, Kelly...). **** TODO When Prophecy Fails (Festinger). **** TODO Influence (Robert Cialdini). **** TODO The Seven Day Weekend (Ricardo Semler). **** TODO Elements of Style (various). **** TODO The Man Who Sold the Eiffel Tower (various). **** TODO How to talk to anyone (Leil Lowndes). **** TODO [[http://www.gutenberg.org/ebooks/1091?msg=welcome_stranger][On Heroes, Hero-Worship, and the Heroic in History by Thomas Carlyle]]. **** TODO [[http://www.amazon.com/Light-Asia-Sir-Edwin-Arnold/dp/1491290447/ref=sr_1_1?s=books&ie=UTF8&qid=1451846351&sr=1-1&keywords=the+light+of+asia+by+sir+edwin+arnold][Edwin Sir Arnold's The Light of Asia]]. **** TODO [[http://www.amazon.com/Song-Celestial-Bhagavad-Gita-From-Mahabharata/dp/1848301596][Edwin Sir Arnold's The Song Celestial or Bhagavad-Gita]]. **** TODO [[http://www.amazon.com/great-curries-india-camellia-panjabi/dp/1904920357][50 great curries of india]]. **** TODO [[http://www.amazon.com/gp/product/034549802X?ie%3DUTF8&tag%3Doffsitoftimfe-20&linkCode%3Das2&camp%3D1789&creative%3D390957&creativeASIN%3D034549802X][8 Week to optimum health]]. **** TODO [[http://www.amazon.com/Guide-Good-Life-Ancient-Stoic/dp/0195374614][A Guide to the Good Life: The Ancient Art of Stoic Joy]]. **** TODO [[http://www.amazon.co.uk/Building-Microservices-Sam-Newman/dp/1491950358/ref%3Dsr_1_1?ie%3DUTF8&qid%3D1442603949&sr%3D8-1&keywords%3Dbuilding%2Bmicroservices][Building Microservices]]. **** TODO [[http://ocw.mit.edu/ans7870/21f/21f.027/opium_wars_01/ow1_essay.pdf][First Opium War essay]]. **** TODO [[http://www.amazon.com/full-catastrophe-living-wisdom-illness/dp/0739358588][Full catastrophe living]]. **** TODO [[https://www.goodreads.com/][goodreads.com]]. **** TODO [[http://www.amazon.com/gp/product/0061121088?ie%3DUTF8&tag%3Doffsitoftimfe-20&linkCode%3Das2&camp%3D1789&creative%3D390957&creativeASIN%3D0061121088][Leaving Microsoft to Change the world]]. **** TODO [[http://www.amazon.com/gp/product/0140442103?ie%3DUTF8&tag%3Doffsitoftimfe-20&linkCode%3Das2&camp%3D1789&creative%3D390957&creativeASIN%3D0140442103][Letters from a stoic]]. **** TODO [[http://www.goodreads.com/review/list/266149-michael?page=1&shelf=2014_read&view=covers][Michael's bookshelf]]. **** TODO [[http://www.brainpickings.org/2014/12/29/neil-degrasse-tyson-reading-list/][Neil degrasse tyson's reading list]]. **** TODO [[https://en.wikipedia.org/wiki/On_the_Road][On the Road, by Jack Kerouac]]. **** TODO [[https://librivox.org/search?primary_key=0&search_category=title&search_page=1&search_form=get_results][Public domain audio books]]. **** TODO [[http://www.amazon.co.uk/gp/product/1840001585/sr=8-1/qid=1419902519/ref=olp_product_details?ie=utf8&me=&qid=1419902519&sr=8-1][Royal horticultural society's organic Gardening]]. **** TODO [[http://www.salmanrushdie.com/books/][Salman Rushdie books]]. **** TODO [[http://www.amazon.com/Technopoly-The-Surrender-Culture-Technology/dp/0679745408][Technopoly: The Surrender of Culture to Technology]]. **** TODO The Songlines, Bruce Chatwin. **** TODO [[http://www.amazon.co.uk/Walkers-Guide-Outdoor-Clues-Signs/dp/1444780085][The Walker's Guide to Outdoor Clues and Signs]]. **** TODO [[http://www.amazon.co.uk/Thing-Explainer-Complicated-Stuff-Simple/dp/1473620910][Thing Explainer: Complicated Stuff in Simple Words]]. **** TODO [[http://www.amazon.co.uk/madhur-jaffreys-ultimate-curry-bible/dp/0091874157/ref=sr_1_3?ie=utf8&qid=1419973767&sr=8-3&keywords=madhur+jaffrey+curry][Ultimate curry bible]]. **** TODO [[http://www.amazon.co.uk/gp/product/1840001585/sr=8-1/qid=1419902519/ref=olp_product_details?ie=utf8&me=&qid=1419902519&sr=8-1][Veg patch]]. **** TODO [[http://www.amazon.co.uk/JavaScript-Developer-ECMAScript-OdeToCode-Programming-ebook/dp/B018D12X0C][What Every JavaScript Developer Should Know About ECMAScript 2015]]. **** TODO [[http://camdez.com/blog/2016/01/02/2016-reading-list/][Cameron Desautels's 2016 reading list]]. **** TODO Thinking Fast and Slow (Kahneman). **** DONE [[https://www.goodreads.com/book/show/28209634-autonomous][Autonomous by Annalee Newitz]]. **** DONE [[https://www.goodreads.com/book/show/12924261-this-book-is-full-of-spiders][This Book Is Full of Spiders by David Wong]]. **** DONE [[https://www.amazon.com/Why-We-Sleep-Unlocking-Dreams/dp/1501144316][Why we sleep]] ([[https://twitter.com/uberstuber/status/1138291707231887361?s=12][twitter outline]]). **** DONE [[http://www.amazon.com/Flow-Psychology-Experience-Perennial-Classics/dp/0061339202/][Flow: The Psychology of Optimal Experience]]. **** DONE [[http://www.harukimurakami.com/library/][Haruki Murakami]]. **** DONE [[http://www.amazon.com/gp/product/0812992180?ie%3DUTF8&tag%3Doffsitoftimfe-20&linkCode%3Das2&camp%3D1789&creative%3D390957&creativeASIN%3D0812992180][Vagabonding: An Uncommon Guide to the Art of Long-Term World Travel]]. * [2014-12-29 Mon] Gardening bookmarks :PROPERTIES: :CUSTOM_ID: gardening-bookmarks :END: :MODIFIED: [2020-05-04 Mon] :END: - [[https://mastergardeners.org/warm-cool-veg-charts][Recommended times to plant vegetables in Santa Clara County]]. - [[https://www.reddit.com/r/IAmA/comments/gc9agk/were_the_selftaught_development_team_behind_the_1/][We're the self-taught development team behind the #1 gardening app.]]. * [2014-12-03 Wed] Emacs tips backlog :PROPERTIES: :CUSTOM_ID: emacs-tips-backlog :END: :MODIFIED: [2017-06-18 Sun] :END: **** TODO [[https://github.com/mrkkrp/typit][Typit: typing game for Emacs]]. **** TODO [[https://github.com/Wilfred/pyimport][pyimports]]. **** TODO [[http://sriramkswamy.github.io/dotemacs/][Sriram Krishnaswamy's init]]. **** TODO [[http://williambert.online/2014/02/using-a-node-repl-with-emacs/][Using a Node repl in Emacs with nvm and npm]]. **** TODO [[https://github.com/afainer/arview][arview]]. **** TODO [[https://github.com/PythonNut/company-flx][company-flx: fuzzy matching to company]]. **** TODO [[https://melpa.org/?utm_source=dlvr.it&utm_medium=twitter#/go-guru][Integration of the Go 'guru' analysis tool into Emacs]]. **** TODO [[https://github.com/company-mode/company-statistics][company-mode/company-statistics: Sort completion candidates by previous completion choices]]. **** TODO [[https://www.youtube.com/watch?v=mtliRYQd0j4&feature=youtu.be][Rewrite git history with Emacs, magit and git rebase]]. **** TODO [[https://github.com/trezona-lecomte/coverage][Code coverage highlighting for Emacs]]. **** TODO [[http://elpa.gnu.org/packages/tramp-theme.html][tramp-theme]]. **** TODO [[https://github.com/alexmurray/cstyle][cstyle]]. **** TODO [[https://github.com/sigma/dotemacs/blob/master/lisp/config/go-config.el][A go Emacs config]]. **** TODO [[http://clubctrl.com/org/prog/howto.html][Try out ox-twbs]]. **** TODO [[http://ergoemacs.org/emacs/function-frequency.html][Emacs Lisp function frequency]]. **** TODO [[http://emacs.stackexchange.com/questions/7908/how-to-make-yasnippet-and-company-work-nicer][How to make yasnippet and company work nicer? (Stack Exchange)]]. **** TODO [[https://github.com/nekop/yasnippet-java-mode/blob/master/java-snippets.el][yasnippet-java-mode/java-snippets.el]]. **** TODO [[https://github.com/Lindydancer/font-lock-studio][font-lock-studio]]. **** TODO [[https://github.com/jorgenschaefer/emacs-buttercup][buttercup]]. **** TODO [[https://github.com/niku/markdown-preview-eww][markdown-preview-eww]]. **** TODO [[http://puntoblogspot.blogspot.co.uk/2016/01/til-ediff-revision.html?m=1][ediff-revision and magit-find-file to compare branches]]. **** TODO [[https://github.com/Gnouc/flycheck-checkbashisms/blob/master/README.md][Flycheck linter for sh using checkbashisms]]. **** TODO [[http://draketo.de/light/english/free-software/el-kanban-org-table][El Kanban Org: parse org-mode todo-states to use org-tables as Kanban tables]]. **** TODO [[http://qiita.com/fujimisakari/items/a6ff082f0e8eddc09511][Emacs iOS development (qiita)]]. **** TODO [[http://blog.fujimisakari.com/Emacs%25E3%2581%25A6%25E3%2582%2599iOS%25E9%2596%258B%25E7%2599%25BA-objective-c-%25E3%2581%2599%25E3%2582%258B%25E3%2581%259F%25E3%2582%2581%25E3%2581%25AE%25E7%2592%25B0%25E5%25A2%2583%25E6%25A7%258B%25E7%25AF%2589/][Emacs iOS development (fujimisakari)]]. **** TODO [[http://orgmode.org/worg/org-tutorials/encrypting-files.html][encrypting org files]]. **** TODO [[https://github.com/flycheck/flycheck-pos-tip][flycheck-pos-tip]]. **** TODO [[http://tiborsimko.org/emacs-epydoc-snippets.html][Writing Python Docstrings with Emacs]]. **** TODO [[https://github.com/To1ne/temacco/commit/6a084365ae137db2cdd035b7533847880d8c6cac][Try Completion for Objective-C (Github diff)]]. **** TODO [[https://github.com/steckerhalter/emacs-fasd][Emacs fasd support]]. **** TODO [[https://github.com/benma/visual-regexp.el][visual-regexp]]. **** TODO [[http://emacsredux.com/blog/2014/05/16/opening-large-files/][Open large files]]. **** TODO [[https://github.com/nathankot/company-sourcekit][company-sourcekit]] (Swift completion): [[https://github.com/wiruzx/dotfiles/blob/master/.emacs#L24][sample config]]. **** TODO [[https://github.com/dakrone/emacs-java-imports][emacs-java-imports]]. **** TODO append-to-buffer. **** TODO [[https://github.com/wavexx/python-x.el][python-x: extras for interactive evaluation]]. **** TODO [[https://github.com/emacsmirror/outlined-elisp-mode][outlined-elisp-mode]]. **** TODO [[https://github.com/tj64/outline-magic][outlien-magic]]. **** TODO Gutter and linum+ config (see [[https://github.com/zvlex/dotfiles][zvlex/dotfiles]]). **** TODO [[https://github.com/emacsfodder/kurecolor][kurecolor]]: Editing color. **** TODO [[https://www.gnu.org/software/emacs/manual/html_node/autotype/Autoinserting.html][auto-insert-mode]]. **** TODO Buffer local cursor color: [[https://github.com/skk-dev/ddskk/blob/master/readmes/readme.ccc.org][ccc]]. **** TODO clang indexing tool: [[http://ffevotte.github.io/clang-tags/][clang-tags]]. **** TODO Create custom theme: Trường's [[http://truongtx.me/2013/03/31/color-theming-in-emacs-24/][post]]. **** TODO [[https://github.com/Fuco1/dired-hacks][dired-hacks]]. **** TODO gtd emacs workflow: Charles cave's [[http://members.optusnet.com.au/~charles57/gtd/gtd_workflow.html][notes]]. **** DONE emacs-index-search (lookup subject in Emacs manual). **** DONE info-apropos (lookup subject in all manuals). **** TODO Jumping around tips: [[http://zerokspot.com/weblog/2015/01/07/jumping-around-in-emacs/][zerokspot]]. **** TODO Mac OS clipboard support (from terminal): [[https://github.com/jkp/pbcopy.el][pbcopy]]. **** OBSOLETE [[https://github.com/m0smith/malabar-mode][Malabar mode]]: For Java. **** TODO Melpa recipe format:[[https://github.com/milkypostman/melpa#recipe-format][format]]. **** OBSOLETE Naturaldocs for javascript: [[http://naiquevin.github.io/naturaldocs-for-javascript-in-emacs.html][Vineet's post]]. **** TODO Org protocol: see irreal's [[http://irreal.org/blog/?p=3594][post]] and oremacs's [[http://oremacs.com/2015/01/07/org-protocol-1/][part 1]] and [[http://oremacs.com/2015/01/08/org-protocol-2/][part 2]]. **** TODO org-multiple-keymap. More at [[https://github.com/myuhe/org-multiple-keymap.el][org-multiple-keymap.el]]. **** TODO [[https://github.com/yjwen/org-reveal/tree/stable][org-reveal]]: Export org to reveal.js. **** TODO Practice touch/speed typing: [[https://github.com/hagleitn/speed-type][speedtype]]. **** TODO private configuration: [[https://github.com/cheunghy/private][private]]. **** TODO project management for C/C++: [[https://github.com/lefterisjp/malinka][malinka]]. **** TODO Project templates: [[https://github.com/chrisbarrett/skeletor.el][skeletor]]. **** TODO Rewrite git logs. See [[http://shingofukuyama.github.io/emacs-magit-reword-commit-messages/][emacs magit tutorial | rewrite older commit]]. **** TODO [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Selective-Display.html][Selective display]]: Hide lines longer than. **** TODO shell-command-on-region: Print inline with C-u M-|. **** TODO shell-command: Print output inline with C-u M-!. **** TODO Simplify media file transformations: [[https://github.com/abo-abo/make-it-so][make-it-so]]. **** TODO [[https://github.com/mineo/yatemplate][yatemplate]]. **** TODO [[https://github.com/fujimisakari/emacs-helm-xcdoc][emacs-helm-xcdoc]]. **** OBSOLETE [[https://github.com/facetframer/orgnav][Drill down org files using orgnav (helm-based)]]. **** OBSOLETE [[https://github.com/prettier/prettier-emacs][Prettier emacs]]. (use [[https://github.com/purcell/reformatter.el][reformatter.el]].) **** OBSOLETE [[http://amitp.blogspot.co.uk/search/label/emacs][Spaceline walkthrough]]. **** OBSOLETE Try out emacs Android debug (see this [[http://gregorygrubbs.com/development/tips-on-android-development-using-emacs/][post]]). **** OBSOLETE [[https://github.com/syohex/emacs-quickrun][quickrun.el]]. **** OBSOLETE [[https://github.com/zakame/emacs-for-javascript][Emacs for JavaScript]]. **** OBSOLETE [[https://github.com/iced/go-gopath/blob/master/README.md][go-gopath]]. **** OBSOLETE [[https://github.com/alezost/shift-number.el][shift-number.el]]. **** OBSOLETE [[https://github.com/xuchunyang/DevDocs.el][https://github.com/xuchunyang/DevDocs.el]]. **** OBSOLETE [[https://github.com/jasonm23/emacs-select-themes/blob/master/select-themes.el][select-themes]]. **** OBSOLETE [[https://github.com/bmag/helm-purpose][Emacs purpose]]. **** OBSOLETE [[http://bling.github.io/blog/2016/01/18/why-are-you-changing-gc-cons-threshold/][Why are you changing gc-cons-threshold?]]. **** OBSOLETE [[https://github.com/nivekuil/corral][Corral]]. **** OBSOLETE [[https://github.com/nicklanasa/xcode-mode/blob/master/README.md][xcode-mode]]. **** OBSOLETE [[https://github.com/yuutayamada/commenter][commenter]]. **** OBSOLETE [[https://github.com/ustun/emacs-helpers-for-js/blob/master/uojs.el][Emacs JavaScript helpers]]. **** OBSOLETE [[https://github.com/lujun9972/yahoo-weather-mode][yahoo-weather-mode]]. **** OBSOLETE [[https://github.com/peteyy/.emacs.d/blob/master/settings/language-javascript.el][Peek at peteyy's Javascript config]]. **** OBSOLETE [[https://github.com/trotzig/import-js][import-js]]. **** OBSOLETE [[https://github.com/CodyReichert/es6-snippets][ES6 yasnippets]]. **** OBSOLETE [[https://github.com/swank-js/swank-js][swank-js]]. **** OBSOLETE [[https://github.com/ananthakumaran/tide][TypeScript Interactive Development Environment for Emacs]]. **** DONE Try out [[https://github.com/jacobdufault/cquery/blob/master/emacs/cquery.el][cquery]], [[https://github.com/emacs-lsp/lsp-mode][emacs-lsp]], and [[https://github.com/tigersoldier/company-lsp][company-lsp]]. **** DONE (setq projectile-use-git-grep t). <2018-12-27 Thu> **** DONE [[https://www.reddit.com/r/emacs/comments/46lv2q/is_there_any_easy_way_to_make_org_files_password/][Is there any easy way to make .org files password protected? (Reddit)]]. **** DONE use-package binding to different maps #+BEGIN_SRC emacs-lisp (use-package term :bind (:map term-mode-map ("M-p" . term-send-up) ("M-n" . term-send-down) :map term-raw-map ("M-o" . other-window) ("M-p" . term-send-up) ("M-n" . term-send-down))) #+END_SRC **** DONE [[https://github.com/syohex/emacs-qrencode/blob/master/README.md][Emacs qrencode]]. **** DONE [[https://github.com/Fuco1/smartparens][Smartparens]]. **** DONE [[https://gist.github.com/syohex/626af66ba3650252b0a2][Hash region]]. **** DONE [[https://github.com/syohex/emacs-helm-ispell][helm-ispell]]. **** DONE [[https://github.com/HKey/dired-atool][Pack/unpack files with atool on dired]]. **** DONE [[https://github.com/Alexander-Miller/company-shell][company-shell]]. **** DONE artbollocks-mode and writegood. More at Sacha's [[http://sachachua.com/blog/2011/12/emacs-artbollocks-mode-el-and-writing-more-clearly/][post]]. **** DONE comint-prompt-read-only for making shell prompts read-only. **** DONE [[https://github.com/kelvinh/org-page][org-page]]: Static blog. **** DONE [[https://www.reddit.com/r/emacs/comments/43b42y/i_just_realized_emacs_has_a_fast_infix_calculator/][I just realized Emacs has a fast infix calculator that's not calc or quick-calc... (Reddit)]]. **** DONE [[http://promberger.info/linux/2010/02/16/how-to-get-emacs-key-bindings-in-ubuntu/][How to get emacs key bindings in Ubuntu]]. **** DONE [[https://github.com/calvinwyoung/org-autolist][org-autolist]]. **** DONE Move up by parens: More at the [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Moving-by-Parens.html][manual]]. **** DONE sunrise-sunset. **** DONE [[https://github.com/abo-abo/ace-window][ace-window]]. **** DONE Checkdoc. **** DONE Choose magit repo c-u c-x g (magit-status). **** DONE continue comment blocks: m-j (indent-new-comment-line). **** DONE Debug expanded elisp macros: See Wisdom and Wonder's [[http://www.wisdomandwonder.com/link/9316/how-to-debug-expanded-elisp-macros][post]]. **** DONE delete-duplicate-lines **** DONE Describe bindings: C-h b lists all bindings. **** DONE Disable furniture #+BEGIN_SRC emacs-lisp (menu-bar-mode -1) (toggle-scroll-bar -1) (tool-bar-mode -1) #+END_SRC **** DONE [[https://github.com/silex/elmacro][elmacro]] shows keyboard as emacs lisp. **** DONE yasnippet mirrors with transformations more at [[https://capitaomorte.github.io/yasnippet/snippet-development.html#sec-3-6][snippet development]]. For example: #+BEGIN_SRC sh - (${1:id})${2:foo} { return $2; } - (void)set${2:$(capitalize yas-text)}:($1)avalue { [$2 autorelease]; $2 = [avalue retain]; } $0 #+END_SRC **** DONE Emacs regex: [[http://ergoemacs.org/emacs/emacs_regex.html][Emacs: text pattern matching (regex) tutorial]]. **** DONE export ascii art: [[http://www.lysator.liu.se/~tab/artist/][artist mode]] + [[http://ditaa.sourceforge.net][ditaa]] for uml. demo [[https://www.youtube.com/watch?v=ciux87xo8fc][video]]. **** DONE [[https://github.com/abo-abo/lispy][lispy]]. **** DONE [[https://github.com/dandavison/minimal][minimal]]: minimalist appearance. **** DONE Narrowing regions - c-x n n (narrow-to-region). - c-x n w (Widen). **** DONE [[https://www.gnu.org/software/emacs/manual/nxml-mode.html][nxml-mode]]. **** DONE [[https://github.com/jonnay/emagicians-starter-kit/blob/master/themes/org-beautify-theme.org][org-beautify-theme]]: a sub-theme to make org-mode more beautiful. **** DONE Recursive query/replace - M-x find-dired RET. - Navigate to location, RET. - Add find argument (omit for all files), RET. - t (select all). - Q (query-replace). - Enter search/replace terms. - y/n for each match. - C-x s ! (save all). **** DONE Repeat last command: C-x z (and just z threreafter). **** DONE Replace char with a newline - M-x replace-string RET ; RET C-q C-j. - C-q (quoted-insert). - C-j (newline). **** DONE [[https://github.com/bruce-connor/smart-mode-line][smart-mode-line]], [[http://pages.sachachua.com/.emacs.d/sacha.html][sacha's sample usage]]. **** DONE Toggling key bingings: [[http://oremacs.com/2014/12/25/ode-to-toggle/][ode to the toggle]]. **** DONE [[https://github.com/damiencassou/unify-opening][unify-opening]] **** DONE use-package: [[http://www.lunaryorn.com/2015/01/06/my-emacs-configuration-with-use-package.html][lunaryorn]]. **** DONE [[https://github.com/aaronbieber/sunshine.el][sunshine.el]]. **** DONE youtube-dl: [[http://oremacs.com/2015/01/05/youtube-dl/][or emacs]]. * [2014-07-09 Wed] Installing Emacs 24.4 on Linux :PROPERTIES: :CUSTOM_ID: installing-emacs--on-linux :END: #+BEGIN_SRC sh sudo apt-get install texinfo build-essential xorg-dev libgtk-3-dev libjpeg-dev libncurses5-dev libgif-dev libtiff-dev libm17n-dev libpng12-dev librsvg2-dev libotf-dev #+END_SRC * [2014-07-09 Wed] Installing Emacs 24.4 on Mac OS X :PROPERTIES: :CUSTOM_ID: installing-emacs-24-4-on-mac-os-x :END: See Yamamoto's Mac OS X [[https://github.com/railwaycat/emacs-mac-port][port]]. To install: #+BEGIN_SRC sh $ brew tap railwaycat/emacsmacport $ brew install emacs-mac #+END_SRC * [2014-11-02 Sun] Xcode6 tips :PROPERTIES: :CUSTOM_ID: xcode6-tips :END: From Ray Wenderlich's [[http://www.raywenderlich.com/85999/xcode-6-tips-tricks-tech-talk-video][tech talk]] And [[http://www.raywenderlich.com/72021/supercharging-xcode-efficiency][supercharging Your Xcode Efficiency (by Jack Wu)]]. ** Shortcuts - ⌘⇧o Fuzzy file search. - ⌘⌥j Fuzzy file search (showing in Xcode project hierarchy). - ⌘⇧j Show file in Xcode project hierarchy. - ⌘⌥0 Show/hide utility area (right panel). - ⌘0 Show/hide navigation area (left panel). - ⇧⌘Y Show/hide debug area (bottom panel). - Ctrli Indent selection. - ⌘\ Toggle breakpoint on line. - ⌘/ Toggle comment. - ⌘[1-8] Select tabs on left panel. - Ctrl[1-x] Select top file navigation menu items. ** Xcode features - Snippets. - Templates. - View debugging. - Simctl (send files to simulator). ** Plugins of interest - Fuzzy autocomplete. - Uncrustify for indentation. - xcs code switch expansion. - Org and order (for properties). * [2015-12-12 Sat] Simple ssh tunnel :PROPERTIES: :CUSTOM_ID: simple-ssh-tunnel :END: Via [[https://twitter.com/climagic/status/674688454526136320?refsrc%3Demail&s%3D11][@climagic]], connections to tcp localhost:9909 will be made to 192.168.1.1:80 via SSH tunnel to home. #+BEGIN_SRC sh ssh -L 9909:192.168.1.1:80 home #+END_SRC * [2014-09-20 Sat] gpg/pgp bookmarks :PROPERTIES: :CUSTOM_ID: gpgpgp-bookmarks :END: :MODIFIED: [2019-05-06 Mon] :END: - [[https://gpgtools.tenderapp.com/kb/gpg-keychain-faq/backup-or-transfer-your-keys][Backup or transfer your keys / GPG Keychain FAQ / Knowledge Base - GPGTools Support]]. - [[https://alexcabal.com/creating-the-perfect-gpg-keypair][Creating the perfect GPG keypair - Alex Cabal]]. - [[https://github.com/kensanata/ggg][Gmail, Gnus and GPG guide]]. - [[https://emacsist.github.io/2019/01/01/gnupg2使用指北/][GnuPG2 snippets - emacsist]]. - [[https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-57pt1r4.pdf][NIST Special Publication: Recommendation for Key Management]]. - [[https://riseup.net/en/security/message-security/openpgp/best-practices][OpenPGP Best Practices - riseup.net]]. - [[https://medium.com/@ahawkins/securing-my-digital-life-gpg-yubikey-ssh-on-macos-5f115cb01266][Securing My Digital Life: GPG, Yubikey, & SSH on macOS]]. - [[https://www.gnupg.org/gph/en/manual.html][The GNU Privacy handbook]]. * [2014-09-20 Sat] Emacs lisp bookmarks :PROPERTIES: :CUSTOM_ID: emacs-lisp-bookmarks :END: :MODIFIED: [2021-11-28 Sun] :END: - [[https://twitter.com/kaushalmodi/status/1059873868175826946?s=12][(setq search-whitespace-regexp ".*?") isearch "abc ghi" matches "abcdefghi"]]. - [[https://github.com/kinghom/elisp-guide][A quick guide to Emacs Lisp programming]]. - [[https://github.com/alphapapa/unpackaged.el#font-compare][A snippet to try out fonts]]. - Abo abo's [[https://github.com/abo-abo/elisp-guide][Emacs Lisp Guide]]. - [[http://www.wilfred.me.uk/blog/2015/03/19/adding-a-new-language-to-emacs/][Adding A New Language to Emacs (ie. writing a new major mode)]]. - [[https://github.com/alphapapa/emacs-package-dev-handbook][alphapapa's The Emacs Package Developer’s Handbook]]. - [[https://nullprogram.com/blog/2019/03/10/][An Async / Await Library for Emacs Lisp « null program]]. - [[http://harryrschwartz.com/2014/04/08/an-introduction-to-emacs-lisp.html][An introduction to emacs lisp]]. - [[https://elpa.gnu.org/packages/path-iterator.html][An iterator for traversing a directory path]]. - [[https://www.badykov.com/emacs/2020/05/05/async-company-mode-backend/][Async autocompletion in Emacs – Kraken of Thought]]. - [[http://caiorss.github.io/Emacs-Elisp-Programming/Elisp_Snippets.html][Caio Rordrigues's Elisp Snippets]]. - [[https://github.com/caiorss/Emacs-Elisp-Programming][Caio's Emacs - Programming and Customization]]. - [[https://rosettacode.org/wiki/Category:Emacs_Lisp][Category:Emacs Lisp - Rosetta Code]]. - [[https://tech.tonyballantyne.com/emacs/lisp-loops/][Common Lisp Loops – Tony Ballantyne Tech]]. - [[https://tech.tonyballantyne.com/emacs/date-and-time/][Date and Time – Tony Ballantyne Tech]]. - [[http://www.emacswiki.org/emacs/ElDoc][eldoc-mode]]. - [[https://github.com/alphapapa/elexandria/blob/a22b12f3472baa617545d2f247ea41f5ef70a488/elexandria.el#L103][elexandria/elexandria.el's with-file-buffer macro]]. - [[https://github.com/alhassy/ElispCheatSheet][ElispCheatSheet: Quick reference to the core language of Emacs ---Editor MACroS.]]. - [[https://github.com/caiorss/Emacs-Elisp-Programming][Emacs - Elisp Programming and Customization]]. - [[https://caiorss.github.io/Emacs-Elisp-Programming/Elisp_Programming.html][Emacs Elisp Programming guide]]. - [[https://github.com/chrisdone/elisp-guide/blob/master/README.md][Emacs Lisp Guide, chrisdone/elisp-guide · GitHub]]. - [[https://github.com/larsmagne/emacs-sqlite3][Emacs sqlite binding of Emacs Lisp inspired by mruby-sqlite3]]. - [[http://www.emacswiki.org/emacs/EmacsSymbolNotation][Emacs symbol notation]]. - [[https://github.com/skeeto/emacs-bencode][emacs-bencode: Bencode package for Emacs Lisp (encoding losely structured data)]]. - [[http://newartisans.com/2016/01/pattern-matching-with-pcase/][Emacs: Pattern Matching with pcase]]. - [[https://curiousprogrammer.wordpress.com/2009/06/08/error-handling-in-emacs-lisp/][Error Handling in Emacs Lisp]]. - [[https://www.reddit.com/r/emacs/comments/9auzla/example_showing_how_useful_the_ampleregexps/][Example showing how useful the ample-regexps package is : emacs]]. - [[http://www.emacswiki.org/emacs/find-library.el][find-library]]. - [[https://github.com/functionreturnfunction/format-table][format-table: Parse and reformat tabular data in emacs (Looks great for converting between org, json, and other RDBMS)]]. - [[https://github.com/alphapapa/ts.el][GitHub - alphapapa/ts.el: Emacs date-time library]]. - [[https://github.com/brandelune/nipel][GitHub - brandelune/nipel: New Introduction to Programming in Emacs Lisp]]. - [[https://github.com/Lindydancer/face-explorer][GitHub - Lindydancer/face-explorer: Library and tools for faces and text properties]]. - [[https://github.com/p3r7/awesome-elisp][GitHub - p3r7/awesome-elisp: A curated list of emacs-lisp development resources]]. - [[https://github.com/Wilfred/ht.el][GitHub - Wilfred/ht.el: The missing hash table library for Emacs]]. - [[https://github.com/xuchunyang/elisp-demos/][GitHub - xuchunyang/elisp-demos: Demonstrate Emacs Lisp APIs]]. - [[http://ruzkuku.com/texts/emacs-style.html][Good Style in modern Emacs Packages]]. - [[https://harryrschwartz.com/2014/04/08/an-introduction-to-emacs-lisp.html][Harry R. Schwartz's An Introduction to Emacs Lisp]]. - [[https://yoo2080.wordpress.com/2013/09/22/how-to-choose-emacs-lisp-package-namespace-prefix][How to choose Emacs Lisp package namespace prefix]]. - [[http://nullprogram.com/blog/2013/02/06/][How to Make an Emacs Minor Mode]]. - [[http://emacslife.com/how-to-read-emacs-lisp.html][How to read emacs lisp]]. - [[https://yoo2080.wordpress.com/2014/07/20/it-is-not-hard-to-edit-lisp-code/][It's not hard to edit Lisp code]]. - [[https://github.com/hypernumbers/learn_elisp_the_hard_way/blob/master/contents/why-did-I-write-this-book.rst][Learn elisp the hard way]]. - [[https://bzg.fr/en/learn-emacs-lisp-in-15-minutes/][Learn Emacs Lisp in 15 minutes - Bastien Guerry]]. - [[http://bzg.fr/learn-emacs-lisp-in-15-minutes.html][Learn emacs lisp in 15 minutes]]. - [[http://thewanderingcoder.com/2015/01/emacs-org-mode-links-and-exported-html/][Links and exported HTML]]. - [[https://yoo2080.wordpress.com/2013/08/07/living-with-emacs-lisp][Living with Emacs Lisp]]. - [[http://www.gigamonkeys.com/book/loop-for-black-belts.html][LOOP for Black Belts]]. - [[http://mbork.pl/2018-12-03_looking-back-p][Marcin Borkowski: 2018-12-03 looking-back-p]]. - [[http://mbork.pl/2019-03-25_Using_benchmark_to_measure_speed_of_Elisp_code][Marcin Borkowski: 2019-03-25 Using benchmark to measure speed of Elisp code]]. - [[http://www.nongnu.org/emacs-tiny-tools/elisp-coding/][Nongnu elisp guidelines]]. - [[http://newartisans.com/2016/01/pattern-matching-with-pcase/][Pattern matching with pcase]]. - [[https://tech.tonyballantyne.com/emacs/pattern-matching-pcase/][Pattern Matching: pcase – Tony Ballantyne Tech]]. - [[http://emacslife.com/how-to-read-emacs-lisp.html][Read Lisp, Tweak Emacs]]. - [[https://joelmccracken.github.io/entries/reading-writing-data-in-emacs-batch-via-stdin-stdout/][Reading from stdin and writing to stdout with Emacs batch]]. - [[http://thewanderingcoder.com/2015/02/refactoring-beginning-emacs-lisp-i-adding-tests/][Refactoring “Beginning Emacs Lisp”: I: Adding Tests]]. - [[https://gist.github.com/equwal/89b1ef5ac8d4d737cfd37f66e9ba4895][Selecting and trying out different fonts in Emacs]]. - [[https://github.com/purcell/elisp-slime-nav][Slime-style navigation for Emacs Lisp]]. - [[https://hungyi.net/posts/split-list-into-batches-elisp/][Split a List Into Batches Using Emacs Lisp - Hung-Yi’s Journal]]. - [[https://zck.me/testing-buffer-modifying-emacs-code][Testing Emacs code that modifies buffers]]. - [[http://nic.ferrier.me.uk/blog/2012_07/tips-and-tricks-for-emacslisp][Tips on Emacs Lisp programming]]. - [[http://endlessparentheses.com/understanding-letf-and-how-it-replaces-flet.html][Understanding letf and how it replaces flet · Endless Parentheses]]. - [[https://github.com/larsmagne/vpt.el/blob/master/vpt.el][Variable Pitch Tables]]. - [[https://github.com/larsmagne/vpt.el][vpt.el: An Emacs package to display tabular data with variable pitch fonts]]. - [[https://github.com/larsmagne/watch-directory.el/blob/master/watch-directory.el][Watch a directory using elisp (larsmagne)]]. - [[https://github.com/larsmagne/watch-directory.el/blob/master/watch-directory.el][watch-directory.el watches a directory for new files]]. - [[https://www.reddit.com/r/emacs/comments/43nh3h/whats_the_best_practice_to_write_emacslispat_2016/][What's the best practice to write emacs-lisp (at 2016)? (Reddit)]]. - [[https://emacs.stackexchange.com/questions/2868/whats-wrong-with-find-file-noselect][What's wrong with `find-file-noselect`? (Emacs Stack Exchange)]]. - [[http://wikemacs.org/wiki/Emacs_Lisp_Cookbook][Wikemacs's Emacs Lisp Cookbook]]. - [[https://with-emacs.com/posts/tutorials/almost-all-you-need-to-know-about-variables/][with-emacs · (Almost) All You Need to Know About Variables]]. - [[https://qiita.com/itiut@github/items/d917eafd6ab255629346][with-suppressed-message macro]]. - [[https://www.youtube.com/watch?v=XjKtkEMUYGc&feature=youtu.be][Writing a Spotify Client]]. - [[https://iloveemacs.wordpress.com/2016/02/27/writing-web-apps-in-emacs-lisp/][Writing Web apps in Emacs Lisp (simple-httpd)]]. - [[http://ergoemacs.org/emacs/elisp_symbol.html][Xah Lee's Emacs Lisp Symbol (tutorial)]]. - [[http://ergoemacs.org/emacs/elisp_common_functions.html][Xah's Common Emacs Lisp Functions]]. - [[http://ergoemacs.org/emacs/elisp_idioms_batch.html][Xah's Emacs Lisp idioms for Text Processing in Batch Style]]. - [[http://ergoemacs.org/emacs/elisp.html][Xah's Emacs Lisp Tutorial]]. - [[https://github.com/bddean/xml-plus][XML utilities for Emacs lisp]]. - [[https://github.com/xuchunyang/elisp-demos/blob/master/elisp-demos.org][Xu Chunyang's Elisp demos/examples/snippets ]]. * [2014-09-19 Fri] Emacs bookmarks :PROPERTIES: :CUSTOM_ID: emacs-bookmarks :END: :MODIFIED: [2023-11-12 Sun] :END: - [[https://christiantietze.de/posts/2021/06/emacs-center-window-on-current-monitor/ - [[https://karthinks.com/software/bridging-islands-in-emacs-1/][Bridging Islands in Emacs: re-builder and query-replace-regexp | Karthinks]]. - [[https://medium.com/@jrmjrm/configuring-emacs-and-eglot-to-work-with-astro-language-server-9408eb709ab0][Configuring Emacs and Eglot to work with Astro language server | by Jayaram |...]]. - [[https://willschenk.com/articles/2020/tramp_tricks/][Emacs Tramp tricks]]. - [[https://philjackson.github.io//emacs/shell/2021/07/26/export-an-environment-variable-to-emacs/][Export an environment variable to Emacs | Snippets and other bits]]. - [[https://ruzkuku.com/texts/lesser-known.html#m-x-find-library-mode-local-ret-2004][Lesser known functionalities in core Emacs (see setq-mode-local)]]. - [[https://ruzkuku.com/texts/lesser-known.html][Lesser known functionalities in core Emacs]]. - [[https://philjackson.github.io/emacs/mu4e/email/2021/08/30/save-all-mu4e-attachments/][Save all mu4e attachments | Snippets and other bits]]. ][Christian Tietze: Emacs: center window on current monitor]]. - [[https://github.com/junjiemars/.emacs.d/blob/master/config/gud-cdb.el][.emacs.d/gud-cdb.el (supports lldb)]]. - [[https://github.com/junjiemars/.emacs.d/blob/master/config/gud-lldb.el][.emacs.d/gud-lldb.el at master · junjiemars/.emacs.d · GitHub]]. - [[https://emacsthemes.com/][A GNU Emacs Themes Gallery (great for previewing)]]. - [[http://irreal.org/blog/?p=5378][A Reminder About Macro Counters]]. - [[https://spin.atomicobject.com/2016/05/27/write-emacs-package/][A Simple Guide to Writing & Publishing Emacs Packages]]. - [[https://www.reddit.com/r/emacs/comments/ggnekq/a_very_minimal_but_elegant_emacs_i_think/][A very minimal but elegant emacs (I think) : emacs]]. - [[http://blog.aaronbieber.com][Aaron Bieber's blog]]. - [[http://www.jesshamrick.com/2012/09/10/absolute-beginners-guide-to-emacs/][Absolute Beginner's Guide to Emacs]]. - [[https://scripter.co/accessing-devdocs-from-emacs/][Accessing Devdocs from Emacs]]. - [[https://blog.d46.us/advanced-emacs-startup][Advanced Techniques for Reducing Emacs Startup Time]]. - [[https://github.com/baohaojun/ajoke][Ajoke]]. - [[https://amitp.blogspot.com/2019/07/emacs-mode-line-simplified.html][Amit's Thoughts: Emacs mode line simplified]]. - [[http://www.masteringemacs.org/article/introduction-magit-emacs-mode-git][An introduction to Magit, an Emacs mode for Git]]. - [[https://www.reddit.com/r/emacs/comments/htfwfa/andrea_corallo_gccemacs_update_10_july_16_2020/][Andrea Corallo: gccemacs Update 10 (July 16, 2020)]]. - [[http://m00natic.github.io/emacs/emacs-wiki.html][Andrey's Opionated Emacs Guide]]. - [[http://danmidwood.com/content/2014/11/21/animated-paredit.html][Animated guide to paredit]]. - [[https://www.reddit.com/r/emacs/comments/ehzxhn/any_packagesolution_to_fix_cursor_13_from_top_of/][Any package/solution to fix cursor 1/3 from top of buffer? (ie. alternatives to centered-cursor-mode)]]. - [[http://blog.binchen.org/posts/aspell-0-60-8-will-have-direct-support-for-camelcase-words.html][Aspell 0.60.8 will have direct support for camelCase words (Update Emacs flyspell setup)]]. - [[https://vxlabs.com/2018/03/30/asynchronous-rsync-with-emacs-dired-and-tramp/][Asynchronous rsync with Emacs, dired and tramp. – vxlabs]]. - [[https://oracleyue.github.io/2018/05/13/emacs-setup-md/][Automator to open files in Emacs clients by double-clicks]]. - [[https://github.com/emacs-tw/awesome-emacs/blob/master/README.org][Awesome Emacs]]. - [[https://github.com/manateelazycat/aweshell][Awesome shell extension eshell with wonderful features]]. - [[https://github.com/bzg/emacs-training][Bastien's Emacs training]]. - [[https://www.reddit.com/r/emacs/comments/3r9fic/best_practicestip_for_companymode_andor_yasnippet/][Best practices/tip for Companymode and/or YASnippet]]. - [[https://github.com/walseb/blimp/blob/master/readme.org][Blimp - Bustling Image Manipulation Package (Emacs)]]. - [[https://lars.ingebrigtsen.no/2020/08/02/emacs-on-macos-for-linux-peeps/][Building Emacs on Macos for Linux Peeps – Random Thoughts]]. - [[https://beepb00p.xyz/pkm-search.html][Building personal search infrastructure for your knowledge and code | beepb00p]]. - [[https://www.reddit.com/r/emacs/comments/969wlv/c_integration_rtags_vs_emacsc=query_vs_ironymode/][C++ Integration: rtags vs emacs-cquery vs irony-mode (Reddit)]]. - [[http://cachestocaches.com/2015/8/c-completion-emacs/][C/C++ Completion in Emacs]]. - [[https://www.reddit.com/r/emacs/comments/66pq04/cant_get_tern_mode_to_work_properly/][Can't get Tern mode to work properly (Reddit)]]. - [[http://irreal.org/blog/?p=7207][Capturing Code Snippets]]. - [[https://www.reddit.com/r/emacs/comments/9dg13i/cclsnavigate_semantic_navigat=ion_for_cc/][ccls-navigate: semantic navigation for C/C++/ObjC ]]. - [[https://github.com/MaskRay/ccls][ccls: C/C++/ObjC language server supporting cross references, hierarchies, completion and semantic highlighting]]. - [[https://two-wrongs.com/centered-cursor-mode-in-vanilla-emacs][Centered Cursor Mode in Vanilla Emacs]]. - [[https://github.com/redguardtoo/emacs.d/issues/827][Chen Bin's councel/ctags/etags config]]. - [[https://ddavis.fyi/blog/2018-07-07-emacs-cpp-ide/][Clangd based Emacs C++ IDE (Doug Davis)]]. - [[https://twitter.com/magit_emacs/status/1284245544160952320][Colors in emacs -nw (use ~/.Xresources)]]. - [[https://people.gnome.org/~federico/blog/compilation-notifications-in-emacs.html][Compilation notifications in Emacs - Federico's Blog]]. - [[https://medium.com/@suvratapte/configuring-emacs-from-scratch-intro-3157bed9d040][Configuring Emacs from Scratch — Intro - Suvrat Apte - Medium]]. - [[http://codewinds.com/blog/2015-04-02-emacs-flycheck-eslint-jsx.html][Configuring emacs to use eslint and babel with flycheck for javascript and React.js JSX]]. - [[http://mbork.pl/Content_AND_Presentation][Content AND Presentation]]. - [[https://github.com/redguardtoo/counsel-etags#ctags-setup][counsel-etags: Fast, energy-saving, and powerful code navigation solution]]. - [[https://erick.navarro.io/blog/creating-an-emacs-formatter-the-easy-way/][Creating an emacs formatter the easy way]]. - [[https://lars.ingebrigtsen.no/2018/11/12/cropping-images-in-emacs/][Cropping Images in Emacs (Lars Ingebrigtsen)]]. - [[https://emacs.zeef.com/ehartc][Curated list of packages by Ernst de Hart]]. - [[https://gist.github.com/maciejsmolinski/ea09a7b6dfabe70fac040915bc266b5e][Custom REPL snippet]]. - [[http://emacs-fu.blogspot.co.uk/2011/08/customizing-mode-line.html][Customizing emacs mode line]]. - [[https://zhangda.wordpress.com/][Da's recipes on Emacs, IT, and more (Da Zhang's web notes)]]. - [[http://www.modernemacs.com/post/major-mode-part-1/][Deep diving into a major mode - Part 1 | Modern Emacs]] (handy for writing a REPL). - [[http://www.modernemacs.com/post/major-mode-part-2/][Deep diving into a major mode - Part 2 (IDE Features) | Modern Emacs]]. - [[https://gonewest818.github.io/2020/02/dimmer.el-20200227.1712][dimmer.el (highlights active window)]]. - [[http://irreal.org/blog/?p=5380][Directory-Local Variables]]. - [[https://github.com/Silex/docker.el/blob/master/README.md][docker.el: Emacs integration for Docker]]. - [[https://scripter.co/do-ediff-as-i-mean/][Ediff DWIM function by scripter.co]]. - [[https://emacsnotes.wordpress.com/2018/05/14/editing-html-textareas-with-emacs-bye-bye-its-all-text-hello-textern/][Editing HTML Textareas with Emacs: Bye, bye “It’s All Text! “, Hello “Textern"]]. - [[https://gleek.github.io/blog/2017/04/11/editing-remote-code-with-emacs/][Editing remote code with Emacs (tramp tips) - Umar Ahmad]]. - [[https://lgfang.github.io/mynotes/emacs/emacs-xml.html#sec-5][Editing XML in Emacs]]. - [[http://www.masteringemacs.org/articles/2011/01/14/effective-editing-movement/][Effective editing I:Movement]] - [[http://ergoemacs.org/emacs/effective_emacs.html][Effective emacs tips]]: From ergoemacs. - [[https://sites.google.com/site/steveyegge2/effective-emacs][Effective emacs]]: Steve Yegge's effective emacs tips. - [[https://ddavis.io/posts/eglot-cpp-ide/][Eglot based Emacs C++ IDE with clangd (ddavis.io)]]. - [[https://github.com/sp1ff/elfeed-score/blob/master/README.org][elfeed-score: brings Gnus-style scoring to Elfeed]]. - [[https://realpython.com/blog/python/emacs-the-best-python-editor/?utm_content=buffer661a4&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer][Emacs - the Best Python Editor?]]. - [[https://qiita.com/advent-calendar/2019/emacs][Emacs Advent Calendar 2019 - Qiita]]. - [[https://twitter.com/sanityinc/status/1182877775746588672][Emacs and macOS Catalina issues (twitter)]]. - [[https://www.mortens.dev/blog/emacs-and-the-language-server-protocol/][Emacs and the Language Server Protocol - Morten's Dev]]. - [[https://joshwolfe.ca/post/emacs-for-csharp/][Emacs as a C# development environment - Josh Wolfe]]. - [[https://forums.unrealengine.com/showthread.php?52891-Emacs-as-my-UE4-IDE-with-intellisense][Emacs as my UE4 IDE with intellisense]]. - [[https://lars.ingebrigtsen.no/2016/06/28/emacs-can-haz-fancy-meme/][EMACS CAN HAZ FANCY MEME – Random Thoughts]]. - [[http://www.swaroopch.com/2013/10/17/emacs-configuration-tutorial][Emacs configuration]]: Simplify package management with cask. - [[http://emacsfodder.github.io/][Emacs Fodder]]. - [[https://sites.google.com/site/drielsma/xcodeplusemacs][Emacs for Cocoa development]]. - [[https://github.com/pierre-lecocq/emacs4developers][Emacs for developers]]. - [[https://patrickskiba.com/emacs/2019/09/07/emacs-for-react-dev.html][Emacs for the React developer (Patrick Skiba)]]. - [[https://patrickskiba.com/emacs/2019/09/07/emacs-for-react-dev.html][Emacs for the React developer | Patrick Skiba]]. - [[https://www.reddit.com/r/emacs/comments/ca6q7v/emacs_for_web_dev_rjsx_webmode_tide_js2etc/][Emacs for Web/Javascript Dev: rjsx, web-mode, tide, js2.....etc?]]. - [[http://roupam.github.io/][Emacs for Xcode+ios Development]]. - [[https://punchagan.muse-amuse.in/blog/emacs-frame-as-a-pop-up-input/][Emacs frame as a pop-up input - Noetic Nought]]. - [[https://huytd.github.io/emacs-from-scratch.html][Emacs from scratch (huytd)]]. - [[https://www.redbubble.com/shop/emacs][Emacs Gifts & Merchandise | Redbubble]]. - [[https://arenzana.org/2019/12/emacs-go-mode-revisited/][Emacs Go Mode – Revisited – arenzana.org]]. - [[http://www.reddit.com/r/emacs/comments/1rck3u/what_do_you_use_to_navigate_code][Emacs goodies]]: Emacs post with tips for navigating code. - [[http://emacshorrors.com][Emacs horrors]]. - [[https://sachachua.com/blog/2021/04/emacs-hydra-allow-completion-when-i-can-t-remember-the-command-name/][Emacs Hydra: Allow completion when I can't remember the command name]]. - [[https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/master/guide-en.org][Emacs in one year]]: Someone's emacs experience over a year. - [[http://emacs.sexy/][Emacs is sexy]]. - [[http://irreal.org/blog/][Emacs Keybindings for Mac OS X]]. - [[https://gist.github.com/avendael/7028579][Emacs keybindings for vimium]]. - [[http://overtone.github.io/emacs-live/][Emacs live]]. - [[https://phst.eu/emacs-modules][Emacs modules (Philipp’s documents)]]. - [[http://www.emacswiki.org/emacs/EmacsNiftyTricks][Emacs Nifty tricks]]: Another source of emacs goodness. - [[http://emacsnyc.org/videos.html][Emacs NYC videos]]. - [[https://gitea.petton.fr/DamienCassou/khardel][Emacs package integrating khard, a console cardav client]]. - [[http://emacsredux.com/][Emacs redux]]. - [[http://emacsrocks.com][Emacs rocks]]. - [[https://ubolonton.github.io/emacs-module-rs/0.8.0/][Emacs Rust module]]. - [[https://alexn.org/wiki/emacs.html][Emacs Setup (macOS) - Alexandru Nedelcu]]. - [[https://gist.github.com/rangeoshun/67cb17392c523579bc6cbd758b2315c1][Emacs snippet: Typescript with CSS in JS, JSX and graphql highlighing.]]. - [[http://bzg.fr/emacs-strip-tease.html][Emacs striptease (removing furniture)]]. - [[https://willschenk.com/articles/2020/tramp_tricks/][Emacs Tramp tricks (including docker snippet)]]. - [[https://forums.freebsd.org/threads/emacs-tramp-very-slow-on-connection.64498/][Emacs Tramp very slow on connection (The FreeBSD Forums)]]. - [[http://planet.emacsen.org/][Emacs workshop]]. - [[http://lavnir.be/wp/][Emacs | less]]. - [[https://realpython.com/emacs-the-best-python-editor/][Emacs – The Best Python Editor? – Real Python]]. - [[https://idiocy.org/emacs-fonts-and-fontsets.html][Emacs, fonts and fontsets]]. - [[https://jherrlin.github.io/posts/emacs-gnupg-and-pass/][Emacs, GnuPG and Pass | jherrlin]]. - [[https://github.com/mathiasdahl/emacs-launcher][emacs-launcher: A launcher for programs, files, folders, web pages and other, using Emacs (supersedes anything-launcher)]]. - [[https://github.com/emacs-lsp/dap-mode#swift][emacs-lsp/dap-mode: Debug Adapter Protocol for Emacs (Swift included)]]. - [[https://github.com/emacs-lsp/lsp-ivy/tree/78c1429c62c19006058b89d462657e1448d1e595][emacs-lsp/lsp-ivy: ivy workspace symbols offered by lsp-mode]]. - [[https://github.com/shshkn/emacs.d/blob/master/docs/nativecomp.md][emacs.d/nativecomp.md (gccemacs)]]. - [[https://www.alexgallego.org/emacs/productivity/2016/01/16/emacs-no-modeline.html][Emacs: No modeline]]. - [[https://realpython.com/emacs-the-best-python-editor/][Emacs: The Best Python Editor? – Real Python]]. - [[https://www.reddit.com/r/emacs/comments/hhbcg7/emacsclient_eval_with_command_line_arguments/][Emacsclient --eval with command line arguments? : emacs]]. - [[http://emacslife.com/][Emacslife]]. - [[https://github.com/cireu/emacsql-sqlite3][emacsql-sqlite3: Yet another EmacSQL backend for SQLite]]. - [[https://www.emacswiki.org/emacs/CreatingYourOwnCompileErrorRegexp][EmacsWiki: Creating Your Own Compile Error Regexp]]. - [[https://www.emacswiki.org/emacs/EshellForLoop][EmacsWiki: Eshell For Loop]]. - [[https://github.com/jonnay/emagicians-starter-kit][Emagicians starter kit]]. - [[https://github.com/m-parashar/emax64][emax64: 64-bit Emacs for Windows with ImageMagick 7]]. - [[http://endlessparentheses.com][Endless parenthesis]]. - [[http://www.skybert.net/emacs/java/][Enterprise Java Development in Emacs]]. - [[https://ambrevar.xyz/emacs-eshell/][Eshell as a main shell]]. - [[https://github.com/kaihaosw/eshell-prompt-extras/blob/master/README.md][eshell-prompt-extras: Display extra information and color for your eshell prompt]]. - [[http://www.misshula.org/category/tutorials.html][Evan Misshula (lots of great tutorials)]]. - [[http://edkolev.github.io/posts/2017-09-10-travis-for-emacs-packages.html][Evgeni Kolev Blog - Travis CI integration for emacs packages]]. - [[http://mitchfincher.blogspot.co.uk/2017/03/example-of-syntax-highlighting-with.html][Example of Syntax Highlighting]]. - [[https://francismurillo.github.io/2017-04-15-Exploring-Emacs-chart-Library/][Exploring Emacs chart Library (chart-bar-quickie)]]. - [[https://twitter.com/maciejsmolinski/status/1269886224774451200][extend #emacs to run an interactive REPL process]]. - [[https://www.reddit.com/r/emacs/comments/973418/feedbuilderel_an_rss_and_atom=_generator/][feed-builder.el: An RSS (and Atom?) generator : emacs]]. - [[http://irreal.org/blog/?p=7359][Find Commits Affecting a Function (Irreal)]]. - [[https://github.com/d11wtq/fiplr][Fiplr]]: An Emacs Fuzzy Find in Project Package. - [[https://gist.github.com/dive/f64c645a9086afce8e5dd2590071dbf9][Fix Emacs permissions on macOS Catalina]]. - [[https://github.com/lewang/flx][Flx for emacs]]: Sublime-style searching for emacs. - [[https://manuel-uberti.github.io//emacs/2019/07/18/reformatter/][Format XML like a pro]]. - [[https://juanjoalvarez.net/es/detail/2014/sep/19/vim-emacsevil-chaotic-migration-guide/][From Vim to Emacs+Evil chaotic migration guide]]. - [[http://fukuyama.co][Fukuyama's Emacs/iOS]]. - [[https://gist.github.com/mikroskeem/0a5c909c1880408adf732ceba6d3f9ab#gistcomment-3294346][gccemacs on OSX (mikroskeem's gist)]]. - [[https://gitlab.com/koral/gcmh][GCMH - the Garbage Collector Magic Hack]]. - [[https://blog.hoetzel.info/post/eshell-notifications][Get desktop notifications from Emacs shell commands ·]]. - [[https://www.reddit.com/r/emacs/comments/e8cm8x/get_stackoverflow_answers_with_completion_without/][Get Stackoverflow answers with completion (without Helm) : emacs]]. - [[https://github.com/GhostText/GhostText/blob/master/README.md][GhostText: Use Emacs to write in your browser]]. - [[http://whatworks4me.wordpress.com/2011/04/13/view-git-diffs-in-emacs-using-ediff/][Git diffs using Emacs ediff]]. - [[https://github.com/akirak/git-identity.el][git-identity.el: Manage multiple Git identities from inside Emacs]]. - [[https://github.com/alphapapa/yequake][GitHub - alphapapa/yequake: Drop-down Emacs frames, like Yakuake (modal emacs frames)]]. - [[https://github.com/AndreaCrotti/yasnippet-snippets][GitHub - AndreaCrotti/yasnippet-snippets: a collection of yasnippet]]. - [[https://github.com/bastibe/annotate.el][GitHub - bastibe/annotate.el: Annotate.el]]. - [[https://github.com/bzg/emacs-training][GitHub - bzg/emacs-training: Emacs training]]. - [[https://github.com/CeleritasCelery/company-async-files][GitHub - CeleritasCelery/company-async-files: company-files with an async banckend]]. - [[https://github.com/chuntaro/epaint][GitHub - chuntaro/epaint: A simple paint tool for Emacs]]. - [[https://github.com/dieggsy/esh-autosuggest][GitHub - dieggsy/esh-autosuggest: Fish-like autosuggestions in eshell.]]. - [[https://github.com/emacs-jp/dmacro][GitHub - emacs-jp/dmacro: Repeated detection and execution of key operationw]]. - [[https://github.com/gexplorer/simple-modeline][GitHub - gexplorer/simple-modeline: A simple mode-line for Emacs.]]. - [[https://github.com/joaotavora/eglot][GitHub - joaotavora/eglot: A client for Language Server Protocol servers]]. - [[https://github.com/mmontone/template-overlays][GitHub - mmontone/template-overlays: Emacs overlays for template files]]. - [[https://github.com/p3r7/space-theming][GitHub - p3r7/space-theming: A port of Spacemacs theming layer to vanilla Emacs]]. - [[https://github.com/politza/pdf-tools][GitHub - politza/pdf-tools: Emacs support library for PDF files.]]. - [[https://github.com/rougier/elegant-emacs][GitHub - rougier/elegant-emacs: A very minimal but elegant emacs (I think)]]. - [[https://github.com/sebastiencs/company-box][GitHub - sebastiencs/company-box: A company front-end with icons]]. - [[https://github.com/takaxp/moom][GitHub - takaxp/moom: A Moom port to Emacs - Make your dominant hand FREE from your mouse (easily move frames)]]. - [[https://github.com/wbolster/emacs-direnv][GitHub - wbolster/emacs-direnv: direnv integration for emacs]]. - [[https://github.com/xuchunyang/another-emacs-server][GitHub - xuchunyang/another-emacs-server: An Emacs server built on HTTP and JSON]]. - [[https://github.com/yyoncho/dap-mode/][GitHub - yyoncho/dap-mode: Debug Adapter Protocol for Emacs (Java/Python)]]. - [[https://github.com/zk-phi/electric-case][GitHub - zk-phi/electric-case: automatic foo-bar to fooBar and foo_bar]]. - [[https://github.com/stapelberg/configfiles/blob/master/.github/workflows/emacs.yml][Github continuous integration for your Emacs init (yml config)]]. - [[https://github.com/rememberYou/.emacs.d/blob/b00402c2b51d0435ca8b0267ef71f5fa3558d41a/config.org#gnuplot][gnuplot Emacs config]]. - [[https://github.com/benma/go-dlv.el][Go Delve - Debug Go programs interactively with the GUD]]. - [[https://www.bytedude.com/gpg-in-emacs/][GPG In Emacs | Bytedude]]. - [[http://doc.rix.si/org/fsem.html][Hardcore Freestyle Emacs]]. - [[https://github.com/bbatsov/projectile][Helm Projectile]]: Is awesome for finding files in emacs. - [[https://www.emacswiki.org/emacs/HelpPlus][Help Plus: Enhancing Emacs help functions]]. - [[https://github.com/jekor/hidepw][hidepw - an Emacs minor mode for hiding passwords]]. - [[https://hotair.tech/blog/goodbye-vscode][Hot Air - Goodbye VSCode, Hello Emacs (Again) has handy JavaScript tips]]. - [[https://www.reddit.com/r/emacs/comments/efsg0t/how_i_enqueue_online_videos_in_mpv_with_emacs/][How I enqueue online videos in mpv with Emacs : emacs]]. - [[https://www.reddit.com/r/emacs/comments/f3ed3r/how_is_doom_emacs_so_damn_fast/][How is Doom Emacs so damn fast? : emacs]]. - [[https://github.com/hlissner/doom-emacs/wiki/FAQ#how-is-dooms-startup-so-fast][How is Doom’s startup so fast?]] - [[http://blog.yitang.uk/2015/09/24/how-to-create-a-screencast-gif-in-emacs/][How to Create a Screencast GIF in Emacs]]. - [[https://nullprogram.com/blog/2013/02/06/][How to Make an Emacs Minor Mode]]. - [[https://yoo2080.wordpress.com/2011/12/01/how-to-run-a-new-instance-of-emacs-from-within-emacs-2/][How to run a new instance of emacs from within emacs | Yoo Box]]. - [[https://sixty-north.com/blog/series/how-to-write-company-mode-backends.html][How to write company-mode backends]]. - [[http://tim.hibal.org/blog/how-we-wrote-a-textbook][How We Wrote a Textbook & (Tim Wheeler)]]. - [[http://www.howardism.org/Technical/Emacs/piper-presentation-transcript.html][Howard Abrams's Death to the Shell presentation]]. - [[https://github.com/howardabrams/dot-files/blob/master/emacs-eshell.org][Howard Abrams's eshell config]]. - [[https://github.com/chrisbarrett/swift-mode][hrisbarrett/swift-mode]]. - [[https://github.com/iamleeg/swift-mode][iamleeg/swift-mode]]. - [[https://vxlabs.com/2019/08/25/format-flowed-with-long-lines/][Improve the plaintext email experience through format=flowed with long lines. - vxlabs (mu4e)]]. - [[https://github.com/mkcms/interactive-align][interactive-align: Interactively align by regular expression in emacs]]. - [[http://skybert.net/emacs/investigating-emacs-cpu-usage/][investigating Emacs CPU usage]]. - [[http://ivanmalison.github.io/dotfiles/#go][Ivan Malison's Go config ]]. - [[https://www.reddit.com/r/emacs/comments/57fnar/ivy_completion_at_point_in_an_overlay/][Ivy completion at point in an overlay : emacs]]. - [[https://writequit.org/denver-emacs/presentations/2017-04-11-ivy.html][Ivy, Counsel and Swiper (writequit.org)]]. - [[https://github.com/Yevgnen/ivy-rich/][ivy-rich: An ivy wrapper providing additional customizations ]]. - [[https://github.com/squiter/ivy-youtube][ivy-youtube: Search for an Youtube video inside Emacs with Ivy]]. - [[https://github.com/skeeto/javadoc-lookup][javadoc-lookup]]. - [[http://blog.binchen.org/posts/javascript-code-navigation-in-counsel-etags.html][Javascript code navigation in counsel-etags (Chen's blog)]]. - [[http://truongtx.me/2014/02/23/set-up-javascript-development-environment-in-emacs/][Javascript development environment]]. - [[https://github.com/jcs-elpa/parse-it][jcs-elpa/parse-it: Basic Parser in Emacs Lisp (Swift and ObjC included)]]. - [[http://www.xiangji.me/][JI Xiang]]. - [[https://gitlab.com/jjzmajic/handle][jjzmajic / handle: A handle for major-mode generic functions.]]. - [[https://hackr.io/tutorials/learn-emacs][Learn Emacs - 2019 Most Recommended Emacs Tutorials | Hackr.io]]. - [[https://github.com/rememberYou/.emacs.d/blob/b00402c2b51d0435ca8b0267ef71f5fa3558d41a/config.org#ledger][Ledger Emacs config]]. - [[http://www.lunaryorn.com/][Lunarsite]]. - [[https://spin.atomicobject.com/2019/12/12/fixing-emacs-macos-catalina/][macOS Catalina: Fixing Emacs After an Upgrade]]. - [[https://magit.vc/manual/magit/Wip-Modes.html][Magit User Manual: Wip Modes]]. - [[https://github.com/legoscia/messages-are-flowing][Make it easier to send "flowed" email messages from Emacs (mu4e)]]. - [[http://www.lunaryorn.com/posts/make-your-emacs-mode-line-more-useful.html][Make your Emacs Mode Line more useful - Sebastian Wiesner]]. - [[http://zeekat.nl/articles/making-emacs-work-for-me.html][Making Emacs work for me]]. - [[https://ebzzry.io/en/emacs-dired/][Managing Directories with Emacs (dired)]]. - [[http://mbork.pl/2019-03-18_Free_Emacs_key_bindings][Marcin Borkowski: 2019-03-18 Free Emacs key bindings]]. - [[http://mbork.pl/2019-07-08_Pausing_an_Emacs_keyboard_macro][Marcin Borkowski: 2019-07-08 Pausing an Emacs keyboard macro]]. - [[http://mbork.pl/2015-07-04_C-x_4_bindings][Marcin Borkowski: C-x 4 bindings]]. - [[https://github.com/elpa-host/marquee-header][Marquee header (scrolling text header/notification)]]. - [[http://www.masteringemacs.org][Mastering Emacs]]. - [[https://github.com/mopemope/meghanada-emacs][Meghanada-Mode: A Better Java Development Environment for Emacs]]. - [[https://lars.ingebrigtsen.no/2017/10/15/meme-x-giffy/][meme x giffy – Random Thoughts]]. - [[https://two-wrongs.com/migrating-away-from-use-package.html][Migrating Away From Use-Package]]. - [[http://truongtx.me/2013/03/10/emacs-setting-up-perfect-environment-for-cc-programming][More emacs C++ goodness]]: More emacs dev environment tips. - [[https://groups.google.com/forum/m/#!topic/mu-discuss/JqHEGycEyKI][mu4e & xwidget / webkit snippet]]. - [[http://www.macs.hw.ac.uk/~rs46/posts/2014-11-16-mu4e-signatures.html][Multiple Email Signatures with mu4e]]. - [[https://www.reddit.com/r/emacs/comments/e79l6c/my_companyposframe_configuration_displaying/][My company-posframe configuration displaying backend names]]. - [[http://www.lunaryorn.com/2015/01/06/my-emacs-configuration-with-use-package.html][My Emacs Configuration with use-package]]. - [[https://gridsome.netlify.com/blog/2018/11/18/my-emacs-development-workflow/][My emacs development workflow]]. - [[http://www.pygopar.com/my-java-android-and-eclim-setup/][My Java, Android and Eclim Setup]]. - [[https://admiralakber.github.io/2018/09/20/myos-email/][myOS / email - Building the perfect email setup (Emacs/notmuch/mbsync)]]. - [[https://joelmccracken.github.io/entries/name-emacs-daemons-with-the-daemon-equals-option/][Name Emacs Daemons With the '--daemon=' Option]]. - [[https://github.com/DamienCassou/navigel][navigel: Emacs library to facilitate the creation of tabulated-list based UIs]]. - [[http://bbbscarter.wordpress.com/category/coding/emacs/][Nerdgasms's Emacs tips]]. - [[https://github.com/codesuki/bazel-mode][Neri Marschik's bazel-mode: Basic Bazel support for Emacs]]. - [[http://was.tl/projects/nimble/][Nimble (markdown replacement)]]. - [[http://angelic-sedition.github.io/][Nocturnal Artifice]]. - [[https://github.com/danielmartin/ns-playgrounds][ns-playgrounds: Execute Swift and Objective C code snippets in Emacs (Extended org babel support)]]. - [[https://sam217pa.github.io/2016/09/11/nuclear-power-editing-via-ivy-and-ag/][Nuclear weapon multi-editing via Ivy and Ag · Samuel Barreto]]. - [[http://renard.github.io/o-blog-v2/][o-blog]]. - [[https://github.com/al-skobelev/objc-yassnippets/tree/master/objc-mode][Objective-C snippets #1]]. - [[https://github.com/altschuler/yas-objc][Objective-C snippets #2]]. - [[https://github.com/al-skobelev/objc-yassnippets][Objective-C snippets #3]]. - [[https://github.com/bodil/ohai-emacs][Ohai Emacs]]. - [[https://gitlab.liu.se/davby02/olc][olc: Open Location Code support for Emacs]]. - [[http://oremacs.com/][Or Emacs]]. - [[https://karl-voit.at/orgmode/][Organize Your Life With Org-Mode]]. - [[https://www.reddit.com/r/emacs/comments/c0bg27/outlookstyle_html_replies_with_mu4e/][Outlook-style HTML replies with mu4e]]. - [[https://patrickskiba.com/unix/tools/2019/09/18/password-management-with-pass.html][Password Management with Pass and Emacs (Patrick Skiba)]]. - [[https://peach-melpa.org/][PeachMelpa (Browse Emacs themes from MELPA)]]. - [[https://stuff.mit.edu/iap/2007/emacs/emacs-slides-1.pdf][Phil Sung's Emacs slides]]. - [[http://www.philandstuff.com/][Philip Potter Emacs blog]]. - [[https://github.com/jcaw/porthole][Porthole: RPC servers for Emacs]]. - [[https://yiufung.net/post/anki-org/][Power up Anki with Emacs, Org mode, anki-editor and more]]. - [[https://github.com/bbatsov/prelude][Prelude emacs distribution]]. - [[https://github.com/raxod502/prescient.el/blob/master/README.md][prescient.el: simple but effective sorting and filtering for Emacs (ivy and company).]]. - [[http://www.howardism.org/Technical/Emacs/eshell-present.html][Presenting the Eshell]]. - [[https://www.projectile.mx/en/latest/projects/][Projects - Projectile: The Project Interaction Library for Emacs]]. - [[http://punchagan.muse-amuse.in/posts/index.html][Punchagan's blog]]. - [[https://github.com/purcell/emacs.d/blob/4c81c50ba77d165df8008dd5905f8c49102793d4/lisp/init-site-lisp.el#L7-L22][Purcell's way to add downloaded repos to load-path]]. - [[http://justinhj.github.io/2018/10/24/radix-trees-dash-and-company-mode.html][Radix trees, Dash and Company mode]]. - [[https://github.com/syl20bnr/spacemacs/blob/master/layers/%2Bframeworks/react/README.org][React contribution layer for Spacemacs]]. - [[http://emacslife.com/how-to-read-emacs-lisp.html][Read Lisp, Tweak Emacs: How to read Emacs Lisp so that you can customize Emacs]]. - [[http://draketo.de/light/english/free-software/read-your-python-module-documentation-emacs][Read your python module documentation from Emacs]]. - [[http://pragmaticemacs.com/category/elfeed/][Read your RSS feeds in emacs with elfeed]]. - [[https://github.com/purcell/reformatter.el/blob/master/README.md][reformatter.el: Define commands which run reformatters on the current Emacs buffer]]. - [[https://emacsredux.com/blog/2013/09/25/removing-key-bindings-from-minor-mode-keymaps/][Removing/Altering Key Bindings from Minor Mode Keymaps · Emacs Redux]]. - [[https://github.com/brown/bazel-mode][Robert Brown's bazel-mode: GNU Emacs mode for editing Bazel BUILD files]]. - [[https://github.com/rougier/svg-lib][rougier/svg-lib: Emacs SVG libraries for creatings tags, icons and bars]]. - [[https://github.com/Andersbakken/rtags/commit/ad3026cdd1d6c1e0a2728fb4992addcb76605487][rtags: Implement 'rename with multiple cursors']]. - [[http://rubikitch.com/][Rubikitch]]. - [[http://sachachua.com][Sachua Chua]]. - [[http://sakito.jp/emacs/emacsobjectivec.html][Sakito's Emacs Objective-C]]. - [[http://lahtela.me/blog/2020/05/21/setting-up-emacs-for-qt-development.html][Setting up Emacs for Qt (C++) development - LSP]]. - [[https://lars.ingebrigtsen.no/2019/08/26/setting-up-gpg-for-emacs/][Setting up GPG for Emacs (Random Thoughts)]]. - [[https://superuser.com/questions/432160/slow-tramp-mode-in-emacs][Slow TRAMP mode in Emacs (Super User)]]. - [[https://ebzzry.io/en/emacs-pairs/][Smartparens: Emacs and Pairs article]]. - [[http://stackoverflow.com/questions/673554/how-can-i-refactor-c-source-code-using-emacs][SO: How can I refactor C++ source code using emacs?]]. - [[http://psung.blogspot.co.uk/2010/03/some-emacs-macro-tricks.html][Some Emacs macro tricks]]. - [[https://www.baty.net/2019/spaceline-for-emacs/][Spaceline for Emacs (Jack Baty's weblog)]]. - [[https://www.draketo.de/english/emacs/staying-sane-drudge-work][Staying sane with Emacs (when facing drudge work) (Zwillingssterns Weltenwald)]]. - [[https://vxlabs.com/2016/04/11/step-by-step-guide-to-c-navigation-and-completion-with-emacs-and-the-clang-based-rtags/][Step-by-step guide to C++ navigation and completion with Emacs and the Clang-based rtags]]. - [[https://www.reddit.com/r/emacs/comments/370k9p/stock_emacs_tips/][Stock Emacs tips (Reddit)]]. - [[http://pragmaticemacs.com/emacs/super-spotlight-search-with-counsel/][Super spotlight search with ivy/counsel (Pragmatic Emacs)]]. - [[https://github.com/danielmartin/swift-helpful][swift-helpful: A Self-Documenting Emacs Programming Environment for Swift]]. - [[https://www.wisdomandwonder.com/article/10474/techne-emacs-friendly-keyboard-operations-keys][Techne (Emacs Friendly Keyboard): Operations Keys | Wisdom and Wonder]]. - [[http://www.wilfred.me.uk/blog/2018/01/06/the-emacs-guru-guide-to-key-bindings/][The Emacs Guru Guide to Key Bindings – Wilfred Hughes::Blog]]. - [[https://github.com/alphapapa/emacs-package-dev-handbook][The Emacs Package Developer's Handbook]]. - [[http://batsov.com/articles/2011/11/30/the-ultimate-collection-of-emacs-resources/][The Ultimate Collection of Emacs Resources]]. - [[https://github.com/thierryvolpiatto/emacs-tv-config/blob/master/mu4e-config.el][thierryvolpiatto's mu4e config ]]. - [[https://github.com/ananthakumaran/tide][Tide: TypeScript Interactive Development Environment for Emacs]]. - [[https://www.reddit.com/r/emacs/comments/audffp/tip_how_to_use_a_stable_and_fast_environment_to/][TIP: How to use a stable and fast environment to develop in C++ : emacs]]. - [[https://emacs.stackexchange.com/questions/16489/tramp-is-unbearably-slow-osx-ssh][TRAMP is unbearably slow (OSX, ssh) - Emacs Stack Exchange]]. - [[https://stackoverflow.com/a/16408592][Tramp: Open file via SSH and Sudo with Emacs - Stack Overflow]]. - [[http://truongtx.me/categories.html#emacs-ref][Trần Xuân Trường's Emacs posts]]. - [[https://github.com/MetroWind/dotfiles-mac/blob/6c5af32349edb2764876ed6c1392fe5fc5a6f6ca/emacs/files/.emacs-pkgs/tsmanip.el][tsmanip.el manipulate timestamps/dates anywhere like org shift up/down]]. - [[http://tuhdo.github.io/c-ide.html][Tuhdo's C/C++ dev on Emacs]]. - [[https://tuhdo.github.io/emacs-tutor3.html][Tuhdo's Emacs Mini Manual (PART 3) - CUSTOMIZING AND EXTENDING EMACS]]. - [[https://www.reddit.com/r/emacs/comments/hztv4a/tutorial_for_building_gccemacs_on_macos_catalina/][Tutorial for building gccemacs on MacOS catalina]]. - [[http://tv.uvigo.es/gl/serial/513.html][Universidad de Vigo's Emacs course]]. - [[https://karl-voit.at/2018/07/08/emacs-key-bindings/][UOMF: My Emacs Key Binding Strategy]]. - [[https://www.johndcook.com/blog/2018/01/27/emacs-features-that-use-regular-expressions/][Uses of regular expressions in Emacs (John D. Cook)]]. - [[https://www.johndcook.com/blog/2018/01/27/emacs-features-that-use-regular-expressions/][Uses of regular expressions in Emacs]]. - [[http://dance.computer.dance/posts/2015/04/using-ctags-on-modern-javascript.html][Using ctags on modern Javascript (handy for Emacs)]]. - [[http://www.pygopar.com/using-emacs-and-eclim-for-android-development/][Using Emacs and Eclim for Android Development]]. - [[https://lispcookbook.github.io/cl-cookbook/emacs-ide.html][Using Emacs as an IDE (The Common Lisp Cookbook)]]. - [[https://www.reddit.com/r/emacs/comments/fojc1y/using_viewmode_for_modal_navigation/][Using view-mode for modal navigation : emacs]]. - [[https://github.com/DamienCassou/vdirel][vdirel vdir (calendars and contacts) for Emacs]]. - [[https://vedang.me/tinylog/emacs-28-native-comp-ubuntu-20-04/][Vedang Manerikar | Compiling and Running Emacs 28 from the native-comp]]. - [[http://pragmaticemacs.com/emacs/view-and-annotate-pdfs-in-emacs-with-pdf-tools/][View and annotate PDFs in Emacs with PDF-tools (Pragmatic Emacs)]]. - [[https://www.reddit.com/r/emacs/comments/eeyhdz/weekly_tipstricketc_thread/][Weekly tips/trick/etc/ thread : multiple-cursors-mode using helm/counsel]]. - [[http://emacs.stackexchange.com/questions/2571/what-emacs-communities-exist][What Emacs communities exist?]] - [[http://whattheemacsd.com/][What the Emacsd]]. - [[https://github.com/yanghaoxie/which-key-posframe][which-key-posframe: Let emacs-which-key use posframe to show its popup.]]. - [[http://wikemacs.org/wiki/TRAMP][WikEmacs - TRAMP]]. - [[http://www.wisdomandwonder.com/][Wisdom and Wonder]]. - [[https://emacs.stackexchange.com/questions/22306/working-with-tramp-mode-on-slow-connection-emacs-does-network-trip-when-i-start/22307][Working with tramp mode on slow connection]]. - [[https://github.com/company-mode/company-mode/wiki/Writing-backends][Writing company backends]]. - [[https://joaotavora.github.io/yasnippet/snippet-development.html][Writing yasnippets]]. - [[http://ergoemacs.org/emacs/emacs_list_and_set_font.html][Xah Lee's Emacs: Set Font]]. - [[http://www.xref.sk/xrefactory/main.html][Xrefactory: A C/C++ Refactoring Browser for Emacs and XEmacs]]. - [[https://github.com/Kungsgeten/yankpad][yankpad: Paste yasnippets from an org-mode file]]. - [[https://github.com/zegal/yasobjc][Yasnippet generator for Cocoa iphone SDK]]. - [[https://github.com/zk-phi/git-complete][Yet another completion engine powered by git grep]]. - [[https://plomlompom.com/guides/emacs.html][Yet another introduction to Emacs]]. - [[http://emacs.readthedocs.io/en/latest/][Yi Tang's road to emacs documentation on readthedocs.io]]. - [[https://github.com/yurikhan/yk-color][yk-color: Elisp library for linear RGB color manipulation]]. - [[https://yoo2080.wordpress.com/category/emacs/][Yoo Box's Emacs category]]. - [[http://ericscrosson.wordpress.com][Zen in the Art of Emacs]]. - [[http://akrl.sdf.org/][‎The Emacs Garbage Collection Magic Hack]]. * [2014-09-11 Thu] Resetting gnome-terminal preferences :PROPERTIES: :CUSTOM_ID: resetting-gnome-terminal-preferences :END: ** Resetting preferences #+BEGIN_SRC sh gconftool --recursive-unset /apps/gnome-terminal #+END_SRC ** Want 256 colors? Edit .bash_profile #+BEGIN_SRC sh export TERM="screen-256color" #+END_SRC ** Ensure .bash_profile is loaded From gnome-terminal window: #+BEGIN_QUOTE gnome-terminal Edit Profiles... Edit Title and Command X Run command as login shell #+END_QUOTE ** Solarized Bonus: See [[http://codefork.com/blog/index.php/2011/11/27/getting-the-solarized-theme-to-work-in-emacs][post]] to get solarized on gnome-terminal. * [2014-10-09 Thu] C++ bookmarks :PROPERTIES: :CUSTOM_ID: cpp-bookmarks :END: :MODIFIED: [2023-05-05 Fri] :END: - [[http://nickdesaulniers.github.io/blog/2015/07/23/additional-c-slash-c-plus-plus-tooling/][Additional C/C++ Tooling]]. - [[https://leanpub.com/cppbestpractices/c/release_799][C++ Best Practices]]. - [[https://github.com/isocpp/CppCoreGuidelines][C++ Core Guidelines]]. - [[http://cppreference.com][cppreference.com]]. - [[https://github.com/romkatv/gitstatus/blob/master/docs/listdir.md][Fast directory listing]]. - [[https://github.com/Dobiasd/FunctionalPlus][FunctionalPlus: helps you write concise and readable C++ code]]. - [[https://github.com/mozilla/rr][GitHub - mozilla/rr: Record and Replay Framework (debugging)]]. - [[https://news.ycombinator.com/item?id=24361469][Modern C | Hacker News]]. - [[http://www.murrayc.com/permalink/2015/12/05/modern-c-variadic-template-parameters-and-tuples/][Modern C++: Variadic template parameters and tuples]]. - [[https://news.ycombinator.com/item?id=35758898][My favorite C compiler flags during development | Hacker News]]. - [[http://www.artima.com/cppsource/top_cpp_aha_moments.html][My Most Important C++ Aha! Moments...Ever]]. - [[http://www.amazon.co.uk/Programming-Principles-Practice-Using-C/dp/0321992784][Programming: Principles and Practice Using C++ Paperback]]. - [[https://samthursfield.wordpress.com/2015/10/20/some-cmake-tips/][Some CMake tips]]. - [[http://vitiy.info/Slides/MeetingCPP2015/MeetingCPP2015Complexity.pdf][The ways to avoid complexity in modern C++]]. * [2014-07-14 Mon] Java bookmarks :PROPERTIES: :CUSTOM_ID: java-bookmarks :END: :MODIFIED: [2015-11-16 Mon] :END: - [[https://github.com/cxxr/better-java][Better Java]]. - [[http://www.nurkiewicz.com/2014/11/executorservice-10-tips-and-tricks.html?m=1][ExecutorService - 10 tips and tricks]]. - [[http://www.odi.ch/prog/design/newbies.php#21][Java anti-patterns]]. - [[http://www.angelikalanger.com/GenericsFAQ/JavaGenericsFAQ.html][Java Generics FAQs]]. - [[https://code.google.com/p/lanterna/][Lanterna]], a text GUI (a la ncurses) written in Java. - [[https://github.com/winterbe/java8-tutorial][Modern Java - A Guide to Java 8]]. * [2014-07-14 Mon] Browser bookmarks :PROPERTIES: :CUSTOM_ID: browser-bookmarks :END: :MODIFIED: [2020-05-28 Thu] :END: - [[http://www.dillo.org][Dillo]]. - [[https://fingers.today/tech/firefox-app-mode][Firefox: no window borders or other decoration]]. - [[http://www.netsurf-browser.org/][NetSurf]]. - [[https://addons.mozilla.org/en-US/firefox/addon/single-file/][SingleFile | Save a page as a single HTML file]]. * [2014-07-14 Mon] Node bookmarks :PROPERTIES: :CUSTOM_ID: node-bookmarks :END: - [[http://blog.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/][How to use npm as a Build Tool]]. * [2014-07-14 Mon] JavaScript bookmarks :PROPERTIES: :CUSTOM_ID: javascript-bookmarks :END: :MODIFIED: [2019-12-02 Mon] :END: - [[https://medium.com/@serbanmihai/javascript-es6-cheatsheet-map-weakmap-1339b7b80c13][#javascript ES6 cheatsheet — Map & WeakMap – Mihai Serban – Medium]]. - [[https://github.com/ivopetkov/responsively-lazy][A better way to lazy load responsive images]]. - [[https://news.ycombinator.com/item?id=9822975][Airbnb JavaScript Style Guide]]. - [[http://rrees.me/2015/06/04/overview-of-javascript-reactive-frameworks/][An overview of JavaScript reactive frameworks]]. - [[https://babeljs.io/][Babel Javascript compiler]]. - [[http://www.helloerik.com/the-subtle-magic-behind-why-the-bootstrap-3-grid-works][Bootstrap 3 grid]]. - [[https://developers.google.com/web/tools/chrome-devtools][Chrome DevTools]]. - [[https://slides.com/concise/js/fullscreen#/][Concise JavaScript intro]]. - [[https://github.com/cure53/DOMPurify][DOMPurify: a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG]]. - [[http://esprima.org/][ECMAScript parsing infrastructure for multipurpose analysis]]. - [[http://eloquentjavascript.net][Eloquent JavaScript (Book)]]. - [[https://news.ycombinator.com/item?id%3D10638113][ES6 Overview in Bullet Points (Hacker News)]]. - [[https://github.com/bevacqua/es6][ES6 Overview in Bullet Points]]. - [[https://github.com/DrkSephy/es6-cheatsheet][ES6-cheatsheet]]. - [[https://github.com/ericelliott/essential-javascript-links][Essential JavaScript Links]]. - [[https://changelog.com/essential-reading-list-for-getting-started-with-service-workers/][Essential Reading List for Getting Started With Service Workers]]. - [[http://exploringjs.com/][Exploring ES6: Upgrade to the next version of JavaScript (Book)]]. - [[http://famous.org/][Famous Javascript library for animations & interfaces]]. - [[http://yoksel.github.io/flex-cheatsheet/][Flexbox Cheatsheet]]. - [[http://www.frontendhandbook.com/][Front-End Developer Handbook]]. - [[https://dev.to/leandrotk_/functional-programming-principles-in-javascript-26g7][Functional Programming Principles in Javascript - DEV Community]]. - [[http://www.sencha.com/blog/hidden-gems-in-chrome-developer-tools/][Hidden gems in Chrome Developer Tools]]. - [[http://robotlolita.me/2015/11/15/how-do-promises-work.html][How do promises work]]. - [[http://facebook.github.io/immutable-js/][Immutable collections for JavaScript]]. - [[http://www.pocketjavascript.com/blog/2015/11/23/introducing-pokedex-org][Introducing Pokedex.org: a progressive webapp for Pokémon fans]]. - [[https://blog.famous.org/introducing-the-famous-framework/][Introducing the Famous framework]]. - [[https://dev.to/banesag/javascript-data-structures-part-1-4eb5][JavaScript: Data Structures (Part 1) - DEV Community]]. - [[http://xahlee.info/js/javascript_iterator.html][JavaScript: Iterator (ES2015)]]. - [[https://js.coach][js.coach (Opinionated catalog of open source JS packages)]]. - [[https://github.com/facebook/jscodeshift][jscodeshift, a toolkit for running codemods over multiple JS files]]. - [[http://jscs.info/][JSCS linter]]. - [[https://developer.mozilla.org/en-US/Learn][Learning the Web (mozilla.org)]]. - [[http://www.nateberkopec.com/2015/10/07/frontend-performance-chrome-timeline.html][Ludicrously Fast Page Loads - A Guide for Full-Stack Devs]]. - [[http://www.mancy-re.pl/][Mancy: JavaScript REPL application based on Electron and React]]. - [[http://www.larryullman.com/books/modern-javascript-develop-and-design/table-of-contents/][Modern JavaScript: Develop and Design (book)]]. - [[http://courses.angularclass.com/courses/modern-javascript][Modern Javascript: ​Learning the foundational concepts and build tools for modern web applications]]. - [[https://medium.com/javascript-scene/must-see-javascript-dev-tools-that-put-other-dev-tools-to-shame-aca6d3e3d925#.bcntoj3kq][Must See JavaScript Dev Tools That Put Other Dev Tools to Shame]]. - [[http://mrale.ph/blog/2014/07/30/constructor-vs-objectcreate.html][new vs Object.create]]. - [[https://medium.com/@goatslacker/no-you-dont-need-semicolons-148d936b9cf2#.s5839x3mt][No, you don’t need semicolons (Medium)]]. - [[https://github.com/uber/npm-shrinkwrap][npm-shrinkwrap]]. - [[https://www.pagedmedia.org/paged-js/][Paged.js – Paged Media (book/blog publishing)]]. - [[https://github.com/arscan/pleaserotate.js][pleaserotate.js]] - [[http://pathgather.github.io/please-wait/][PleaseWait.js]] - [[https://dev.to/kozakrisz/react---es6-tricks-in-classes-33je][React - ES6 tricks in Classes - DEV Community]]. - [[https://egghead.io/lessons/javascript-redux-the-single-immutable-state-tree][Redux: The Single Immutable State Tree]]. - [[https://www.youtube.com/watch?v=3LKMwkuK0ZE&feature=youtu.be][RxJS 5 Thinking Reactively | Ben Lesh - YouTube]]. - [[https://medium.com/@benlesh/rxjs-observable-interop-with-promises-and-async-await-bebb05306875][RxJS Observable interop with Promises and Async-Await]]. - [[https://news.ycombinator.com/item?id=13031492][Show HN: A visual guide to the most popular CSS properties (Hacker News)]]. - [[https://news.ycombinator.com/item?id=12954540][Show HN: JavaScript books, free online (Hacker News)]]. - [[http://snapsvg.io/][Snap.svg: the JavaScript SVG library for the modern web]]. - [[http://reactkungfu.com/2015/07/the-hitchhikers-guide-to-modern-javascript-tooling/][The Hitchhiker's Guide to Modern JavaScript Tooling]]. - [[https://github.com/focusaurus/data/blob/0aa94a91181d3a85b148375d24adca4a166c4be0/posts/problog/2015/10/tools-for-cleaning-up-messy-javascript.md][Tools for cleaning up messy Javascript]]. - [[http://blog.kewah.com/2015/tools-to-keep-a-consistent-coding-style-in-javascript/][Tools to keep a consistent coding style in JavaScript]]. - [[http://jonobr1.github.io/two.js][Two.js is a two-dimensional drawing api geared towards modern web browsers]]. - [[http://vorlonjs.com/][Vorlon.JS: remotely debugging and testing your JavaScript]]. - [[http://bjorn.tipling.com/state-and-regular-expressions-in-javascript][What you should know about JavaScript regular expressions]]. - [[http://blog.keithcirkel.co.uk/why-we-should-stop-using-grunt/][Why we should stop using Grunt & Gulp]]. - [[http://xahlee.info/js/js.html][Xah Lee's JavaScript in Depth]]. * [2014-07-14 Mon] HTML5 bookmarks :PROPERTIES: :CUSTOM_ID: html5-bookmarks :END: :MODIFIED: [2021-06-27 Sun] :END: - [[https://hacks.mozilla.org/2016/08/a-few-html-tips/][A few HTML tips (Mozilla)]]. - [[https://github.com/lyoshenka/awesome-motherfucking-website][awesome-motherfucking-website: An awesome list of websites about minimal web design and copious swearing]]. - [[http://bettermotherfuckingwebsite.com/][Better Motherfucking Website]]. - [[http://mo.github.io/2015/10/19/chrome-devtools.html][Chrome Devtools Tips & Tricks]]. - [[https://news.ycombinator.com/item?id=10416062][Chrome Devtools Tips and Tricks (Hacker News)]]. - [[http://blog.chromium.org/2014/06/web-fundamentals-and-web-starter-kit.html][Chromium's web fundamentals and Web Starter Kit]]. - [[https://developer.mozilla.org/en-US/docs/Web/CSS/Layout_cookbook][CSS Layout cookbook - CSS: Cascading Style Sheets (MDN)]]. - [[https://www.pandastrike.com/posts/20151015-rest-vs-relay][Facebook Relay: An Evil And/Or Incompetent Attack On REST]]. - [[https://htmlhead.dev/][HEAD - A free guide to elements]]. - [[https://news.ycombinator.com/item?id=21119553][HEAD – A guide to elements (Hacker News)]]. - [[http://blog.ustunozgur.com/javascript/programming/books/videos/2015/06/17/how_to_be_a_great_javascript_software_developer.html][How to Become a Great JavaScript Developer]]. - [[http://www.fse.guru/how-to-pick-a-frontend-web-framework][How To Pick a Frontend Web Framework]]. - [[https://markodenic.com/html-tips/][HTML Tips (2020) - Marko Denic - Web Developer]]. - [[https://developer.mozilla.org/en-US/Learn][Learning the Web (mozilla.org)]]. - [[https://motherfuckingwebsite.com/][Motherfucking Website]]. - [[https://news.ycombinator.com/item?id=26952557][My Current HTML Boilerplate | Hacker News]]. - [[https://perfectmotherfuckingwebsite.com/][Perfect Motherfucking Website]]. - [[https://philipwalton.github.io/solved-by-flexbox/][Solved by Flexbox]]. - [[https://thebestmotherfucking.website/][The Best Motherfucking Website]]. - [[https://ultimatemotherfuckingwebsite.com/][Ultimate Motherfucking Website]]. - [[http://wave.webaim.org/report#/][WAVE Report (web accessiblity evaluation tool)]]. - [[https://jgthms.com/web-design-in-4-minutes][Web Design in 4 minutes]]. - [[https://gist.github.com/paulirish/5d52fb081b3570c81e3a][What forces a layout / reflow]]. - [[https://medium.com/yemeksepeti-teknoloji/what-ive-learned-from-working-with-html5-video-over-a-month-485c5d5c2045][What I’ve Learned From Working With HTML5 Video Over A Month]]. - [[https://bradleytaunt.com/2019/06/08/html-like-1999][Write HTML Like It's 1999]]. * [2014-07-14 Mon] Networking bookmarks :PROPERTIES: :CUSTOM_ID: networking-bookmarks :END: :MODIFIED: [2021-07-03 Sat] :END: - [[https://news.ycombinator.com/item?id=27650775][Ask HN: Good books/courses to learn networking essentials for web development]]. - [[http://cr.yp.to/djbdns/tools.html][Command-line tools to look up DNS information]]. - [[https://news.ycombinator.com/item?id=21794270][Stanford CS 144: Introduction to Computer Networking | Hacker News]]. * [2014-07-13 Sun] Python bookmarks :PROPERTIES: :CUSTOM_ID: python-bookmarks :END: :MODIFIED: [2019-08-12 Mon] :END: - [[https://docs.python.org/3/tutorial/venv.html][12. Virtual Environments and Packages — Python 3.7.4 documentation (pipenv)]]. - [[https://github.com/mkaz/termgraph][A python command-line tool which draws basic graphs/charts in the terminal]]. - [[http://mkaz.com/2014/07/26/python-argparse-cookbook/][Argparse cookbook]]: For simple python scripts. - [[https://linuxhint.com/best_50_python_books/][Best 50 Python Books for Programmers with All Skill Sets]]. - [[http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html][Code Like a Pythonista: Idiomatic Python]]. - [[https://github.com/pudo/dataset][Dataset: databases for lazy people]]. - [[http://www.diveintopython3.net/][Dive Into Python 3 book]]. - [[http://www.diveintopython.net/][Dive Into Python book]]. - [[https://github.com/asciimoo/drawille/][Drawille]]: Python drawing in ascii/unicode braille characters. - [[https://pandas.pydata.org/pandas-docs/stable/user_guide/visualization.html][Pandas visualization]]. - [[https://www.python.org/dev/peps/pep-0020/][PEP 20 -- The Zen of Python]]. - [[https://pypi.python.org/pypi/pudb][Pudb]]: A tui python debugger. - [[http://pycoders.com/][Pycoders weekly mailing list]]. - [[https://books.google.co.uk/books?id=9_AXCmGDiz8C&hl=en&redir_esc=y][Python Algorithms book]]. - [[https://news.ycombinator.com/item?id=11240729][Python patterns, Take One (Hacker News)]]. - [[https://taoofmac.com/space/blog/2013/08/11/2300][Python patterns, Take One]]. - [[https://www.airpair.com/python/posts/python-tips-and-traps][Python Tips and Traps]]. - [[http://irreal.org/blog/?p=3860][Python tools for Emacs]]. - [[http://tech.blog.aknin.name/tag/internals/page/2/][Python’s Innards: Hello, ceval.c!]]. - [[https://twitter.com/python_tip/status/1111349676106833920][Read Excel sheet with Python/Pandas (Twitter)]]. - [[http://www.johndcook.com/blog/python_regex/][Regular expressions in Python and Perl]]. - [[https://www.johndcook.com/blog/2019/01/24/reversing-an-md5-hash/][Reversing an MD5 hash (python)]]. - [[https://github.com/deanmalmgren/textract][Textract]]: Python util extracting text from a handful of document types. - [[https://julien.danjou.info/blog/2013/guide-python-static-class-abstract-methods][The definitive guide on how to use static, class or abstract methods in Python]]. - [[https://julien.danjou.info/books/the-hacker-guide-to-python][The Hacker's guide to python]]. - [[http://docs.quantifiedcode.com/python-anti-patterns/][The Little Book of Python Anti-Patterns]]. - [[http://blog.instavest.com/three-useful-python-libraries-for-startups][Three Useful Python Libraries for Startups]]. - [[http://effbot.org/zone/python-with-statement.htm][Understanding Python's "with" statement]]. - [[https://github.com/gorakhargosh/watchdog][Watchdog]] (monitor filesystem in python). * [2014-07-13 Sun] Development bookmarks :PROPERTIES: :CUSTOM_ID: development-bookmarks :END: :MODIFIED: [2021-09-30 Thu] :END: - [[https://www.redblobgames.com/grids/hexagons/ - [[https://news.ycombinator.com/item?id=25803288][Big O Notation – Explained as easily as possible | Hacker News]]. - [[https://dev.to/humblecoder00/comprehensive-big-o-notation-guide-in-plain-english-using-javascript-3n6m][Comprehensive Big O Notation Guide in Plain English, using Javascript]]. - [[https://justsimply.dev/][Just Simply | Stop saying how simple things are in our docs]]. - [[https://news.ycombinator.com/item?id=25698707][Show HN: DevBooks – Help Developers find indy books | Hacker News]]. - [[https://codecatalog.org/2021/09/04/well-documented-code.html][Writing Well-Documented Code - Learn from Examples - Code Catalog]]. ][Hexagonal Grids]]. - [[http://norvig.com/lispy.html][(How to Write a (Lisp) Interpreter (in Python)): parse, tokenize, read from tokens, environments, eval, and repl ]]. - [[https://amplitude.com/blog/12-signs-youre-working-in-a-feature-factory-3-years-later][12 Signs You’re Working in a Feature Factory - 3 Years Later]]. - [[http://www.exceptionnotfound.net/fundamental-laws-of-software-development/][15 Fundamental Laws of Software Development]]. - [[https://guifroes.com/2018/03/23/3-books-that-will-take-you-to-the-next-level/][3 books that will take you to the next level – Gui Froes]]. - [[https://quickleft.com/blog/8-tips-get-started-existing-codebase/][8 Tips To Get Started In An Existing Codebase]]. - [[http://sahandsaba.com/nine-anti-patterns-every-programmer-should-be-aware-of-with-examples.html][9 Anti-Patterns]]. - [[https://gist.github.com/andymatuschak/d5f0a8730ad601bcccae97e8398e25b2][A composable pattern for pure state machines with effects]]. - [[https://increment.com/programming-languages/crash-course-in-compilers/][A crash course in compilers – Increment: Programming Languages]]. - [[https://www.coursera.org/learn/algorithms-part1#syllabus][Algorithms, Part I - Princeton University (Coursera)]]. - [[http://www.cs.bsu.edu/homepages/pvg/misc/uml/][All the UML you need to know]]. - [[https://skerritt.blog/big-o/][All You Need to Know About Big O Notation {Python Examples}]]. - [[https://nicoleorchard.com/blog/compilers][An intro to compilers]]. - [[https://apprenticealf.wordpress.com/][Apprentice Alf’s Blog: Everything you ever wanted to know about DRM and ebooks]]. - [[https://news.ycombinator.com/item?id=21919465][Ask HN: How do I choose the right resource to learn CS fundamentals?]]. - [[https://news.ycombinator.com/item?id=12702651][Ask HN: What is your favorite YouTube channel for developers? (Hacker News)]]. - [[https://news.ycombinator.com/item?id=11005003][Ask HN: What's the most elegant piece of code you've seen? (Hacker News)]]. - [[https://floooh.github.io/2020/08/23/sokol-bindgen.html][Automatic Language Bindings (via clang -ast-dump)]]. - [[https://github.com/sindresorhus/awesome/blob/master/readme.md][Awesome lists of everything (Github)]]. - [[https://www.expeditedssl.com/aws-in-plain-english][AWS in plain English]]. - [[http://robertmuth.blogspot.it/2012/08/better-bash-scripting-in-15-minutes.html][Better Bash scripting in 15 Minutes]]. - [[https://wincent.com/blog/optimization][Beware of cute optimizations bearing gifts (building fuzzy search) · wincent.com]]. - [[https://dev.to/metcoder95/big-o-notation-beginners-guide-1h38][Big-O Notation: Beginners Guide - DEV Community]]. - [[https://speakerdeck.com/bbatsov/knighitie-koito-vsieki-proghramist-triabva-da-prochietie][Bozhidar Batsov's presentation (lots of great books listed)]]. - [[https://www.murrayc.com/permalink/2018/12/07/brain-refactored][Brain, refactored: lots of wonderful dev learning references (Murray's Blog)]]. - [[https://news.ycombinator.com/item?id=18821475][Bytecode compilers and interpreters (Hacker News)]]. - [[https://refactoring.com/catalog][Catalog of Refactorings]]. - [[http://arturoherrero.com/clean-code/][Clean code]]. - [[http://kevinlondon.com/2015/05/05/code-review-best-practices.html][Code review best practices]]. - [[https://dev.to/vonheikemen/code-style-rules-that-are-actually-useful-3igf][Code style rules that are actually useful (DEV Community)]]. - [[https://news.ycombinator.com/item?id=12687711][Command line interface best practices (Hacker News)]]. - [[https://news.ycombinator.com/item?id=19010492][Confessions of an Abstraction Hater (Hacker News)]]. - [[https://games.greggman.com/game/imgui-future/][Could ImGUI be the future of GUIs?]]. - [[http://www.cs.usfca.edu/~galles/visualization/Algorithms.html][Data structure visualization]]. - [[https://github.com/rxin/db-readings][Database readings]]. - [[http://mollyrocket.com/casey/stream_0028.html][Designing and evaluating reusable components]]: Talk by Casey Muratori. - [[http://doc.qt.digia.com/qq/qq13-apis.html][Designing Qt-Style C++ APIs]]. - [[https://twitter.com/ermmears/status/1118929832103034881][Diverse podcasts in @ermmears's tweet comments]]. - [[http://www.amazon.co.uk/Domain-driven-Design-Tackling-Complexity-Software/dp/0321125215/ref=sr_1_1?ie=UTF8&qid=1444472442&sr=8-1&keywords=domain+driven+design][Domain-driven design: Tackling Complexity in the Heart of Software (Book)]]. - [[https://www.youtube.com/playlist?list=PL94E35692EB9D36F3][Donald Knuth Lectures - YouTube]]. - [[http://s9w.io/font_compare][Font compare]]. - [[https://github.com/fdiskyou/Zines][GitHub - fdiskyou/Zines: hacking Zines mirror for the lulz and nostalgy]]. - [[https://github.com/kilimchoi/engineering-blogs][GitHub - kilimchoi/engineering-blogs: A curated list of engineering blogs]]. - [[https://google-styleguide.googlecode.com/svn/trunk/shell.xml][Google shell style guide]]. - [[http://hackershelf.com/browse/?popular=1][Hacker shelf: Free software dev books]]. - [[http://oedb.org/ilibrarian/hacking-knowledge/][Hacking knowlege]]. - [[https://slack.engineering/happiness-is-a-freshly-organized-codebase-7ffa6590a70d][Happiness is… a freshly organized codebase - Several People Are Coding (aka feature-driven org)]]. - [[https://azeria-labs.com/heap-exploitation-part-1-understanding-the-glibc-heap-implementation/][Heap Exploitation Part 1: Understanding the Glibc Heap Implementation | Azeria Labs]]. - [[http://blog.triplebyte.com/how-to-pass-a-programming-interview][How to pass a programming interview]]. - [[https://paragonie.com/blog/2015/09/how-to-safely-implement-cryptography-in-any-application][How to Safely Implement Cryptography Features in Any Application]]. - [[http://staff.polito.it/silvano.rivoira/HowToWriteYourOwnCompiler.htm][How to write your own compiler]]. - [[http://jeremymikkola.com/posts/2019_03_19_rules_for_autocomplete.html][Jeremy Mikkola - Rules for Autocomplete]]. - [[http://joeduffyblog.com/2016/02/07/the-error-model/][Joe Duffy - The Error Model]]. - [[https://www.libhunt.com][LibHunt - Find The Software You Need]]. - [[https://github.com/lfit/itpol/blob/master/linux-workstation-security.md][Linux workstation security checklist]]. - [[http://newartisans.com/2011/04/letter-to-the-fsf/][Lost in Technopolis]]. - [[http://robertheaton.com/2015/08/31/migrating-bajillions-of-database-records-at-stripe/][Migrating bajillions of database records at Stripe]]. - [[https://www.quora.com/How-does-Login-with-Facebook-option-work-on-third-party-websites][OAuth diagram/explanation (Quora)]]. - [[https://getpolarized.io/2019/01/08/top-pdfs-of-2018-hackernews.html][Over 500 Top PDFs posted to Hacker News in 2018]]. - [[https://news.ycombinator.com/item?id=18772873][Please do not attempt to simplify this code: favors completeness, boilerplate, and documentation in the name of stability and long term maintenance (Hacker News)]]. - Post snippets in a beautiful screenshot. - [[https://quickleft.com/blog/readme-love-quick-easy-tips/][README Love: Quick and easy tips]]. - [[http://www.amazon.co.uk/Refactoring-Improving-Design-Existing-Technology/dp/0201485672/ref=sr_1_1?ie=UTF8&qid=1444472751&sr=8-1&keywords=refactoring+improving+the+design+of+existing+code][Refactoring: Improving the design of existing code (Book)]]. - [[https://twitter.com/sarahmei/status/783340259073335296][Sarah Mei on livable coebases]]. - [[https://semver.org/][Semantic Versioning 2.0.0 (Semantic Versioning)]]. - [[https://news.ycombinator.com/item?id=24777640][Show HN: I wrote a book on writing good developer resumes | Hacker News]]. - [[https://news.ycombinator.com/item?id=22335738][Signs you’re working in a feature factory | Hacker News]]. - [[https://bourgeois.me/rest/][Some REST best practices]]. - [[http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/][Structure and Interpretation of Computer Programs]] (videos). - [[http://www.norvig.com/21-days.html][Teach Yourself Programming in Ten Years]]. - [[http://technosophos.com/2018/07/04/be-nice-and-write-stable-code.html][TechnoSophos: Be Nice And Write Stable Code (versioning scheme)]]. - [[https://github.com/jlevy/the-art-of-command-line][The art of command line]]. - [[https://news.ycombinator.com/item?id=14020796][The Debugging Mindset (Hacker News)]]. - [[http://journal.stuffwithstuff.com/2015/09/08/the-hardest-program-ive-ever-written][The Hardest Program I've Ever Written (a code formatter)]]. - [[https://speakerdeck.com/bbatsov/knighitie-koito-vsieki-proghramist-triabva-da-prochietie][The passionate programmer]]. - [[https://news.ycombinator.com/item?id=21603920][Things I’ve learned in 20 years of programming | Hacker News]]. - [[https://github.com/jbranchaud/til][TIL: today I learned]]. - [[http://robots.thoughtbot.com/a-tmux-crash-course][Tmux crash course]]: By Josh Clayton. - [[https://medium.com/@johanstn/initiating-ui-engineering-conversations-946906b4c710#.9vkrt6xzi][UI Engineering Questions]]. - [[https://news.ycombinator.com/item?id=24518682][Use long flags when scripting (2013) | Hacker News]]. - [[http://www.comp.nus.edu.sg/~stevenha/visualization/][VisuAlgo.net]]: Visualising data structures and algorithms through animation. - [[https://twitter.com/kwyntastic/status/1281639369359544322][When management tells you to build a specific thing (junior vs mid vs senior eng)]]. - [[https://wizardzines.com/][Wizard zines (programming by Julia Evans)]]. - [[https://news.ycombinator.com/item?id=19487848][WTF Is Big O Notation? (Hacker News)]]. - [[https://yourcalendricalfallacyis.com/][Your calendrical fallacy is thinking…]]. * [2014-07-13 Sun] Paswordless ssh with authorized keys :PROPERTIES: :CUSTOM_ID: passwordless-ssh-with-authorized-keys :END: ** On local host #+BEGIN_SRC sh ssh-keygen cat ~/.ssh/id_dsa.pub | ssh user@remotehost 'cat >> ~/.ssh/authorized_keys' #+END_SRC ** On remote host #+BEGIN_SRC sh chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys #+END_SRC UPDATE: [[https://stuff-things.net/2020/01/24/not-stupid-ssh-tricks-automatic-ssh-add][Add "AddKeysToAgent yes" to .ssh/config and enter password only once]]. * [2013-11-04 Mon] Some python idioms :PROPERTIES: :CUSTOM_ID: some-python-idioms :END: - Prefer double quotes if escaping single quotes. - Prefer string interpolation over join. Eg. "'%s'" % member_default. - Prefer double underscore for privates. - Prefer with statement to implicitly close file. #+BEGIN_SRC python with open(path, 'r') as text_file: text = text_file.read() #+END_SRC - Prefer list comprehensions to filter. - Prefer using separate modules over classes if only using for separation. - Keep in mind: "eafp vs lbyl" (ie. just let it throw). - Prefer exceptions over assertions. - Throw ValueError for wrong input. - Return explicit False if remaining case is always false.