Skip to content

Instantly share code, notes, and snippets.

View pauldub's full-sized avatar
🐱
🇫🇷 🇧🇪

Paul pauldub

🐱
🇫🇷 🇧🇪
View GitHub Profile
USING: accessors arrays byte-arrays calendar fry google.search
io io.directories io.directories.hierarchy io.directories.search
io.encodings.utf8 io.files io.launcher io.pathnames io.pipes
io.timeouts kernel locals make namespaces sequences splitting
strings unicode.categories webbrowser wordtimer ;
IN: spotlight
! *** MAC OS X 10.6.8 & LATER: IMPLEMENTING mdfind, mdls, mdutil, mdimport ***
! *** SEARCHING ON OS X VIA SPOTLIGHT METADATA INDEX, & MANAGING INDEXING FROM FACTOR ***
@pauldub
pauldub / i3-powerline.patch
Last active September 3, 2020 07:40 — forked from GladOSkar/i3-powerline.patch
Patch to make powerline separators span the full height in the i3bar - Very hacky, use at own risk! - Designed for use with greshake/i3status-rust - Only tested on 1080p wo/ scaling
diff --git a/libi3/font.c b/libi3/font.c
index 9433467c..3659f4da 100644
--- a/libi3/font.c
+++ b/libi3/font.c
@@ -87,10 +87,12 @@ static bool load_pango_font(i3Font *font, const char *desc) {
static void draw_text_pango(const char *text, size_t text_len,
xcb_drawable_t drawable, xcb_visualtype_t *visual, int x, int y,
int max_width, bool pango_markup) {
+ bool separator = (text[0] == ""[0]) || (text[0] == "🭅"[0]);
/* Create the Pango layout */
@pauldub
pauldub / .janetsh.rc
Created May 24, 2019 07:32
janet zsh-like prompt
# Add ~/.janet to module/paths
(let [base-dir (string (os/getenv "HOME") "/.janet")]
(array/insert module/paths 0
(tuple (string base-dir "/:all:/:name:.:native:") :native))
(array/insert module/paths 0
(tuple (string base-dir "/:all:.:native:") :native))
(array/insert module/paths 0
(tuple (string base-dir "/:all:/init.janet") :source))
(array/insert module/paths 0
(tuple (string base-dir "/:all:.janet") :source))
@pauldub
pauldub / exemple.md
Last active September 21, 2016 08:12
Reference markdown

Normal italique gras code

  • point une
  • point deux
  • point trois
  1. point une
  2. point deux
  3. point trois
@pauldub
pauldub / example.go
Created April 15, 2016 07:48
micro-particle-broker
package main
import (
"log"
"github.com/micro/go-micro/broker"
"github.com/micro/go-micro/cmd"
"broker/particle"
)
def -allow-override -params 1 godoc %{
%sh{
output=$(mktemp -d -t kak-temp-XXXXXXXX)/fifo
mkfifo ${output}
(go doc $1 > ${output}) > /dev/null 2>&1 < /dev/null &
echo "eval -client %opt{docsclient} echo '
edit! -fifo ${output} *godoc*
hook buffer BufClose .* %{ nop %sh{ rm -r $(dirname ${output})}}
'"
}
@pauldub
pauldub / gist:5383113
Last active December 16, 2015 05:19
Dart's =>
var fruits = [
'banane',
'mangue',
'orange'
];
// L'operateur => c'est un shorthand pour les fonction de ce genre la si on l'appliquait a du JS
_.filter(fruits, function (fruit) {
return fruit.match(/^b/)
@pauldub
pauldub / gist:4715870
Created February 5, 2013 17:04
You can monkey patch the ERB class like this but you will probably get a `warning: already initialized constant`
class ERB
module Util
HTML_ESCAPE = { '&' => '&amp;', '>' => '&gt;', '<' => '&lt;', '"' => '&quot;', "'" => '&#39;' }
end
end
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@
@pauldub
pauldub / server.sh
Created July 26, 2012 19:29 — forked from ibdknox/server.sh
example daemon for lein processes
#!/bin/bash
name=webnoir
pidfile=/var/run/$name.pid
if [ -f "$pidfile" ]; then
pid=`cat $pidfile`
running=`ps p $pid |wc -l`
if [ $running -eq 1 ]; then
pid=