Skip to content

Instantly share code, notes, and snippets.

View webflo-dev's full-sized avatar

Florent webflo-dev

View GitHub Profile
@jonenzl
jonenzl / Password Generator - C#
Last active October 3, 2022 20:35
A simple password generator built with C# in Visual Studio, using WPF and the .Net Framework 4.5
using System;
using System.Text;
using System.Windows;
namespace Password_Generator
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
@bvis
bvis / README.md
Last active February 4, 2025 16:57
Docker Env Vars expanded with secrets content

Variables by Secrets

Sample script that allows you to define as environment variables the name of the docker secret that contains the secret value. It will be in charge of analyze all the environment variables searching for the placeholder to substitute the variable value by the secret.

Usage

You can define the next environment variables:

@davidfowl
davidfowl / Example1.cs
Last active September 2, 2024 12:36
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@lopspower
lopspower / README.md
Last active July 11, 2025 21:46
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@bradwilson
bradwilson / colors.ps1
Last active December 7, 2017 12:30
Custom Posh-Git prompt
# Background colors
$GitPromptSettings.AfterBackgroundColor = "DarkBlue"
$GitPromptSettings.AfterStashBackgroundColor = $GitPromptSettings.AfterBackgroundColor
$GitPromptSettings.BeforeBackgroundColor = $GitPromptSettings.AfterBackgroundColor
$GitPromptSettings.BeforeIndexBackgroundColor = $GitPromptSettings.AfterBackgroundColor
$GitPromptSettings.BeforeStashBackgroundColor = $GitPromptSettings.AfterBackgroundColor
$GitPromptSettings.BranchAheadStatusBackgroundColor = $GitPromptSettings.AfterBackgroundColor
$GitPromptSettings.BranchBackgroundColor = $GitPromptSettings.AfterBackgroundColor
$GitPromptSettings.BranchBehindAndAheadStatusBackgroundColor = $GitPromptSettings.AfterBackgroundColor
$GitPromptSettings.BranchBehindStatusBackgroundColor = $GitPromptSettings.AfterBackgroundColor
@bradwilson
bradwilson / gist:05ffdad8c73cf9230261
Created April 23, 2015 17:15
Beware the cost of "async"
// Don't do this, because you don't need async if you're only calling one
// downstream async method and returning its value, unprocessed.
public async Task<int> DoSomething(int x, int y)
{
return await SlowMath.AddAsync(x, y);
}
// Do this instead:
public Task<int> DoSomething(int x, int y)
{
@davidfowl
davidfowl / dotnetlayout.md
Last active June 29, 2025 14:46
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@charlessolar
charlessolar / gist:4aca442373b4216a52b5
Created October 21, 2014 08:17
Integrating Durandal and Pace for page loading indicators
// Put in your main.js define
pace.start({
document: false,
elements: false,
startOnPageLoad: false,
});
router.isNavigating.subscribe((navigating) => {
if( navigating )
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using System.Data.Entity.ModelConfiguration.Configuration;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using DelegateDecompiler;