Skip to content

Instantly share code, notes, and snippets.

View bltavares's full-sized avatar
💭
I may be slow to respond.

Bruno Tavares bltavares

💭
I may be slow to respond.
View GitHub Profile
@bnagy
bnagy / gpgmutt.md
Last active August 10, 2024 22:44
Mutt, Gmail and GPG

GPG / Mutt / Gmail

About

This is a collection of snippets, not a comprehensive guide. I suggest you start with Operational PGP.

Here is an incomplete list of things that are different from other approaches:

  • I don't use keyservers. Ever.
  • Yes, I use Gmail instead of some bespoke hipster freedom service
@borkdude
borkdude / tooltip-om.clj
Last active August 29, 2015 14:06
Add tooltip to Om DOM components showing displayname and contents of cursor and local state
;;; To add a tooltip, write (tooltip {:className "foo"}) instead of #js {:className "foo"}
;;; You can simplify this and just show what you need: #js {:title (pr-str (om/...))}.
;;; testfoo.core (cljs)
(ns testfoo.core
(:require-macros [testfoo.macros :refer (tooltip)])
(:require [om.core :as om :include-macros true]
[om.dom :as dom :include-macros true]
[cljs.reader :as reader]))
@grugq
grugq / gist:03167bed45e774551155
Last active April 15, 2025 11:22
operational pgp - draft

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.

@john2x
john2x / 00_destructuring.md
Last active May 5, 2025 14:54
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@ctford
ctford / lenses.clj
Created July 12, 2014 20:40
A Clojure lens implementation based on focus and fmap.
(ns shades.lenses)
; We only need three fns that know the structure of a lens.
(defn lens [focus fmap] {:focus focus :fmap fmap})
(defn view [x {:keys [focus]}] (focus x))
(defn update [x {:keys [fmap]} f] (fmap f x))
; The identity lens.
(defn fapply [f x] (f x))
(def id (lens identity fapply))

package.el

Before Emacs 24 the only way to benefit from third party elisp packages was to copy them to your configuration. RMS always opposed a package manager in Emacs because it would make it too easy to install non-free additions (this might not be a 100% accurate represetation of what happened, it’s what I remember hearing/reading).

In any case, Emacs 24 shipped with package.el, so now there’s a package manager. You can do M-x list-packages and it will fetch a list of packages from one or more package repositories. You find the package you want, type i, then x and it installs.

repositories

There are a few different repositories. The “official” one from GNU is called ELPA. The most popular one with lots more than ELPA is MELPA. Here is how you add MELPA to your config:

@staltz
staltz / introrx.md
Last active May 9, 2025 12:50
The introduction to Reactive Programming you've been missing
#!/usr/bin/env bash
set -eu
## The Godeps file is expected to have lines like so:
#
# github.com/nu7hatch/gotrail v2.6
#
## where the first element is the import path and the second is a tag
## or commit SHA in the project.
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 27, 2025 16:31
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying