Skip to content

Instantly share code, notes, and snippets.

Avatar
😱

Brandon Sarà bsara

😱
View GitHub Profile
@bsara
bsara / .gitconfig
Last active Oct 27, 2020
Standard .gitconfig sections
View .gitconfig
[branch]
autosetuprebase = always
[core]
autocrlf = false
ignorecase = false
[push]
default = simple
[pull]
default = simple
@bsara
bsara / git-ssh-auth-win-setup.md
Last active Apr 6, 2021
Setup SSH Authentication for Git Bash on Windows
View git-ssh-auth-win-setup.md

Setup SSH Authentication for Git Bash on Windows

Prepararation

  1. Create a folder at the root of your user home folder (Example: C:/Users/uname/) called .ssh.
  2. Create the following files if they do not already exist (paths begin from the root of your user home folder):
    • .ssh/config
@bsara
bsara / create-directory.psm1
Last active Mar 24, 2016
PowerShell: Function that creates a directory if it doesn't exist, does NOT throw an error if directory already exists
View create-directory.psm1
function Create-Directory($dirPath) {
if (!(Test-Path $dirPath)) {
New-Item -ItemType directory -Path $dirPath
}
}
@bsara
bsara / win10_remove-preinstalled-apps.ps1
Last active Jun 26, 2017
Removes all unneeded pre-installed apps from Windows 10
View win10_remove-preinstalled-apps.ps1
Get-AppxPackage *3dbuilder* | Remove-AppxPackage
Get-AppxPackage *bingfinance* | Remove-AppxPackage
Get-AppxPackage *bingnews* | Remove-AppxPackage
Get-AppxPackage *bingsports* | Remove-AppxPackage
Get-AppxPackage *bingweather* | Remove-AppxPackage
Get-AppxPackage *getstarted* | Remove-AppxPackage
Get-AppxPackage *officehub* | Remove-AppxPackage
Get-AppxPackage *onenote* | Remove-AppxPackage
Get-AppxPackage *people* | Remove-AppxPackage
Get-AppxPackage *photos* | Remove-AppxPackage
@bsara
bsara / twos-complement.js
Created Mar 10, 2016
A simple function that returns the two's complement binary representation of a given number
View twos-complement.js
/**
* @param {Number} value
* @param {Number} [bitCount = 0]
*
* @returns {String} binary representation of the two's complement of `value`.
*/
function twosComplement(value, bitCount) {
let binaryStr;
if (value >= 0) {
@bsara
bsara / js.gitignore
Last active Feb 28, 2021
.gitignore File for JavaScript Projects
View js.gitignore
#---------------------------------------#
# Project Ignores #
#---------------------------------------#
# output
/.temp
/.tmp
/build
/dist
@bsara
bsara / LF.gitattributes
Last active Mar 30, 2021
General .gitattributes File
View LF.gitattributes
# Project
* text eol=lf
# Language Diffs
*.cs diff=csharp
*.css diff=css
@bsara
bsara / SassMeister-input.scss
Last active Aug 29, 2015
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
@function prepend-slash($value) {
@return unquote('"\\#{$value}"');
}
// calling `prepend-slash` is only necessary when using a variable
@bsara
bsara / DotNET.gitattributes
Last active Sep 2, 2018
.gitattributes File for .NET Projects
View DotNET.gitattributes
# Project
* text eol=crlf
# .NET Framework
*.dll binary diff=exif
*.exe binary diff=exif
@bsara
bsara / CRLF.gitattributes
Last active Oct 20, 2018
General .gitattributes File with Windows Line Endings (CRLF)
View CRLF.gitattributes
# Project
* text eol=crlf
# Language Diffs
*.cs diff=csharp
*.css diff=css