Skip to content

Instantly share code, notes, and snippets.

View jfthuong's full-sized avatar

Jean-Francois Thuong jfthuong

View GitHub Profile
@jfthuong
jfthuong / LotusNotes_2_link.pl
Created February 4, 2012 12:24
Perl script to convert a Lotus Notes link into a notes:// protocol link
@jfthuong
jfthuong / run_or_compile.bat
Created February 4, 2012 12:36
Batch file to run or compile the argument file based on the extension
@echo off
REM ----------------------
REM ----- ARGUMENTS ------
REM ----------------------
set PATH=%~1
set FILE=%~n1
set DIR=%~dp1
set EXTENSION=%~x1
REM ----------------------
@jfthuong
jfthuong / compress_pictures.pl
Created February 4, 2012 12:45
Perl script to batch compress pictures with ImageMagick
#!perl
#---------------------------------------------------------------------------------------------
#-------------------------- Prerequisites ----------------------------------------------------
#---------------------------------------------------------------------------------------------
# This Perl script is using Imagemagick to compress the pictures.
# This tool shall be downloaded and installed first.
#---------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------
@jfthuong
jfthuong / LotusNotes_Backup.bat
Created February 4, 2012 12:46
Batch script to backup Lotus Notes data
REM !IMPORTANT: May not work with Lotus Notes 8.5.x on Windows 7!
@echo off
c:
cd \
mkdir Backup_notes\data
cd Program Files
cd IBM
cd lotus/notes
@echo on
@jfthuong
jfthuong / InsertRowsMSWordTables.vb
Last active April 21, 2021 05:44
Insert a given number of rows in a MS Word Table (VBA)
Sub Insert_x_rows()
'
' Insert a given number of rows into a MS Word Table
'
'
Dim n_rows As Integer
n_rows = InputBox("How many rows shall be inserted?", "Insert Rows")
Selection.InsertRowsBelow n_rows
@jfthuong
jfthuong / svn_revert_clean.py
Created October 20, 2015 10:49
Script to remove unversioned files and perform svn revert
#!python
import os
import re
import sys
import subprocess
'''
svn_revert_clean.py - script to remove unversioned files and perform svn revert
@jfthuong
jfthuong / solution.py
Last active September 28, 2018 02:53
WPE - Week 01 - Solution
#!/python
from collections import defaultdict, Counter
# BONUS: fuzzy logic when entering countries and cities
try:
from fuzzywuzzy import fuzz
FUZZY_ENABLED = True
print("")
except ImportError as e:
@jfthuong
jfthuong / solution.py
Last active October 11, 2018 01:37
WPE - Week 02 - Solution
import timeit
from typing import Dict, Generator, List
Range3 = Generator[int, None, None]
def myrange3(start: int, stop: int = None, step: int = 1) -> Range3:
if stop is None:
current, stop = 0, start
@jfthuong
jfthuong / test_solution_W02.py
Created October 11, 2018 01:46
Test of Solution for WPE Week 2
#!/usr/bin/env python3
import solution
import pytest
list_test_inputs = [
(10,),
(10, 20),
(20, 10),
@jfthuong
jfthuong / test_solution_W03.py
Created October 11, 2018 05:46
Test of Solution for WPE Week 2
#!/usr/bin/env python3
import solution
logfilename = "mini-access-log.txt"
def test_read_logs():
log_list = solution.logtolist(logfilename)
assert len(log_list) == 206