How to limit the number of dropzone.js files uploaded?

I achieved this a slightly different way. I just remove the old dropped file any time a new file is added. It acts as overwriting the file which was the user experience I was going for here. Dropzone.options.myAwesomeDropzone = { accept: function(file, done) { console.log(“uploaded”); done(); }, init: function() { this.on(“addedfile”, function() { if (this.files[1]!=null){ … Read more

SQLite3 database or disk is full / the database disk image is malformed

To repair a corrupt database you can use the sqlite3 commandline utility. Type in the following commands in a shell after setting the environment variables: cd $DATABASE_LOCATION echo ‘.dump’|sqlite3 $DB_NAME|sqlite3 repaired_$DB_NAME mv $DB_NAME corrupt_$DB_NAME mv repaired_$DB_NAME $DB_NAME This code helped me recover a SQLite database I use as a persistent store for Core Data and … Read more

Get file version in PowerShell

Since PowerShell 5 in Windows 10, you can look at FileVersionRaw (or ProductVersionRaw) on the output of Get-Item or Get-ChildItem, like this: (Get-Item C:\Windows\System32\Lsasrv.dll).VersionInfo.FileVersionRaw It’s actually the same ScriptProperty from my Update-TypeData in the original answer below, but built-in now. In PowerShell 4, you could get the FileVersionInfo from Get-Item or Get-ChildItem, but it would … Read more

Trying to copy file from one XP PC to another using WMI, since RPC and UNC are not available

I learned that WMI cannot create files on a remote host, and it cannot copy files over a network connection: http://msdn.microsoft.com/en-us/library/windows/desktop/aa389288%28v=vs.85%29.aspx However, it can run a cmd process. Here’s Frank White’s code in C sharp, followed by his example: https://stackoverflow.com/a/8913231/1569434 InputParameters(“CommandLine”) = “cmd /c echo myFTPCommands > c:\ftpscript.txt” You will need four things to use … Read more

Batch: Remove file extension

You can use %%~nf to get the filename only as described in the reference for for: @echo off for /R “C:\Users\Admin\Ordner” %%f in (*.flv) do ( echo %%~nf ) pause The following options are available: Variable with modifier Description %~I Expands %I which removes any surrounding quotation marks (“”). %~fI Expands %I to a fully … Read more