Skip to content

Instantly share code, notes, and snippets.

View awsomesawce's full-sized avatar
🎯
Learning NodeJS and getting certified!

Carl C awsomesawce

🎯
Learning NodeJS and getting certified!
View GitHub Profile
@awsomesawce
awsomesawce / AliasCreation.ps1
Created July 27, 2021 00:11
Demo of alias and function creation in Powershell scripts
#!/usr/bin/env -S pwsh -noprofile
<#
.Description
Showing how aliases (and functions) can be created easily in Powershell Core scripts
#>
# You can create aliases inside scripts very easily
# They will exist only within the scope of the script.
# You don't have to worry about spillage of alias and function definitions to
@awsomesawce
awsomesawce / getpsenv.ps1
Last active July 29, 2021 22:58
Nodejs utility functions for Powershell.
#!/usr/bin/env -S pwsh -nop
<#
.Description
Get psenv file from gist
.Version 0.2.1
#>
$gisturl = "https://gist.githubusercontent.com/awsomesawce/f37c910c245ed409fa6da84edf716dd9/raw/e8adc7e69ab23f98afc016a95fad83f10636b737/psenv.ps1"
# Use a higher tls version
@awsomesawce
awsomesawce / README.md
Created July 20, 2021 17:30 — forked from watson/README.md
A list of search and replace unix commands to help make a node repository 'standard' compliant

The standard code style linter is a great tool by Feross - check it out!

Remove trailing semicolons:

find . -path ./node_modules -prune -o -type f -name '*.js' -exec sed -i '' -e 's/;$//' {} \;

Ensure space between function and opening bracket:

@awsomesawce
awsomesawce / redirection_ex.sh
Last active July 6, 2021 00:16
Bash redirection examples
#!/usr/bin/env bash
# Interesting ways of using redirection to get distro info
# Shoutout to neofetch and screenfetch
find_distro () {
# This if statement uses the `< ./filename` redirection instead of cat
if [[ -f /etc/lsb-release && $(< /etc/lsb-release) == *Ubuntu* ]]
then
echo "It is Ubuntu"
return 0
@awsomesawce
awsomesawce / curly_conditionals.zsh
Created June 24, 2021 21:02
Zsh Curly Bracket Conditionals
#!/usr/bin/env -S zsh -f
# Curly-bracket conditional expressions in Zsh.
#
# Tired of the strangeness of the `if condition; then blah; fi` syntax?
# **Zsh** supports using _curly brackets_ to separate your conditional expressions!
# This makes it more similar to every other programming language out there, including
# **Powershell**.
get_first_line() {
if [[ $# -eq 0 ]] {
@awsomesawce
awsomesawce / FileSystemFuncs.bash
Last active June 4, 2021 04:10
List of filesystem-related functions for bash.
#!/bin/bash
# Name: FileSystemFuncs.bash
# Description: List of file system functions for bash
# Author: Carl C.
# Date: 6/4
# get_full_filenames USAGE:
# ./get_full_filenames /path/to/dir
# Outputs full pathname to each member of the directory separated by newlines.
@awsomesawce
awsomesawce / get_fullname_files.bash
Created June 4, 2021 03:57
Returns newline-separated list of files in a directory. Useful to iterate over an entire directory or place in an array variable.
#!/bin/bash
# Get_Full_Filenames aka ./gff
# Author: Carl C. (awsomesawce at outlook dot com)
########## USAGE ##########
# ./gff /path/to/dir
# Outputs full pathname to each member of the directory separated by
#+newlines.
#### USAGE WITH ARRAYS ####
# typeset -a myArr
# myArr=($(./gff ~/testdir)) # myArr will then contain an indexed array with fullnames of
@awsomesawce
awsomesawce / pwshClassesEx1.ps1
Last active May 12, 2021 02:27
Powershell_Classes_Ex1
# Classes demonstration
# created from command line
class Person {
[string]$name
[string]$bodytype
[int]$age
}
# And then:
$person.age = 35
@awsomesawce
awsomesawce / README.md
Created October 4, 2020 07:07 — forked from hofmannsven/README.md
Git Cheatsheet
@awsomesawce
awsomesawce / Best Nuclear Throne weapons.md
Last active September 27, 2020 13:48
Best Nuclear Throne weapons

Best Nuclear Throne Weapons

Weapon Ammo Special properties
Super Splinter Gun 2 bolts Wide spread, average rate of fire, can home in using mutation
Heavy Machinegun 2 bullets High damage,
mutation can be used to lower ammo use.
Uncommon
Gatling Slugger 1 shell High rate of fire, same dmg as regular Slugger
Heavy Slugger 2 shells High reload time, very low
range
Auto Crossbow 1 bolt High rate of fire, same dmg as regular Crossbow
Dragon 1 explosive High rate of fire, High range, High spread