Skip to content

Instantly share code, notes, and snippets.

View mlongval's full-sized avatar

Michael Longval mlongval

  • Université de Sherbrooke
  • Sherbrooke, Quebec, CANADA
  • 05:37 (UTC -04:00)
View GitHub Profile
@mlongval
mlongval / Fix_BBCBasic_OwletEditor.txt
Created April 29, 2023 18:00
Fix compile problems for BBC Basic Owlet Editor
29.04.2023 13h25
I wanted to try and install mattgodbolt's cool BBC Basic
Owlet Editor on my system.
[https://github.com/mattgodbolt/owlet-editor]
Here is the blurb from the repository describing it:
Owlet Editor
@mlongval
mlongval / menu1.py
Last active August 27, 2020 17:28
Simple Menu system for CLI written in Python
#!/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
@mlongval
mlongval / gist:78206e9c48c2eb123e1af09e807c3ac1
Created February 26, 2019 21:21
Ultisnips (Vim) snippet to set a vim modeline and set buffer language
# 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 / gist:9fbe1e16b97be6e16ce0675b7291da94
Created January 8, 2017 06:01
Practice Python 05 march 2014
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 / ToggleGrayScaleMode
Last active February 3, 2016 14:46
MacOSX Grayscale Mode Toggle Applescript
(*
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
@mlongval
mlongval / Python3 and Matplotlib
Created February 14, 2013 04:01
Getting matplotlib to work with Python3 on Xubuntu 12.04
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 / date.py
Last active December 13, 2015 17:39
AutoKey code snippet to insert the current date. The original version did not work, I think because I am using Python3
"""
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