Skip to content

Instantly share code, notes, and snippets.

@tablesmit
tablesmit / FileLockInfo.cs
Created December 16, 2018 02:34 — forked from i-e-b/FileLockInfo.cs
Discover Win32 processes locking a file, and file locks by process. This is quite old now, and better methods are available.
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.Text;
using System.Threading;
namespace FileLockInfo
{
public class Win32Processes
@tablesmit
tablesmit / ffmpeg-watermark.md
Created July 30, 2017 03:29 — forked from bennylope/ffmpeg-watermark.md
FFmpeg add a watermark to video

How to Add a Watermark to Video

FFMPEG filters provide a powerful way to programmatically enhance or alter videos, and it’s fairly simple to add a watermark to a video using the overlay filter. The easiest way to install ffmpeg is to download a pre-built binary for your specific platform. Then you don’t have to worry about including and installing all the right dependencies and codecs you will be using.

Once you have ffmpeg installed, adding a watermark is as easy as passing your existing source through an overlay filter like so:

ffmpeg -i test.mp4 -i watermark.png -filter_complex "overlay=10:10" test1.mp4

Basically, we’re passing in the original video, and an overlay image as inputs, then passing it through the filter, and saving the output as test1.mp4.

@tablesmit
tablesmit / downloadCSV.cs
Created November 7, 2016 09:12 — forked from dhlavaty/downloadCSV.cs
Download CSV file from Google Spreadsheet (Google Drive) using minimum c# code
using System;
using System.Net;
namespace ConsoleApplication1
{
class Program
{
public class WebClientEx : WebClient
{
public WebClientEx(CookieContainer container)
@tablesmit
tablesmit / ReflectionUtilities.cs
Created September 17, 2016 08:25 — forked from riyadparvez/ReflectionUtilities.cs
Reflection utilities for C#. Get all fields, constructors, methods and properties
/// <summary>
/// Utilties for reflection
/// </summary>
public static class ReflectionUtils
{
/// <summary>
/// Get all the fields of a class
/// </summary>
/// <param name="type">Type object of that class</param>
/// <returns></returns>