Skip to content

Instantly share code, notes, and snippets.

View espresso3389's full-sized avatar

Takashi Kawasaki espresso3389

View GitHub Profile
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media.Imaging;
namespace FileThumbnailExtractor
{
@espresso3389
espresso3389 / colorpicker.cpp
Created March 9, 2016 17:10
Easy color picker implementation
#include <stdio.h>
#include <windows.h>
#include <ShellScalingAPI.h>
#pragma comment(lib,"gdi32.lib")
#pragma comment(lib,"user32.lib")
#pragma comment(lib,"shcore.lib")
int main()
@espresso3389
espresso3389 / urlcredtest.mm
Last active June 1, 2016 20:18
Key-chain Access Test (Obj-C++)
#include <stdio.h>
#import <CoreFoundation/CoreFoundation.h>
#import <Foundation/NSURLCredentialStorage.h>
#import <Foundation/NSURLCredential.h>
#import <Foundation/NSURLProtectionSpace.h>
#import <Foundation/NSString.h>
#import <Foundation/NSException.h>
class CredentialStore
@espresso3389
espresso3389 / seckeychain.cxx
Last active June 1, 2016 20:19
Key-chain Access Test (C++)
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <Security/SecKeychain.h>
#include <Security/SecKeychainItem.h>
#include <Security/SecKeychainSearch.h>
#include <Security/SecItem.h>
void setCredential();
@espresso3389
espresso3389 / chromecache.cs
Created June 1, 2016 20:36
Chrome Cache Retriever
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
namespace cie
{
public delegate void WriteLineDelegate(string format, params object[] args);
@espresso3389
espresso3389 / parsejpeg.cpp
Last active July 15, 2022 03:24
JPEG parser
#include <cstdio>
#include <cstring>
#include <vector>
#include <map>
#define APP(n) (0xe0 + n)
struct HUFF_ENTRY
{
unsigned char len;
@espresso3389
espresso3389 / jpxdump.cs
Created June 1, 2016 20:45
JPEG 2000 Parser
//----------------------------------------------------------------------------
// JPEG 2000 Parser
//----------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace JPXDump
@espresso3389
espresso3389 / BackgroundDispatcher.cs
Created August 8, 2016 08:20
A wrapper code to use GCD with C#'s async/await.
using CoreFoundation;
using System;
using System.Threading;
using System.Threading.Tasks;
namespace BackgroundDispatcher
{
/// <summary>
/// Wrapper for Grand Central Dispatch.
/// </summary>
@espresso3389
espresso3389 / xamform+netstd16.csproj
Created May 30, 2017 21:59
Xamarin.Forms+.NET Standard 1.6
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.6</TargetFramework>
<PackageTargetFallback>portable-net45+win8+wpa81+wp8</PackageTargetFallback>
<DebugType>full</DebugType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="2.3.4.247" />
</ItemGroup>
<ItemGroup>
@espresso3389
espresso3389 / consumer.csproj
Created June 11, 2017 19:07
*.Android/*.iOS csproj require these tags
<CopyNuGetImplementations>true</CopyNuGetImplementations>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>