Skip to content

Instantly share code, notes, and snippets.

Avatar
😱

Brandon Sarà bsara

😱
View GitHub Profile
@bsara
bsara / git-ssh-auth-win-setup.md
Last active Mar 8, 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 / js.gitignore
Last active Feb 28, 2021
.gitignore File for JavaScript Projects
View js.gitignore
#---------------------------------------#
# Project Ignores #
#---------------------------------------#
# output
/.temp
/.tmp
/build
/dist
@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 / .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 / TimeZonePreference.java
Last active May 25, 2020
Android Preference for Selecting a Time Zone
View TimeZonePreference.java
/*
The MIT License (MIT)
Copyright (c) 2014 Brandon Dale Sara
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@bsara
bsara / LF.gitattributes
Last active Apr 8, 2020
General .gitattributes File
View LF.gitattributes
# Project
* text eol=lf
# Language Diffs
*.cs diff=csharp
*.css diff=css
@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
@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 / _unit-conversions.scss
Last active Jan 18, 2018
Sass Unit Conversions
View _unit-conversions.scss
// ----
// Sass (v3.4.13)
// Compass (v1.0.3)
// ----
////
/// @group Unit Conversions
/// @author Brandon Sara <brandon.sara@ldschurch.org>
////
@bsara
bsara / url.regex
Last active Oct 20, 2017
Regex: URLs
View url.regex
(f|ht)tp(s)?://([A-Za-z0-9-]+\.)+[A-Za-z0-9-]+(/[A-Za-z0-9- ./?%&=]*)?