Skip to content

Instantly share code, notes, and snippets.

View nchapon's full-sized avatar

Nicolas Chapon nchapon

View GitHub Profile
@nchapon
nchapon / emacs-puml-snippets.clj
Last active May 16, 2023 16:15
Convert Plant UML VSCode Snippets to Emacs Yasnippets with Babashka
(require '[babashka.http-client :as http])
(require '[cheshire.core :as json])
(require '[clojure.string :as str])
(require '[babashka.fs :as fs])
(defn get-url
"Get URL"
[url]
(println "Downloading url:" url)
(http/get url))

Keybase proof

I hereby claim:

  • I am nchapon on github.
  • I am nchapon (https://keybase.io/nchapon) on keybase.
  • I have a public key ASABTj5GZN8vRoVOT_zR-ndEPDTsHtdI1NJ03EUcSFBHLgo

To claim this, I am signing this object:

@nchapon
nchapon / fizzbuzz.html
Created November 30, 2015 22:01
FizzBuzz in html
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>FizzBuzz en HTML</title>
</head>
<body>
<div>
<style>
body {
# Bindings de keys
set -g prefix C-a
# Free the original key binding
unbind C-b
# Setting the delay between the prefix and command
set -sg escape-time 1
# Ensure that we can send Ctrl-A to other apps
# Bindings de keys
set -g prefix C-a
# Windows navigation with Maj + Arrows
bind -n S-Left previous-window
bind -n S-Right next-window
# Pane navigation with Alt + Arrows
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
;; This buffer is for notes you don't want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer.
(require 'f)
;; List all files
(f-files "/home/nchapon/notes/GTD/days")
@nchapon
nchapon / tomcat
Created March 24, 2015 15:28
Apache Tomcat Start / Stop / Status init.d script that works fine with ansible
#!/bin/sh
# description: Tomcat Start Stop Restart
# processname: tomcat
# chkconfig: 234 20 80
# source function library
. /etc/rc.d/init.d/functions
TOMCAT_USER=tomcat
LOCKFILE=/var/lock/tomcat
@nchapon
nchapon / my-nn
Created February 5, 2015 21:20
two lisp function
;; This buffer is for notes you don't want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer.
(defun my-nn ()
"DOCSTRING"
(interactive)
(let (w (select-word))
(forward-char)
@nchapon
nchapon / sql-connection
Created January 6, 2015 22:13
SQL connect with ido
;; Sql specfic config
(setq sql-connection-alist
'((cnp (sql-product 'mysql)
(sql-port 3306)
(sql-server "localhost")
(sql-user "cnp")
;;(sql-password "pwd")
(sql-database "cnp"))
@nchapon
nchapon / emacs
Created July 27, 2012 12:53
Emacs snapshot install broken
Dépaquetage de emacs-snapshot-gtk (à partir de .../emacs-snapshot-gtk_2%3a20120721-1~ppa2~oneiric1_all.deb) ...
Traitement des actions différées (« triggers ») pour « man-db »...
Traitement des actions différées (« triggers ») pour « install-info »...
Paramétrage de emacsen-common (1.4.19ubuntu2) ...
emacsen-common: Handling install of emacsen flavor emacs
Paramétrage de emacs-snapshot-common (2:20120721-1~ppa2~oneiric1) ...
Paramétrage de emacs-snapshot-bin-common (2:20120721-1~ppa2~oneiric1) ...
update-alternatives: erreur: le chemin alternatif /usr/bin/ctags.emacs-snapshot n'existe pas.
dpkg : erreur de traitement de emacs-snapshot-bin-common (--configure) :
le sous-processus script post-installation installé a retourné une erreur de sortie d'état 2