Skip to content

Instantly share code, notes, and snippets.

View jerkovicl's full-sized avatar

Luka Jerković jerkovicl

View GitHub Profile
@taniarascia
taniarascia / auth.md
Last active February 11, 2024 23:16
JavaScript Authentication & Authorization Book/Course

Authentication in Real-World Web Apps with JavaScript

Outline of ideas, concepts to cover, potential projects to write.

Setup Idea

  • Book with a video for each chapter.

Prerequisites/Overview

{
"$schema": "https://aka.ms/terminal-profiles-schema",
"copyOnSelect": false,
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
// Add custom keybindings to this array.
// To unbind a key combination from your defaults.json, set the command to "unbound".
// To learn more about keybindings, visit https://aka.ms/terminal-keybindings
"keybindings":
[
// Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
@JustinGrote
JustinGrote / Add-Prompt.ps1
Last active August 20, 2019 07:25
Powerline Prompt Builder
function Add-Prompt {
<#
.SYNOPSIS
Builds a powerline-style prompt from segments
.DESCRIPTION
This command is used to build a prompt from existing segments, and automagically will figure out the colors for the
separators as necessary. You can insert additional colors into your string with ANSI escape sequences (don't use reset)
#>
[CmdletBinding()]

💜 FairyShell v 0.1 💜

A Windows Terminal Theme based on @sailorhg's Fairy Floss theme

N.B. This uses Powershell as my shell but you can change this by changing the commandline value in the profile below!

Instructions:

Optional pre-setup

  • If you want the font I use here install instructions can be found here else Consolas is a fine replacement untill Cascadia is out 💖
  • If you want the Fairy Floss graphic in the background, you can get it from here and save it to the directory where your profile.json file is stored in the next step.
@JustinGrote
JustinGrote / Send-SendGridMailMessage
Last active December 11, 2019 03:39
A drop-in replacement for Send-MailMessage. You can get a 100 email/day sendgrid API key for free at https://sendgrid.com
function Send-SendGridMailMessage {
[CmdletBinding()]
param (
[Parameter(Mandatory)][String[]]$To,
[Parameter(Mandatory)][String]$Subject,
[String]$Body,
[Parameter(Mandatory)][String]$From,
[Switch]$BodyAsHtml,
[String]$SendGridApiKey = $env:SENDGRID_API_KEY
)
@JustinGrote
JustinGrote / profile.ps1
Created July 30, 2019 22:13
VSCode Dark+ Powershell Profile
#VSCode Specific Theming
if ($env:TERM_PROGRAM -eq 'VSCode') {
if ($psedition -eq 'core') {
$ansiesc = "`e"
} else {
$ansiesc = [char]0x1b
}
Set-PSReadlineOption -Colors @{
Command = "$($ansiesc)[93m"
@JustinGrote
JustinGrote / Update-ModuleFast.ps1
Last active January 9, 2024 05:44
A faster implementation of Powershell's Update Module New Module check
throw 'This has moved to https://github.com/JustinGrote/ModuleFast'
@JustinGrote
JustinGrote / Remove-OldModule.ps1
Created July 26, 2019 17:35
Quickly remove old duplicate modules within each module-specific folder. Supports -whatif and confirms by default
#requires -version 5
function Remove-OldModule {
[CmdletBinding(SupportsShouldProcess,ConfirmImpact="High")]
param (
#Include deleting old versions of modules that might "ship" with modules
[Switch]$IncludeSystemProvidedModules,
#Exclude Specified modules. Must match the module name exactly
[String[]]$Exclude
)
@JustinGrote
JustinGrote / PoshGlyphs.ps1
Last active April 22, 2020 09:23
PoshGlyphs Easy to Use Special Characters
function Get-GlyphNerdFonts ($Name) {
$cache = [Runtime.Caching.MemoryCache]::Default
if ($cache['poshglyph-nfcollection']) {
$nfCollection = $cache['poshglyph-nfcollection']
} else {
[Regex]$glyphRegex = '<span><div class="class-name">(?<name>[\S<>]+)</div><div class="codepoint">(?<codepoint>\w+)</div></span>'
$glyphRegexMatches = $glyphRegex.Matches((Invoke-RestMethod -useb 'https://www.nerdfonts.com/'))
$nfcollection = [ordered]@{}
export TERM="xterm-256color" # This sets up colors properly
# workaround as per https://superuser.com/questions/1222867/zsh-completion-functions-broken
FPATH=$HOME/.oh-my-zsh/plugins/git:$HOME/.oh-my-zsh/functions:$HOME/.oh-my-zsh/completions:/usr/share/zsh/site-functions:/usr/share/zsh/$ZSH_VERSION/functions
export FPATH
# set shell
export SHELL=/usr/bin/zsh