Skip to content

Instantly share code, notes, and snippets.

View Adarshreddyash's full-sized avatar
:octocat:
Building Vuejs projects

Adarshreddy adelli Adarshreddyash

:octocat:
Building Vuejs projects
View GitHub Profile
@Adarshreddyash
Adarshreddyash / gsi-with-nuxt.md
Created August 7, 2022 11:33 — forked from srestraj/gsi-with-nuxt.md
Integrate Google Sign-in and One-tap with Nuxt.js

Integrate Google Sign-in (Popup method) with Nuxt.js - Works in Incognito mode as well

Add GSI client in your nuxt.config.js
export default {
  ...
  head: {
    ...
@Adarshreddyash
Adarshreddyash / haversine.py
Created May 11, 2022 17:18 — forked from ncole458/haversine.py
Django Haversine Formula Queryset
"""
Find user/database entries within a km radius based on long/lat co-ords.
i.e. return all objects where longlat lies within 10km of my current long/lat.
Using with Django REST Framework but approach is same for any similar req.
"""
import math
def get_queryset(self):
user = self.request.user
lat = self.request.query_params.get('lat', None)
@Adarshreddyash
Adarshreddyash / docker-compose.yml
Created May 13, 2021 09:41
strapi docker compose
version: '3'
services:
strapi:
image: strapi/strapi
environment:
DATABASE_CLIENT: postgres
DATABASE_NAME: strapi
DATABASE_HOST: postgres
DATABASE_PORT: 5432
DATABASE_USERNAME: strapi
methods: {
uploadImage(event) {
let img = new FormData();
img.append("avatar", event.target.files[0]);
const base = {
baseURL: this.$store.state.endpoints.baseUrl,
headers: {
// JWT token !!!
Authorization: `JWT ${this.$store.state.jwt}`,
"Content-Type": "multipart/form-data"
<v-btn
color="green"
x-small
<!-- v-show="!$store.state.authUser.avatar" Iam using vuex to show the button when user is having no avatar-->
outlined
:loading="isSelecting"
@click="onButtonClick"
>
<v-icon left>mdi-cloud-upload-outline</v-icon>upload picture
</v-btn>
#docker version
version: '3'
services:
web:
#this sets build directory
build: .
#making migrations and fire up server
command: bash -c "python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
container_name: music_api
# official Python runtime as a parent image
FROM python:3.6
# enviroment variables
ENV PYTHONUNBUFFERED 1
# create root directory
RUN mkdir /music_api
# Set the working directory
⣿⣿⣿⣿⣿⣍⠀⠉⠻⠟⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⠓⠀⠀⢒⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⡿⠃⠀⠀⠀⠀⠈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⣿
⣿⡿⠋⠋⠀⠀⠀⠀⠀⠀⠈⠙⠻⢿⢿⣿⣿⡿⣿⣿⡟⠋⠀⢀⣩
⣿⣿⡄⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠈⠉⠛⢷⣭⠉⠁⣿⣿
⣇⣀. jai hind ⠘⣿⣿⣿ ⣶⣿
⣿⣄⠀⣰⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⢀⣠⣿⣿⣿⣾⣿⣿⣿
⣿⣿⣿⣿⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⢀⣠⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀ ⠀⣤⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
import Vue from 'vue'
import VueRouter from 'vue-router'
import Signup from '../views/Signup.vue'
import Portfolio from '@/components/Portfolio';
import Songs from '@/components/Songs'
Vue.use(VueRouter)
const routes = [
{
<template>
<v-app>
<v-app-bar
app
color="primary_bg"
dark
dense
>
<div class="d-flex align-center">
<v-toolbar-title>Ronix</v-toolbar-title>