Skip to content

Instantly share code, notes, and snippets.

View johanlindfors's full-sized avatar

Johan Lindfors johanlindfors

View GitHub Profile

Keybase proof

I hereby claim:

  • I am johanlindfors on github.
  • I am jl_truesec (https://keybase.io/jl_truesec) on keybase.
  • I have a public key ASB35FDIOT__lDvW7KgvO_1c1z1NWq_kzmxegkqdAxtMSQo

To claim this, I am signing this object:

@johanlindfors
johanlindfors / README.md
Last active December 29, 2019 09:29
How to remove a submodule

This should be sufficient to delete a submodule

git submodule deinit <path_to_submodule>
git rm <path_to_submodule>
git commit-m "Removed submodule "
rm -rf .git/modules/<path_to_submodule>
@johanlindfors
johanlindfors / gist:d71d7a5f44660c0e5170af0674fa3505
Created April 28, 2019 07:36
Custom Visual Studio target xml element to inject assets into output assembly
<ItemGroup Label="resources_pipeline_output">
<_CustomResource Include="..\..\..\resources\common\**\*">
<Link>resources\%(RecursiveDir)%(FileName)%(Extension)</Link>
<DeploymentContent>true</DeploymentContent>
</_CustomResource>
</ItemGroup>
<Target BeforeTargets="AssignTargetPaths" Name="_CollectCustomResources">
<Message Text="Adding resource: %(_CustomResource.Identity) -&gt; %(_CustomResource.Link)" />
<ItemGroup><None Include="@(_CustomResource)" /></ItemGroup>
</Target>
namespace winsdkfb
{
namespace Graph
{
struct FBCursors : winrt::implements<FBCursors, winrt::Windows::Foundation::IInspectable >
{
hstring After() { return _after; }
void After(hstring const& value) { _after = value; }
hstring Before() { return _before; }
@johanlindfors
johanlindfors / InstallIdForPublisher.hpp
Last active March 14, 2018 18:54
Publisher shared installId for UWP apps implemented with CppWinRT
#pragma once
#include <string>
#include <winrt/Windows.Storage.Streams.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Security.Cryptography.Core.h>
#include <winrt/Windows.System.UserProfile.h>
namespace winrt {
using namespace Windows::Storage;
@johanlindfors
johanlindfors / InstallIdForPublisher.h
Created February 27, 2016 08:31
A first attempt of an InstallId for Vendor/Publisher on the UAP in C++
#pragma once
using namespace Platform;
using namespace Windows::Storage;
using namespace Windows::Storage::Streams;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::Security::Cryptography;
using namespace Windows::Security::Cryptography::Core;
using namespace Windows::System::UserProfile;
@johanlindfors
johanlindfors / C#: Validate email
Created October 20, 2012 07:22
Validate email in C#
public static bool ValidateEmail(string email)
{
Regex regex = new Regex(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$");
Match match = regex.Match(email);
return match.Success;
}