Skip to content

Instantly share code, notes, and snippets.

@arturslab
arturslab / YourComponent.ts
Created July 5, 2024 20:23
Simple Vue.js helper that allows you to calculate a new date that is shifted by a specified number of days, months, or years relative to a given date (or the current date if no date is provided)
import { defineComponent, ref, onMounted } from 'vue';
import moment from 'moment';
import { getAdjustedDate } from './path/to/your/helper/file/helpers.ts'; // Make sure the path is correct
export default defineComponent({
name: 'MyComponent',
setup() {
const dateToday = ref(moment().format('YYYY-MM-DD'));
const tenDaysLater = ref('');
const twoMonthsEarlier = ref('');
@arturslab
arturslab / Microsoft.PowerShell_profile.ps1
Created June 8, 2024 20:07
PowerShell custom prompt with some informations about GIT commits, npm and node version. More details on https://melma.pl/blog/powershell-prompt-i-git/
function Write-Date {
$date = Get-Date -Format "dddd MM/dd/yyyy HH:mm"
Write-Host "$date " -BackgroundColor "black" -ForegroundColor "yellow"
}
# Print current version of node.js
function Write-NodeVer {
# This try gracefully handles when node isn't available
try {
$iconNode = "" # icon node