(setq custom-file (concat user-emacs-directory "custom.el"))
(when (file-exists-p custom-file)
(load custom-file))
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun my-babashka-connect--process-filter (proc string) | |
"Run cider-connect once babashka nrepl server is ready." | |
(when (string-match "Started nREPL server at .+:\\([0-9]+\\)" string) | |
(cider-connect-clj (list :host "localhost" :port (match-string 1 string)))) | |
;; Default behavior: write to process buffer | |
(internal-default-process-filter proc string)) | |
(defun my-babashka-connect () | |
"Start babashka on a random port." | |
(interactive) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# We use ord() to get the ascii value of a given letter | |
s = "Hello" | |
numbers = [ord(c) for c in s] # => [72, 101, 108, 108, 111] | |
# And chr() for the letter associated to an ascii value | |
s2 = [chr(n) for n in numbers] # => ['H', 'e', 'l', 'l', 'o'] | |
# Transform an array into a string: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://lisperator.net/blog/a-little-javascript-problem/ | |
range = (start, end) => () => start <= end ? start++ : null; | |
foreach = (seq, fn) => { while (x = seq()) fn(x); }; | |
map = (seq, fn) => () => (x = seq()) ? fn(x) : null; | |
reverse = (seq) => { | |
prev = null; | |
foreach(seq, (n) => { | |
let _prev = prev; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
workspace.clientAdded.connect(function(client) { | |
function fixdualscreen() { | |
if (workspace.numScreens === 1) return; | |
if (client.screen > 0) { | |
print("Client "+client.caption+" on external screen"); | |
callDBus("org.fixscreen", "/org/fixscreen", "org.fixscreen", "setActivities", client.windowId, ""); | |
client.onAllDesktops = true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- START POPUP --> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> | |
<script src="/jquery.cookie.js"></script> | |
<script> | |
function popunder(url, width, height, name_popunder) { | |
// On désactive le popunder sur les sites mobiles | |
if (typeof window.DetectMobileLong == 'function' && typeof window.DetectTierTablet == 'function') { | |
if(DetectMobileLong() || DetectTierTablet()) | |
return false; | |
} |