Skip to content

Instantly share code, notes, and snippets.

View brrd's full-sized avatar

Thomas Brouard brrd

View GitHub Profile
@brrd
brrd / checkLodelStyles.vb
Created June 18, 2015 10:32
Macro checkLodelStyles()
Private Function styleExists(styleName As String, doc As Document) As Boolean
Dim MyStyle As Word.Style
On Error Resume Next
Set MyStyle = doc.Styles(styleName)
styleExists = Not MyStyle Is Nothing
End Function
Sub checkLodelStyles()
Dim erreurStyle As Style
Dim DocPara As Paragraph
@brrd
brrd / .jshintrc
Last active December 6, 2016 09:38
jshintrc
{
"undef": true,
"unused": "vars",
"browser": true,
"node": true,
"eqnull": true,
"esversion": 6,
"jquery": true,
"indent": 4
}
@brrd
brrd / batch_convert.bas
Last active February 17, 2022 12:35
MS Word Document Batch Convert
' MS Word Document Batch Convert
' Inspiration: http://windowssecrets.com/forums/showthread.php/70355-Batch-convert-files-from-rtf-to-doc-%28Word-2003%29
Sub BatchConvert()
' Configuration
Const strSourcePath = "C:\Path\To\Source\Dir\" ' Keep final backslash
Const strTargetPath = "C:\Path\To\Target\Dir\" ' Keep final backslash
Const sourceExtension = "docx"
Const targetFormat = wdFormatDocument97 ' Available file formats: https://msdn.microsoft.com/fr-fr/library/microsoft.office.interop.word.wdsaveformat.aspx
@brrd
brrd / BreakOnSection.bas
Last active February 6, 2016 12:50
Word: BreakOnSection
'Inspiration: https://support.microsoft.com/fr-fr/kb/306348
Sub BreakOnSection()
'Move cursor to first line
Selection.GoTo What:=wdGoToHeading, Which:=wdGoToFirst
' Used to set criteria for moving through the document by section.
Application.Browser.Target = wdBrowseSection
'S'il y a un saut de section à la fin du doc
For i = 1 To ((ActiveDocument.Sections.Count) - 1)
@brrd
brrd / asfored-propre.user.js
Created June 21, 2016 11:26
Userscript pour une navigation décente (= un minimum accessible) sur le nouvel espace emploi de l'asfored (juin 2016). À utiliser avec Gresemonkey/Tampermonkey.
// ==UserScript==
// @name asfored-propre
// @namespace brrd.fr
// @description Une navigation décente (= un minimum accessible) sur le nouvel espace emploi de l'asfored (juin 2016)
// @include http://asfored.org/emploi/offres
// @version 2
// @grant GM_addStyle
// ==/UserScript==
// Distinguer les liens visités
@brrd
brrd / electron-dynamic-include.js
Last active July 5, 2022 07:02
Electron: dynamic include JS and/or CSS from a dependency in renderer process
// Install 'module-name' as a dependency, then:
function init () {
return new Promise ((resolve, reject) => {
const injectScript = (src, callback) => {
const script = document.createElement('script');
document.head.appendChild(script);
script.onload = callback;
script.src = src;
};
@brrd
brrd / gmail-img-max-width.user.js
Last active May 15, 2019 13:35
gmail-img-max-width.user.js
// ==UserScript==
// @name gmail-img-max-width
// @namespace http://brrd.fr
// @version 0.1
// @description Fix image max width in gmail
// @author brrd
// @match https://mail.google.com/mail/*
// @grant GM_addStyle
// ==/UserScript==
@brrd
brrd / html.json
Last active June 8, 2021 08:22
Lodel snippets for VSCode
{
// Place your snippets for html here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@brrd
brrd / inset-box-shadow-on-round-image.css
Last active February 20, 2022 14:05
Subtle inset box-shadow on round images
.img-container {
width: 100%;
max-width: 100px;
position: relative;
}
.img-container::after {
content: '';
position: absolute;
top: 0;