Skip to content

Instantly share code, notes, and snippets.

View glockbender's full-sized avatar
☮️
War never changes

Ilya Perevozchikov glockbender

☮️
War never changes
  • Different Technologies
  • Cyprus
View GitHub Profile
inline fun <reified T> ObjectMapper.readAsList(serialized: String): List<T> =
this.typeFactory.constructCollectionType(List::class.java, T::class.java)
.let { collectionType ->
try {
this.readValue(serialized, collectionType)
} catch (e: Exception) {
throw RuntimeException("Cannot deserialize list of ${T::class.simpleName}")
}
}
@glockbender
glockbender / FileDownloader.cs
Created December 14, 2017 20:19 — forked from yasirkula/FileDownloader.cs
C# Download Public File From Google Drive™ (works for large files as well)
using System;
using System.IO;
using System.Net;
public static class FileDownloader
{
private const string GOOGLE_DRIVE_DOMAIN = "drive.google.com";
private const string GOOGLE_DRIVE_DOMAIN2 = "https://drive.google.com";
// Normal example: FileDownloader.DownloadFileFromURLToPath( "http://example.com/file/download/link", @"C:\file.txt" );