This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Smartphones (portrait and landscape) ----------- */ | |
@media only screen and (min-device-width: 320px) and (max-device-width: 480px) { | |
/* Styles */ | |
} | |
/* Smartphones (landscape) ----------- */ | |
@media only screen and (min-width: 321px) { | |
/* Styles */ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const groupBy = (xs, key) => xs.reduce((rv, x) => { | |
(rv[x[key]] = rv[x[key]] || []).push(x); | |
return rv; | |
}, {}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///This is a Frankenstein class that can extract the AES key from a KDK as described in: | |
/// https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/implementation/subkeyderivation?view=aspnetcore-2.2 | |
///With a bit of luck, this should let an ASP.NET app decrypt cookies generated by an ASPNETCore app | |
///Still consult https://docs.microsoft.com/en-us/aspnet/core/security/cookie-sharing?view=aspnetcore-2.2 to share cookies | |
///Credit for most of the code is from various parts of https://github.com/aspnet/AspNetCore/tree/master/src/DataProtection/DataProtection/src | |
public unsafe class CookieDataProtector : IDataProtector | |
{ | |
readonly string _base64MasterKey; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# boot-url points to an nfs URL | |
# sanboot-url points to an http URL | |
# ubuntu-version contains 18.04.3 | |
# ubuntu-release contains bionic | |
:ubuntu | |
echo Booting Ubuntu from iSCSI for ${initiator-iqn} | |
set root-path ${base-iscsi}:${hostname}.boot.ubuntu | |
sanboot ${root-path} || goto failed | |
goto start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bash best practices and style-guide | |
Just simple methods to keep the code clean. | |
Inspired by [progrium/bashstyle](https://github.com/progrium/bashstyle) and [Kfir Lavi post](http://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming/). | |
## Quick big rules | |
* All code goes in a function | |
* Always double quote variables |