Skip to content

Instantly share code, notes, and snippets.

View DamienCassou's full-sized avatar
🙂
happy

Damien Cassou DamienCassou

🙂
happy
  • finsit @ Wolters Kluwer
  • Brest, France
View GitHub Profile
lsebot@forge-scm1:/home/groups/pharobooks/htdocs/PharoByExampleTwo-Eng$ ls -ld .
drwxrwsr-x 8 nobody_pharobooks pharobooks 12288 juil. 28 11:37 .
lsebot@forge-scm1:/home/groups/pharobooks/htdocs/PharoByExampleTwo-Eng$ ls -l .
total 24
drwxrwsr-x 2 nobody_pharobooks pharobooks 4096 janv. 3 2014 2014-01-03_14:08:01
drwxrwsr-x 2 nobody_pharobooks pharobooks 4096 janv. 3 2014 2014-01-03_14:47:42
drwxrwsr-x 2 nobody_pharobooks pharobooks 4096 janv. 20 2014 2014-01-20_09:28:41
drwxrwsr-x 2 nobody_pharobooks pharobooks 4096 janv. 20 2014 2014-01-20_10:29:42
drwxrwsr-x 2 nobody_pharobooks pharobooks 4096 févr. 1 17:08 2014-02-01_16:08:28
drwxrwsr-x 2 lsebot pharobooks 4096 juil. 28 11:10 2014-07-28_09:10:18
function nixos-cleanup-safe () {
df -h /
nix-collect-garbage
df -h /
sudo nix-store --optimise
df -h /
}
function nixos-garbage-add-root () {
sudo ln -s $1 /nix/var/nix/gcroots/
@DamienCassou
DamienCassou / cpython_leaks.cocci
Created May 8, 2012 13:18
Coccinelle semantic patch to find misuses of PyDescr_NewMethod with respect to reference counters in cpython
@r exists@
local idexpression x;
expression e;
position p1,p2;
@@
x = PyDescr_NewMethod@p1(...)
... when != Py_INCREF(x)
when != Py_XINCREF(x)
when != Py_DECREF(x)
#!/usr/bin/env sh
# This script will setup Evm (Emacs Version Manager) and Cask on
# Travis to use for Emacs Lisp testing.
#
# In .travis.yml, add this:
#
# - curl -fsSkL https://gist.github.com/DamienCassou/f7d324c72cad63de484d/raw > travis.sh && source ./travis.sh
#
# Emacs 24.5 is installed in the above script because Cask requires
@DamienCassou
DamienCassou / update-emacs-ppa.sh
Last active February 20, 2016 21:26
Emacs-snapshot and emacs24 build script for Ubuntu PPA
#! /usr/bin/env bash
# Author: Damien Cassou
#
# This is the script I use to build Emacs packages for Ubuntu. These
# packages are uploaded to
# https://launchpad.net/~cassou/+archive/emacs/. Each package is
# either build from a Debian package or from
# http://emacs.naquadah.org/.
@DamienCassou
DamienCassou / magit-jira.el
Created December 20, 2016 08:53
magit branch name from jira
(defvar ftgp-jira-summary-url
"https://foretagsplatsen.atlassian.net/rest/api/2/issue/%s?fields=summary"
"Format string to get the summary of a ticket.")
(defcustom ftgp-atlassian-pass-entry "ftgp/foretagsplatsen.atlassian.net"
"Password-store entry where to find FTGP Atlassian credentials.
Must contain both the password and username such that
`auth-pass-get' will find them."
:group 'ftgp
:type 'string)
@DamienCassou
DamienCassou / auto-encrypt-mail.el
Last active March 27, 2018 13:01
Automatically encrypt Emacs outgoing emails if there is a public key for every recipient
(defun my/can-encrypt-message-p ()
"Return non-nil if current message can be encrypted.
I.e., the keyring has a public key for each recipient."
(let ((recipients (seq-map #'cadr ; only take email address, not recipient name
(seq-mapcat (lambda (header)
(let ((header-value (message-fetch-field header)))
(and
header-value
(mail-extract-address-components header-value t))))
'("To" "CC" "BCC"))))
@DamienCassou
DamienCassou / screencasting.el
Created October 14, 2019 07:50
Record audio, video and keystrokes simulatenously
;;; screencasting.el --- Tooling for screencasting -*- lexical-binding: t; -*-
;; Copyright (C) 2019 Damien Cassou
;; Author: Damien Cassou <damien@cassou.me>
;; Keywords:
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
ledger balance --depth 1 ^Equity:Budget ^Budget \
| tail -n 1 \
| grep --quiet "^ *0 *$"
@DamienCassou
DamienCassou / configuration.nix
Created October 22, 2014 13:41
configuration.nix file for NixOS on my macbook pro
{ config, pkgs, ... }:
let
hostname = "luz3";
in {
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
# I use VirtualBox to connect to Windows and Linux guests