Skip to content

Instantly share code, notes, and snippets.

View bsara's full-sized avatar
😱

Brandon Sarà bsara

😱
View GitHub Profile
@bsara
bsara / vs.gitignore
Last active March 28, 2022 15:09
.gitignore File for Visual Studio Projects
#---------------------------------------#
# Project Ignores #
#---------------------------------------#
#---------------------------------------#
# IDEs & Editors Ignores #
#---------------------------------------#
# Sublime Text
@bsara
bsara / monitor-temp.sh
Created October 30, 2014 20:48
Raspberry Pi Raspbian CPU Temperature Monitoring Script
#!/bin/bash
echo "Press [ctrl+c] to end monitoring"
echo ""
while true
do
vcgencmd measure_temp
sleep 3s
done
@bsara
bsara / .bash_aliases
Last active March 28, 2022 15:09
Useful Bash Aliases
# Misc
alias oh="nemo . 2>/dev/null"
alias ohh="nautlius . 2>/dev/null"
alias cls=clear
alias lsa="ls -al"
alias ..="cd .."
alias ...="cd ../.."
# Google Chrome
@bsara
bsara / hosts
Created August 21, 2014 22:21
Parental Control via Hosts File (Blocks Ads, Pornographic Sites, Gambling Sites, & Risky Sites)
This file has been truncated, but you can view the full file.
############################################
# Generated by: JRummy Apps Inc. #
# Like us on Facebook #
# http://www.facebook.com/JRummyApps #
############################################
# hosts.adblock - romtoolbox
127.0.0.1 0.r.msn.com
127.0.0.1 000-search.net
@bsara
bsara / .gitignore_global
Last active March 28, 2022 15:10
Global .gitignore
#---------------------------------------#
# General Ignores #
#---------------------------------------#
*~
*.orig
.vagrant
#---------------------------------------#
@bsara
bsara / create-directory.psm1
Last active March 28, 2022 15:10
PowerShell: Function that creates a directory if it doesn't exist, does NOT throw an error if directory already exists
function Create-Directory($dirPath) {
if (!(Test-Path $dirPath)) {
New-Item -ItemType directory -Path $dirPath
}
}
@bsara
bsara / SassMeister-input.scss
Last active March 28, 2022 15:13
Generated by SassMeister.com.
// ----
// 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 / LF.gitattributes
Last active November 14, 2022 12:36
General .gitattributes File
# Project
* text eol=lf
# Language Diffs
*.cs diff=csharp
*.css diff=css
@bsara
bsara / url.regex
Last active February 17, 2023 18:41
Regex: URLs
(f|ht)tp(s)?://([A-Za-z0-9-]+\.)+[A-Za-z0-9-]+(/[A-Za-z0-9- ./?%&=]*)?
@bsara
bsara / twos-complement.js
Created March 10, 2016 21:18
A simple function that returns the two's complement binary representation of a given number
/**
* @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) {