Skip to content

Instantly share code, notes, and snippets.

@gcamp806
gcamp806 / auth.dart
Created Apr 1, 2020 — forked from nikhilmufc7/auth.dart
Firebase Flutter Platform Exception Codes and example
View auth.dart
// Error Codes for SignUp
ERROR_OPERATION_NOT_ALLOWED` - Indicates that Anonymous accounts are not enabled.
ERROR_WEAK_PASSWORD - If the password is not strong enough.
ERROR_INVALID_EMAIL` - If the email address is malformed.
ERROR_EMAIL_ALREADY_IN_USE - If the email is already in use by a different account.
ERROR_INVALID_CREDENTIAL` - If the [email] address is malformed.
// sending password reset email
ERROR_INVALID_EMAIL` - If the [email] address is malformed.
@gcamp806
gcamp806 / Program.cs
Created Jun 26, 2019 — forked from marcel-valdez/Program.cs
Arris TM602A password of the day generator
View Program.cs
/*
* Arris TM602A password of the day generator
*
* Author of Original JavaScript Version: Raul Pedro Fernandes Santos
* Author of this C# Code: Marcel Valdez Orozco
* Project homepage for JavaScript Version: http://www.borfast.com/projects/arrispwgen
*
* This software is distributed under the Simplified BSD License.
*
* Copyright 2012 Marcel Valdez Orozco. All rights reserved.
@gcamp806
gcamp806 / timestamp.md
Last active Oct 24, 2018
Script to add timestamp to every line of a log file
View timestamp.md

How to add a timestamp to every line of a log file

There are occasions where you would like to have a log file include a timestamp for each line. The following script will allow you to do just that.

timestamp.sh

#!/bin/bash
while read x; do
    echo -n `date +\[%Y-%m-%d\ %H:%M:%S.%3N]`;
    echo -n " ";
    echo $x;
@gcamp806
gcamp806 / Constants.swift
Last active May 16, 2018
Swift constants
View Constants.swift
struct Const {
struct Mod {
static let job = 6
static let jobInfo = 1
static let jobPhase = 2
static let jobEquip = 3
static let equipment = 5
static let forms = 7
View initial-ubuntu-config.txt
apt install vim
sudo update-alternatives --config editor (select vim.basic)
visudo - change %sudo line to this (adding NOPASSWD: in front of ALL)
%sudo ALL=(ALL:ALL) NOPASSWD:ALL
@gcamp806
gcamp806 / cheatsheet.md
Created Dec 18, 2017
Terminal cheatsheet for macOS
View cheatsheet.md

Terminal Cheatsheet for Mac (Basics)


Letters are shown capitalized for readability only. Capslock should be off.

SHORTCUTS

Key/Command Description
Ctrl + A Go to the beginning of the line you are currently typing on. This also works for most text input fields system wide. Netbeans being one exception
@gcamp806
gcamp806 / Default (OSX).sublime-keymap -- User
Created Nov 13, 2017 — forked from mnme/Default (OSX).sublime-keymap -- User
Sublime Text 2 and 3: fix for OSX home/end keys, with selection support and command (super) key
View Default (OSX).sublime-keymap -- User
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} },
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} },
{ "keys": ["shift+end"], "command": "move_to", "args": {"to": "eol", "extend": true} },
{ "keys": ["shift+home"], "command": "move_to", "args": {"to": "bol", "extend": true } },
{ "keys": ["super+end"], "command": "move_to", "args": {"to": "eof"} },
{ "keys": ["super+home"], "command": "move_to", "args": {"to": "bof"} },
{ "keys": ["super+shift+end"], "command": "move_to", "args": {"to": "eof", "extend": true} },
{ "keys": ["super+shift+home"], "command": "move_to", "args": {"to": "bof", "extend": true } },
@gcamp806
gcamp806 / macOS-.bash_profile
Last active Nov 1, 2017
macOS-bash profile/rc scripts
View macOS-.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
@gcamp806
gcamp806 / .bash_gcamp
Last active May 9, 2018
My custom bashrc script
View .bash_gcamp
#!/bin/bash
# Greg's custom bash stuff
# Executed by ~/.bashrc, e.g. source ~/.bash_gcamp
###export EDITOR='sublime'
# prompt helper functions
function parse_git_dirty
{
if [ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1; then
#[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] && echo "✘ " || echo "✔ "
@gcamp806
gcamp806 / homebrew_install_macOS.txt
Last active Apr 10, 2020
Homebrew install on macOS
View homebrew_install_macOS.txt
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install libdvdcss
**PRELIMINARY**
// Install Xcode Tools: xcode-select --install
// Install Homebrew: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
**CASK**
//Install Cask brew install cask