Skip to content

Instantly share code, notes, and snippets.

View mvfsillva's full-sized avatar
🦁
Hope

Marcus mvfsillva

🦁
Hope
  • Vancouver, BC
View GitHub Profile
@mvfsillva
mvfsillva / keybindings.json
Created July 24, 2024 18:24
vs-code-keybindings.json
[
{
"command": "projectManager.listGitProjects#sideBarGit",
"key": "cmd+o"
},
{
"command": "expand_region",
"key": "ctrl+=",
"when": "editorTextFocus"
},
@mvfsillva
mvfsillva / settings.json
Created July 24, 2024 18:23
vs-code-settings.json
{
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
@mvfsillva
mvfsillva / main.dart
Created January 26, 2024 03:56
tropical-flora-5517
String calculateAge(DateTime birthdate) {
DateTime currentDate = DateTime.now();
int years = currentDate.year - birthdate.year;
int months = currentDate.month - birthdate.month;
int days = currentDate.day - birthdate.day;
if (days < 0) {
DateTime lastMonth =
DateTime(currentDate.year, currentDate.month - 1, birthdate.day);
@mvfsillva
mvfsillva / main.dart
Created January 26, 2024 03:07
sparkling-snowflake-9107
String calculateAge(DateTime birthdate) {
DateTime currentDate = DateTime.now();
Duration difference = currentDate.difference(birthdate);
int years = (difference.inDays / 365.25).floor();
DateTime birthdateCopy =
DateTime(birthdate.year, birthdate.month, birthdate.day);
birthdateCopy = DateTime(currentDate.year, birthdate.month, birthdate.day);
void main() {
DateTime birthdate = DateTime(2023, 9, 27);
print(calculateAge(birthdate));
}
@mvfsillva
mvfsillva / github_gpg_key.md
Created November 7, 2018 15:58 — forked from ankurk91/github_gpg_key.md
Github : Signing commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
@mvfsillva
mvfsillva / MongoDB_macOS_Sierra.md
Created October 23, 2018 16:47 — forked from nrollr/MongoDB_macOS_Sierra.md
Install MongoDB on Sierra using Homebrew

Install MongoDB on macOS Sierra

This procedure explains how to install MongoDB using Homebrew on macOS Sierra 10.12.
Official MongoDB install documentation: here

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@mvfsillva
mvfsillva / GitCommitEmoji.md
Created August 4, 2018 06:53 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
@mvfsillva
mvfsillva / .vimrc
Created November 22, 2017 18:43 — forked from marinalimeira/.vimrc
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@mvfsillva
mvfsillva / NonoDigito
Created July 18, 2014 20:30
Função para tratamento do nono digito de telefone celular
public static string NonoDigito(string f)
{
string fTemp = null;
fTemp = f.Replace("(", "").Replace(")", "").Replace(" ", "").Replace("-", "");
string ddd = "|11|12|13|14|15|16|17|18|19|21|22|24|27|28|";
if (ddd.IndexOf("|" + fTemp.Substring(0, 2) + "|") > -1 && fTemp.Length == 10 && Strings.Mid(fTemp, 3, 1) > 7) {
return (string.Format("{0:(##) 9####-####}", Convert.ToInt64(fTemp)));
} else {