Skip to content

Instantly share code, notes, and snippets.

@rdinse
rdinse / MSAccessSQL_DLL.md
Last active June 23, 2020 00:11
Building a DLL for VBA and MS Access SQL with Mingw-w64 and CMake with unit tests

./CMakeLists.txt

cmake_minimum_required(VERSION 3.17)
include(GenerateExportHeader)
project(MyDLL)
set(LIB_SRCS dllmain.cpp)
SET (LIB_TYPE SHARED)
add_library(MyDLL ${LIB_TYPE} ${LIB_SRCS})
GENERATE_EXPORT_HEADER(MyDLL)

ENABLE_TESTING()

@rdinse
rdinse / imshow.py
Created May 1, 2018 19:09
Simple imshow for Jupyter Notebook and Google Colaboratory
# Valid image shapes: (H, W), (H, W, 1) for grey-scale images and (H, W, 3) for
# color images. For info about the interpolation order, see the
# [skimage docs](https://goo.gl/vGE6dv). Setting `fmt='jpeg'` might come in
# handy in case of large images. Example Output: https://i.stack.imgur.com/nb2vG.png
import numpy as np
from io import BytesIO
from base64 import b64encode
import PIL.Image, IPython.display
from skimage import transform
@rdinse
rdinse / Google_Colaboratory_backup.py
Created March 13, 2018 22:55
Simple Google Drive backup script with automatic authentication for Google Colaboratory (Python 3)
# Simple Google Drive backup script with automatic authentication
# for Google Colaboratory (Python 3)
# Instructions:
# 1. Run this cell and authenticate via the link and text box.
# 2. Copy the JSON output below this cell into the `mycreds_file_contents`
# variable. Authentication will occur automatically from now on.
# 3. Create a new folder in Google Drive and copy the ID of this folder
# from the URL bar to the `folder_id` variable.
# 4. Specify the directory to be backed up in `dir_to_backup`.
@rdinse
rdinse / speeduptv_upload.sh
Last active September 20, 2017 01:57
iOS SpeedUpTV video upload shell script
# Usage: speeduptv-upload [video_file]
# The device name of the phone can be found via `nslookup IP_OF_YOUR_PHONE`.
# SpeedUpTV needs to stay active throughout the upload and sometimes it is
# necessary to restart SpeedUpTV after a failed upload.
# This function can for example be added to ~/.profile (BASH) or ~/.zprofile (ZSH).
speeduptv-upload () {
IPHONE_NAME="iPhone-6s"
curl -o /dev/null -F "Filename=\"$1\"" -F "Filedata=@\"$1\"\;filename=\"$1\"" -o output http://${IPHONE_NAME}.${$(hostname)#*.}:8080
}