Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Kleber Soares klebercode

🎯
Focusing
Block or report user

Report or block klebercode

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@santoshshinde2012
santoshshinde2012 / Build Ionic 2 Cordova Apps For Specific Platform Version (config.xml)
Last active Oct 8, 2019
Build Ionic 2 Cordova Apps For Specific Platform Version (config.xml)
View Build Ionic 2 Cordova Apps For Specific Platform Version (config.xml)
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.hellocordova" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>HelloCordova</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="dev@cordova.apache.org" href="http://cordova.io">
Apache Cordova Team
View start_review.sh
#!/bin/bash
command_exists () {
type "$1" &> /dev/null ;
}
export GITHUB_REPO="user/repo"
export GITHUB_USERNAME=$(cat ~/.githubrc 2> /dev/null | grep user.login | cut -d ":" -f2 | xargs)
export GITHUB_PASSWORD=$(cat ~/.githubrc 2> /dev/null | grep user.password | cut -d ":" -f2 | xargs)
if [ -z "$GITHUB_USERNAME" ]
View start_work.sh
#!/bin/bash
export GITHUB_REPO="user/repo"
export GITHUB_USERNAME=$(cat ~/.githubrc 2> /dev/null | grep user.login | cut -d ":" -f2 | xargs)
export GITHUB_PASSWORD=$(cat ~/.githubrc 2> /dev/null | grep user.password | cut -d ":" -f2 | xargs)
if [ -z "$GITHUB_USERNAME" ]
then
read -p "Type your Github username: " GITHUB_USERNAME
echo "user.login: $GITHUB_USERNAME" >> ~/.githubrc
fi
@tricoder42
tricoder42 / 00_GraphQL_Subscriptions.md
Last active Mar 13, 2020
GraphQL Subscriptions with django-channels
View 00_GraphQL_Subscriptions.md

GraphQL Subscription with django-channels

Django channels are official way for implementing async messaging in Django.

The primary caveat when working with GraphQL subscription is that we can't serialize message before broadcasting it to Group of subscribers. Each subscriber might use different GraphQL query so we don't know how to serialize instance in advance.

See related issue

@rdlabo
rdlabo / keyboard-attach.directive.ts
Last active Sep 25, 2019 — forked from Manduro/keyboard-attach.directive.ts
Ionic Keyboard Attach Directive
View keyboard-attach.directive.ts
import { Directive, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';
import { Keyboard } from '@ionic-native/keyboard';
import { Content, Platform } from 'ionic-angular';
import { Observable } from 'rxjs/Observable';
import { Subscription } from 'rxjs/Subscription';
/**
* @name KeyboardAttachDirective
* @source https://gist.github.com/rdlabo/942671d8c9cffb02676756cdd56aa1c0
* @forked https://gist.github.com/Manduro/bc121fd39f21558df2a952b39e907754
@mbrochh
mbrochh / 01_utils.py
Last active Mar 29, 2020
Using pagination with Django, graphene and Apollo
View 01_utils.py
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:
@coolvasanth
coolvasanth / ionic2_upload_file_from_google_drive
Created Aug 27, 2017
Uploading a file from google drive/cloud application into your server Ionic, Hybrid app development.
View ionic2_upload_file_from_google_drive
//You need to use html input type file for this purpose.
// INPUT TYPE FILE GIVES A WEIRD LOOK FOR APP SO I HAVE
//STYLED IT LIKE BELOW.
//the html code is as below ex home.html
<label ion-button for="uploadResume" block style="background-color: #16a085;color: white;" color="secondary">Choose Resume</label>
<input style="display: none;" type="file" name="" id="uploadResume" (change)="OnResumeSelect($event)">
@coolvasanth
coolvasanth / uploadingvideo.txt
Created Apr 25, 2017
uploading video which is captured from device to server via API (works both on android and ios)
View uploadingvideo.txt
//install media capture, file chooser, file transfer, camera plugins from ionic 2 native plaugins and don't forget to add providers in
app.component.ts
import { Component } from '@angular/core';
import { NavController, NavParams,ActionSheetController } from 'ionic-angular';
import { MediaCapture, MediaFile, CaptureError, CaptureImageOptions,CaptureVideoOptions } from '@ionic-native/media-capture';
import { Camera, CameraOptions } from '@ionic-native/camera';
import { Transfer, FileUploadOptions, TransferObject } from '@ionic-native/transfer';
import { FileChooser } from '@ionic-native/file-chooser';
@coolvasanth
coolvasanth / uploadingresume.txt
Last active Mar 30, 2020
choosing .jpg,.pdf,.docs etc files from galley and uploading it to server via your API using IONIC 2. (DOESN'T WORK ON IOS)
View uploadingresume.txt
// Install file chooser and file transfer API from ionic 2 and import them into your page.ts. and don't forget to add providers in
app.component.ts
import { Component } from '@angular/core';
import { NavController, NavParams} from 'ionic-angular';
import { Home } from '../../homemodule/home';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { UserProfileService } from '../../services/login.service';
@coolvasanth
coolvasanth / takepictureandupload.txt
Last active Mar 19, 2020
pick image from gallery or from camera and upload it to server via API, ionic 2
View takepictureandupload.txt
//install camera, file trnasfer plugin from ionic native and it's providers in app.component.ts. then only you can use thse codes in your .ts file.
presentActionSheet() {
let actionSheet = this.actionSheetCtrl.create({
title: 'Pick your profile photo',
buttons: [
{
text: 'From Gallery',
You can’t perform that action at this time.