Skip to content

Instantly share code, notes, and snippets.

View xmaillard's full-sized avatar

Xavier Maillard xmaillard

  • Earth, Universe
View GitHub Profile
[user]
name = Xavier Maillard
email = xavier@maillard.im
[diff]
submodule = log
[alias]
# the acronym stands for "subtree add"
sba = "!f() { git subtree add --prefix $2 $1 master --squash; }; f"
# the acronym stands for "subtree update"
sbu = "!f() { git subtree pull --prefix $2 $1 master --squash; }; f"

Keybase proof

I hereby claim:

  • I am xma01 on github.
  • I am xmaillard (https://keybase.io/xmaillard) on keybase.
  • I have a public key ASCRg8P8sGVH_ZaQoRNpFcvGKlziCN5rrMJD1ZLBOEH1Lgo

To claim this, I am signing this object:

(request-response-data (request
(concat dailymile-api-endpoint uri "." (assoc-default 'json dailymile-format))
:type method
:parser (lambda ()
(let (
(json-object-type 'hash-table)
(json-array-type 'list)
(json-key-type 'symbol))
(json-read)))
:params `(("oauth_token" . ,(oauth2-token-access-token
@xmaillard
xmaillard / gist:0d7b2c9b2c11036c8fb3
Created January 22, 2015 22:22
mu4e - Add extra header
(add-hook 'mu4e-compose-mode-hook
(lambda ()
(let* ((em-v (prin1-to-string emacs-version t))
(ua (format "mu4e/%s Emacs/%s (%s)\n" mu4e-mu-version em-v (symbol-name system-type))))
(save-excursion
(message-add-header (concat
"X-GPG-Key-ID: 1E028EA5\n"
"X-GPG-Key: http://keyserver.mine.nu/pks/lookup?op=get&search=0x1E028EA5\n"
"X-GPG-Fingerprint: FDB0 EE1F 33E5 8C22 5E3E 96E7 6900 CA9B 1E02 8EA5\n"
@xmaillard
xmaillard / gist:31a301c178e8d4944e18
Created December 30, 2014 23:19
This is how defcustom can look like at worst !
```emacslisp
(defcustom twittering-edit-skeleton 'none
"*A symbol specifying an effective skeleton.
It must be one of a symbol in `twittering-edit-skeleton-alist'.
When entering `twittering-edit-mode', the skeletons in the specified
entry in `twittering-edit-skeleton-alist' are performed."
:group 'twittering-mode
:type (if (> (length (mapcar #'car twittering-edit-skeleton-alist)) 0)
`(choice ,@(mapcar (lambda (s) `(const ,s))
(mapcar #'car twittering-edit-skeleton-alist)))
@xmaillard
xmaillard / twittering-connection-build-customize-option
Last active August 29, 2015 14:12
twittering-connection-type-table as a defcustom entry
;; First attempt:
(defun twittering-connection-build-customize-option ()
(list 'repeat
(list
'list :tag "Configure connection method"
'(repeat
:tag "Name"
(choice
(cons :tag "Check test method"
(defvar bbdb-smsable-phones-label '("Mobil") ; TODO: make it a list?
"The member of `bbdb-phone-label-list' that can receive sms-es.")
(defun bbdb-send-sms (record)
;; TODO: no signature, how? gnus-posting-styles possible?
(interactive (list (bbdb-current-record)))
(let* ((phones (bbdb-record-phone record))
(cellphone (replace-regexp-in-string
"[ -]" ""
(catch 'found
(mapc (lambda (p)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Terminal notifier
;; requires 'sudo gem install terminal-notifier'
;; stolen from erc-notifier
(defvar terminal-notifier-command (executable-find "terminal-notifier") "The path to terminal-notifier.")
; (terminal-notifier-notify "Emacs notification" "Something amusing happened")
(defun terminal-notifier-notify (title message)
@xmaillard
xmaillard / keybase.md
Created June 29, 2014 15:18
keybase.md

Keybase proof

I hereby claim:

  • I am xmaillard on github.
  • I am xmaillard (https://keybase.io/xmaillard) on keybase.
  • I have a public key whose fingerprint is FDB0 EE1F 33E5 8C22 5E3E 96E7 6900 CA9B 1E02 8EA5

To claim this, I am signing this object:

@xmaillard
xmaillard / EmacsCounterMacro
Last active August 29, 2015 14:02
Emacs counter macros
C-x C-k C-a ;; on cree un compteur
C-x C-k C-f ;; pour utiliser un format particulier genre %02d
C-x C-k C-i ;; on insere le compteur (+1)