Skip to content

Instantly share code, notes, and snippets.

View saninmersion's full-sized avatar

Sandip Shrestha saninmersion

View GitHub Profile
@saninmersion
saninmersion / Day 1:1.js
Last active December 3, 2019 09:18
Advent of Code 2019 solutions
let totalFuel = inputs.reduce( (acc, mass) => (acc + Math.floor((mass / 3 - 2 )), 0)
@saninmersion
saninmersion / Loader.vue
Created July 29, 2019 04:52
Loader Component in Vue.js
//Loader Component
<template>
<div v-if="isVisible" class="loader-overlay">
<div class="loader"></div>
<span class="text" v-html="text"></span>
</div>
</template>
<script>
@saninmersion
saninmersion / component_slug.vue
Created July 24, 2019 07:48
Slug Component Example
<template>
<input type="text" v-model="value">
</template>
<script type="text/ecmascript-6">
export default {
name: "slug",
props: {
title:{ default:"" }
@saninmersion
saninmersion / axios_interceptor_in_vue_app_component.js
Last active January 7, 2020 15:15
Axios Interceptor in vue js main app component
new Vue({
el: "#app",
mounted() {
this.enableInterceptor()
},
data: {
isLoading: false,
axiosInterceptor: null,
},
methods: {
@saninmersion
saninmersion / pokemon_data.json
Created July 13, 2019 16:35
Pokeapi extracted data
[
{
"id": 1,
"name": "bulbasaur",
"height": 0.7,
"weight": 6.9,
"species": "Seed Pokémon",
"types": [
"poison",
"grass"
@saninmersion
saninmersion / gitflow-breakdown.md
Created April 2, 2019 08:16 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@saninmersion
saninmersion / layout_debugger.md
Created February 21, 2019 09:26
CSS Layout Debugger

CSS Layout Debugger A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

[].forEach.call($$(""),function(a){a.style.outline="1px solid #"+(~~(Math.random()(1<<24))).toString(16)})

@saninmersion
saninmersion / FormComponent.vue
Created November 5, 2018 10:46
Vue Components Reference
import Vue from 'vue';
import Form from "../../front-section/services/Form";
Vue.component('user-form', {
data() {
return {
form: new Form(),
values: {},
fileInput: {},
}
@saninmersion
saninmersion / git-commands.md
Created July 5, 2018 04:20 — forked from puncoz/git-commands.md
Useful git commands

Useful git commands

Get local branch count

git branch | wc -l

Delete all merged branch from local

git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d

Update only date time of last commit

git commit --amend --date="$(date -R)" This will trigger a 'git commit --amend' action