Skip to content

Instantly share code, notes, and snippets.

View adamskt's full-sized avatar
⌨️
Typing and sometimes moving the mouse.

Kelly Adams adamskt

⌨️
Typing and sometimes moving the mouse.
View GitHub Profile
@idavis
idavis / Models.cs
Created July 6, 2011 22:33
Inverse null coalescing 'operator' support. Only properties are allowed.
#region Using Directives
using System.Threading;
#endregion
namespace ObjectExtensions.Tests
{
public class Person
{
@jonnyreeves
jonnyreeves / index.html
Created April 23, 2012 21:38
JavaScript Class Structure using requireJS. The following code shows you how to create a Class definition in one JavaScript file and then import it for use in another; coming from an ActionScript 3 background this (and some of JavaScript specific traits)
<!DOCTYPE html>
<html>
<head>
<script data-main="usage" src="http://requirejs.org/docs/release/1.0.8/comments/require.js"></script>
</head>
<body>
<p>Check your JavaScript console for output!</p>
</body>
</head>
@nickalbrecht
nickalbrecht / SelectListExtensionMethods.cs
Last active November 5, 2022 19:57
SelectListItem Extension Methods for DropDowns in MVC Core. Added ability to specify the option's Group, and for some bug fixes, more XML docs
public static class SelectListExtensionMethods
{
/// <summary>
/// The SelectListItem to use by default as the placeholder for select lists generated by these extension methods when the user needs to pick a value.
/// </summary>
public static readonly SelectListItem DefaultEmptySelectListItem = new SelectListItem() { Text = "-- Pick One --", Value = string.Empty };
/// <summary>
/// The SelectListItem to use by default as the placeholder for select lists generated by these extension methods when not picking a value is the same as using as of the possible choices (meant for filtering typically)
/// </summary>
public static readonly SelectListItem AnySelectListItem = new SelectListItem() { Text = "-- Any --", Value = string.Empty };
@w0rd-driven
w0rd-driven / passwords.txt
Created November 18, 2016 20:19
BFG Repo-Cleaner --replace-text example
PASSWORD1 # Replace literal string 'PASSWORD1' with '***REMOVED***' (default)
PASSWORD2==>examplePass # replace with 'examplePass' instead
PASSWORD3==> # replace with the empty string
regex:password=\w+==>password= # Replace, using a regex
regex:\r(\n)==>$1 # Replace Windows newlines with Unix newlines
@sdrapkin
sdrapkin / Login.gov encryption is badly designed.md
Last active December 6, 2018 15:03
Login.gov encryption is badly designed

Login.gov encryption is badly designed

Disclaimer: everything that follows is a personal opinion - not an assertion of fact.

Regulatory/Compliance flaws

NIST has created Federal Information Processing Standard (FIPS) 140-2: Security Requirements for Cryptographic Modules. FIPS requirements are mandatory for Federal Government agencies, as prescribed by FISMA law. FIPS-140-2 Annex D covers Approved Key Establishment Techniques. The only FIPS-approved password-based key derivation algorithm is PBKDF2 (NIST SP800-132). Login.gov uses scrypt, which is not FIPS-approved. The FIPS-approved key-derivation algorithms are mostly covered by NIST SP800-108. Login.gov uses several custom approaches for key derivation, none of which are FIPS-approved.

Summary:

Installing Cool-Retro-Term on Windows10

First of all, this document is just a recompilation of different resources that already existed on the web previously that I personally tested some ones did work and other not. I liked the idea to make a full guide from start to end so all of you could also enjoy playing with cool-retro-term on windows 10. Personally I installed it on a windows 10 pro version. Fingers crossed!

result

@richlander
richlander / modernizing-csharp9.md
Last active April 26, 2024 17:14
Modernizing a codebase for C# 9

Modernizing a codebase for C# 9

There are lots of cases that you can improve. The examples use nullable reference types, but only the WhenNotNull example requires it.

Use the property pattern to replace IsNullorEmpty

Consider adopting the new property pattern, wherever you use IsNullOrEmpty.

string? hello = "hello world";