Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Longval mlongval

View GitHub Profile
@mlongval
mlongval / date.py
Last active Dec 13, 2015
AutoKey code snippet to insert the current date. The original version did not work, I think because I am using Python3
View date.py
"""
This is for use in the AutoKey text expander under Linux
The version of this script that came with the program does not work
on my system...
I think it's because I use python3
Returns the current date. in the dd/mm/yyyy format
@mlongval
mlongval / Python3 and Matplotlib
Created Feb 14, 2013
Getting matplotlib to work with Python3 on Xubuntu 12.04
View Python3 and Matplotlib
Getting matplotlib running with python3
Here are the steps that I went through to get Matplotlib to work.
(as far as I know so far.....)
I am using a Xubuntu 12.04 (Ubuntu) system.
(Your mileage may vary....)
@mlongval
mlongval / ToggleGrayScaleMode
Last active Feb 3, 2016
MacOSX Grayscale Mode Toggle Applescript
View ToggleGrayScaleMode
(*
ToggleGrayScaleMode for MacOSX 10.9 Mavericks
works as of 15 april 2014
This is an AppleScript UI script to toggle GrayScaleMode in System Preferences.
I am red-green colorblind and grayscale helps a lot...
Works for me. Hope it can be usefull for you.
Mike
View gist:9fbe1e16b97be6e16ce0675b7291da94
def overlap():
import random
listA = random.sample(range(100), k=10)
listB = random.sample(range(100), k=12)
listC = list(set([x for x in listA if x in listB]))
listC.sort()
return listC
@mlongval
mlongval / gist:78206e9c48c2eb123e1af09e807c3ac1
Created Feb 26, 2019
Ultisnips (Vim) snippet to set a vim modeline and set buffer language
View gist:78206e9c48c2eb123e1af09e807c3ac1
# set the document modeline and spelling to english
snippet setenglish "" b
# vim: spell spelllang=en
`!p vim.command("set spelllang=en")`
endsnippet
# set the document modeline and spelling to french
snippet setfrench "" b
# vim: spell spelllang=fr
`!p vim.command("set spelllang=fr")`
@mlongval
mlongval / menu1.py
Last active Aug 27, 2020
Simple Menu system for CLI written in Python
View menu1.py
#!/usr/bin/env python3
# vim: filetype=python
# Simple #!/usr/bin/env python3
# vim: filetype=python
# Michael Longval
# mlongval@gmail.com
# Simple menuing system to execute scripts in $HOME/bin/menu1_items
You can’t perform that action at this time.