Skip to content

Instantly share code, notes, and snippets.

View Alk3m1st's full-sized avatar

Allan Oliveira Alk3m1st

View GitHub Profile
@Alk3m1st
Alk3m1st / alstheme.omp.json
Last active August 8, 2024 04:59
Custom Oh-My-Posh them based off the "montys" theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"version": 2,
"final_space": true,
"secondary_prompt": {
"background": "transparent",
"foreground": "#ffffff",
"template": "-> "
},
"blocks": [
@Alk3m1st
Alk3m1st / conventional-branch.zsh
Created February 21, 2023 05:00
Zsh script for creating a new git branch following a conventional commit style
#!/bin/zsh
echo "Enter a Conventional Commit type (feat, fix, docs, style, refactor, test or chore):"
read type
echo "Enter a Conventional Commit scope if needed or just press Enter (e.g. Frontend, Backend, UI, etc.):"
read scope
echo "Enter a branch name (ideally just the JIRA number or starting with it):"
read branch_name
@Alk3m1st
Alk3m1st / test-coverage.md
Last active October 5, 2022 12:03
Run test coverage on a create-react-app

Get a test coverage report in a create-react-app

Run the following command to get coverage with your normal jest tests

npm run test -- --coverage .

You can shift this into the scripts section of package.json too, e.g.

"test:coverage": "react-scripts test --coverage ."

@Alk3m1st
Alk3m1st / Dev Env Setup (Windows).md
Last active April 7, 2020 02:16
Notes around my Dev Env Setup
@Alk3m1st
Alk3m1st / Backup Azure Storage Account.ps1
Created August 3, 2018 01:19
Back up all your Azure BLOB storage containers from one account to another. Relies on azure cmdlets and AzCopy tool.
param(
[String]$ProjectNameToDecommission,
[String]$SourceAccountName,
[String]$SourceAccountKey,
[String]$DestinationAccountKey,
[Int32]$MaxCount=100 # Number of containers to move at a time
)
$DestinationAccountName="nameofdestinationaccount" # We'll always use this account
if ($SourceAccountName -eq $DestinationAccountName) {
@Alk3m1st
Alk3m1st / CreateFoldersFromTxtList.ps1
Created April 24, 2017 03:09
PowerShell script to create a bunch of windows folders from a list in a txt file.
$folder="I:\Folder\Location"; # Directory to place the new folders in.
$txtFile="I:\Folder\Location\The List.txt"; # File with list of new folder-names
$pattern="\d+.+"; # Pattern that lines must match
get-content $txtFile | %{
if($_ -match $pattern)
{
mkdir "$folder\$_";
@Alk3m1st
Alk3m1st / ScrumCardFlexboxCSS.html
Created December 16, 2016 02:58
Create cards easily to print out with flexbox + emmet stuff
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
body {
font-size: 62.5%;
}
@Alk3m1st
Alk3m1st / DownTheImages.ps1
Created June 29, 2016 01:21
Powershell to download images from known Authenticated URL via CSV exported file
# Log in to Portal
$vars = @{UserName='username';Password='********'} # Fieldnames may change with different forms
$login = Invoke-WebRequest https://site.com/Auth/LogOn -SessionVariable sv # Save session in 'sv'
$mainPage = Invoke-WebRequest https://site.com/Auth/Logon -WebSession $sv -Body $vars -Method Post
# RegEx Stuff to strip filenames
$pattern = '[^a-zA-Z]'
# Open the CSV (From a Table export linked to File Ids, assuming file download at known URL+Id)
$path = "C:\Path\To\CSV\export.csv"
(dir -include *.cs,*.html,*.cshtml,*.config,*.json,*.css,*.js,*.sql -recurse | select-string .).Count
// Place your settings in this file to overwrite the default settings
{
"externalTerminal.windowsExec": "powershell",
"eslint.enable": true,
"eslint.options": {
"rules": {
/* airbnb style rules */
// enforce spacing inside array brackets