Skip to content

Instantly share code, notes, and snippets.

View benwah's full-sized avatar

Benoit C. Sirois benwah

  • Nasdaq
  • Gatineau
View GitHub Profile
@benwah
benwah / dwstat.py
Created December 11, 2017 01:04 — forked from la11111/dwstat.py
dwstat.py - my dwm status bar script
#!/usr/bin/env python
from threading import Thread,Lock,Event,Timer
import os
import sys
import signal
import subprocess
import math
import psutil
import re
@benwah
benwah / readline_patch_for_ruby-2.0.0-p247
Created June 25, 2014 15:25
Patches ruby 2.0.0-p247 with support for readline 6.3 - based on https://gist.github.com/mislav/a18b9d7f0dc5b9efc162.txt
diff --git a/ext/readline/extconf.rb b/ext/readline/extconf.rb
index 4920137..012ae68 100644
--- a/ext/readline/extconf.rb
+++ b/ext/readline/extconf.rb
@@ -19,6 +19,10 @@ def readline.have_func(func)
return super(func, headers)
end
+def readline.have_type(type)
+ return super(type, headers)
@benwah
benwah / mongo_serialize.py
Created June 28, 2012 04:43
Queryset / List of queryset serializer for mongoengine models.
import json
import datetime
from decimal import Decimal
from mongoengine.queryset import queryset_manager
from mongoengine.queryset import QuerySet
from mongoengine.base import BaseList, BaseDict, ObjectId
def list_encoder(inst, obj, field, force_string=False):
"""