Skip to content

Instantly share code, notes, and snippets.

View xmagee's full-sized avatar
😏

Alex Magee xmagee

😏
View GitHub Profile
@xmagee
xmagee / GlobalUsing.cs
Last active March 22, 2022 02:51
Global using declaration file for C# projects, with a globally accessible appConfig json file
global using Microsoft.Extensions.Configuration;
class Global
{
static IConfiguration _appConfig = new ConfigurationBuilder()
.AddJsonFile("yourConfigFile.json", optional: false)
.Build();
public static IConfiguration appConfig
{
@xmagee
xmagee / full-disk-encryption-arch-uefi.md
Created March 20, 2022 00:56 — forked from huntrar/full-disk-encryption-arch-uefi.md
Arch Linux Full-Disk Encryption Installation Guide [Encrypted Boot, UEFI, NVMe, Evil Maid]

Arch Linux Full-Disk Encryption Installation Guide

This guide provides instructions for an Arch Linux installation featuring full-disk encryption via LVM on LUKS and an encrypted boot partition (GRUB) for UEFI systems.

Following the main installation are further instructions to harden against Evil Maid attacks via UEFI Secure Boot custom key enrollment and self-signed kernel and bootloader.

Preface

You will find most of this information pulled from the Arch Wiki and other resources linked thereof.

Note: The system was installed on an NVMe SSD, substitute /dev/nvme0nX with /dev/sdX or your device as needed.

@xmagee
xmagee / react.js
Created August 5, 2021 03:38
Generic table
export default function App() {
const data1 = [
{
"name": "Jane Doe",
"email": "[email protected]",
"phone": "(123) 456-7890"
},
{
"name": "John Smith",
"email": "[email protected]",
@xmagee
xmagee / gists.json
Created August 3, 2021 20:16
Array of Gists to include in the react-gists webapp.
[
"2df62eabb09f6b0e095cd73dc6aab2de",
"06b2d742bb954109b422c338d58d91ca",
"4d190935e4e459272eb1c636b113956b",
"7309303ace6450209a46243176a0415d",
"e6b1034ec05bd41683ad51925988f2fc"
]
@xmagee
xmagee / Theme.js
Last active March 22, 2022 01:56
Theme Switcher / Component Themes
import { useState } from 'react'
import { MdBrightness3, MdBrightness7 } from 'react-icons/md'
function MyApp() {
const [ darkMode, toggleDarkMode ] = useState(true)
return (
<>
<button className={\`btn \${darkMode ? 'btn_dark' : 'btn_light'}\`}
onClick={() => { toggleDarkMode(!darkMode) }}>
@xmagee
xmagee / react.js
Created August 1, 2021 20:48
Make Custom Element as Component
function MyButton(props) {
return (
<button {...props}>
{props.title}
</button>
)
}
//use it in an app/another component:
function UseMyButton() {
@xmagee
xmagee / react.js
Created August 1, 2021 20:48
Loop Render Elements From Array
<ul>
{[1,2,3].map((i, index) => {
<li key={index}>
{i}
</li>
})}
</ul>
@xmagee
xmagee / react.js
Created August 1, 2021 20:47
Update State From Previous State
this.setState(prevState => {
return {
...prevState,
value : prevState.value + 10
}
})