Skip to content

Instantly share code, notes, and snippets.

@Fanna1119
Fanna1119 / countries.js
Created October 2, 2022 15:13
object literal for country info using ISO 2 as key
const c = {
"AF": {
"Country": "Afghanistan",
"Alpha-2 code": "AF",
"Alpha-3 code": "AFG",
"Numeric code": 4,
"Latitude (average)": 33,
"Longitude (average)": 65,
"emoji_flag": "🇦🇫"
},
@Fanna1119
Fanna1119 / App.vue
Last active July 19, 2021 10:18
vue router animations
<template>
<div>
<nav-bar />
<router-view v-slot="{ Component }">
<transition @enter="fadeIn" @leave="fadeOut" v-bind:css="false" mode="out-in">
<component :is="Component" />
</transition>
</router-view>
</div>
</template>
@Fanna1119
Fanna1119 / commands.sh
Last active May 24, 2021 10:07
handy linux commands
# command for burning to flash drive
sudo dd if=yourISO.iso of=/dev/sdb status=progress
# delete all node modules in dir
find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \;
@Fanna1119
Fanna1119 / store2.js
Created April 7, 2021 13:26
store update
import { defineStore } from 'pinia'
import { useStorage } from '@vueuse/core'
export const useMainStore = defineStore({
id: 'main',
state: () => ({
todos: useStorage('todos', [])
}),
getters: {
getAllTodos() {
@Fanna1119
Fanna1119 / App.vue
Last active April 7, 2021 13:15
pinia todo
<template>
<input type="text" v-model="mytodo" />
<button @click="AddTodo">Add Todo</button>
<div v-if="!isEmpty">
<p v-for="(todo, index) in todos" :key="index">
{{ index }}. {{ todo }} <button @click="removeTodo(index)">delete</button>
</p>
</div>
<div v-else>No todos found</div>
</template>
@Fanna1119
Fanna1119 / store.js
Last active April 7, 2021 13:01
pinia store
import { defineStore } from 'pinia'
export const useMainStore = defineStore({
id: 'main',
state: () => ({
todos: [],
}),
getters: {
getAllTodos() {
return this.todos
@Fanna1119
Fanna1119 / index.html
Last active March 25, 2021 11:44
snackvanilla
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<fieldset>
@Fanna1119
Fanna1119 / vuex.js
Created March 10, 2021 17:02
vuex3
import Vue from 'vue';
import Vuex from 'vuex';
import createPersistedState from "vuex-persistedstate";
Vue.use(Vuex);
export const store = new Vuex.Store({
plugins: [createPersistedState()],
state: {
scrums: [],
activescrum: '',
import add from "lodash-es/add";
import after from "lodash-es/after";
import ary from "lodash-es/ary";
import assign from "lodash-es/assign";
import assignIn from "lodash-es/assignIn";
import assignInWith from "lodash-es/assignInWith";
import assignWith from "lodash-es/assignWith";
import at from "lodash-es/at";
import attempt from "lodash-es/attempt";
import before from "lodash-es/before";
<template>
<main class="hero-full">
<div class="text-center text-6xl font-bold text-white hero-body">
<router-view />
<Footer />
</div>
</main>
</template>