This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from graphene import relay, String, List | |
from graphene_django.filter import DjangoFilterConnectionField | |
from graphene_django.fields import DjangoConnectionField | |
from app.models import Model | |
class Object(DjangoObjectType): | |
class Meta: | |
model = Model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator | |
# First we create a little helper function, becase we will potentially have many PaginatedTypes | |
# and we will potentially want to turn many querysets into paginated results: | |
def get_paginator(qs, page_size, page, paginated_type, **kwargs): | |
p = Paginator(qs, page_size) | |
try: | |
page_obj = p.page(page) | |
except PageNotAnInteger: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Authorization with django-graphene | |
# using django-jwt-auth==0.0.2 | |
from django.conf.urls import url | |
from django.views.decorators.csrf import csrf_exempt | |
from graphene_django.views import GraphQLView | |
from jwt_auth.mixins import JSONWebTokenAuthMixin | |
class AuthGraphQLView(JSONWebTokenAuthMixin, GraphQLView): |
- Assuming you have multiple Heroku apps and Git remote like so:
development https://git.heroku.com/xxx.git (fetch)
development https://git.heroku.com/xxx.git (push)
origin git@bitbucket.org:xxx/xxx.git (fetch)
origin git@bitbucket.org:xxx/xxx.git (push)
production https://git.heroku.com/xxx.git (fetch)
production https://git.heroku.com/xxx.git (push)
staging https://git.heroku.com/xxx.git (fetch)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="main-wrapper"> | |
<div class="header"><h1>Vue Shopping Cart</h1></div> | |
<div id="vue"> | |
<cart :cart="cart" :cart-sub-total="cartSubTotal" :tax="tax" :cart-total="cartTotal" :checkout-bool="checkoutBool"></cart> | |
<products :cart="cart" :cart-sub-total="cartSubTotal" :tax="tax" :cart-total="cartTotal" :products-data="productsData"></products> | |
<checkout-area v-if="checkoutBool" :cart="cart" :tax="tax" :cart-sub-total="cartSubTotal" :cart-total="cartTotal" :products-data="productsData" :total-with-tax="totalWithTax"></checkout-area> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:http/http.dart' as http; | |
import 'dart:convert'; | |
import 'package:url_launcher/url_launcher.dart'; | |
import 'package:intl/intl.dart'; | |
import 'dart:async'; | |
import 'package:shared_preferences/shared_preferences.dart'; | |
import 'package:share/share.dart' as sharing; | |
import 'package:transparent_image/transparent_image.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Directive, ElementRef, Input, OnDestroy, OnInit } from '@angular/core'; | |
import { Keyboard } from '@ionic-native/keyboard'; | |
import { Content, Platform } from 'ionic-angular'; | |
import { Subscription } from 'rxjs/Subscription'; | |
/** | |
* @name KeyboardAttachDirective | |
* @source https://gist.github.com/Manduro/bc121fd39f21558df2a952b39e907754 | |
* @description |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head></head> | |
<body> | |
<input type="file" class="js-fileElem" multiple accept="image/*" style="display:none"> | |
<a href="#" class="js-fileSelect">Select some files</a> | |
<script src="https://www.gstatic.com/firebasejs/3.8.0/firebase.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<input type="file" multiple accept="image/*" @change="detectFiles($event.target.files)"> | |
<div class="progress-bar" :style="{ width: progressUpload + '%'}">{{ progressUpload }}%</div> | |
</div> | |
</template> | |
<script> |