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
# admin.py: admin action definition | |
def make_copy(self, request, queryset): | |
form = None | |
if 'apply' in request.POST: | |
form = CopyPageForm(request.POST) | |
if form.is_valid(): | |
issue = form.cleaned_data['issue'] |
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 { 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 |
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
<?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 |
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
// 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'; |
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
# views.py - django app called ajx | |
from django.shortcuts import render, get_object_or_404, redirect, HttpResponse, render_to_response, HttpResponseRedirect | |
from django.core.urlresolvers import reverse | |
from django.contrib.auth import authenticate, login | |
import json | |
def mygetview(request): | |
if request.method == 'GET': |
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
#!/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" ] |
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
#!/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 |
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
//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'; |
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} from '@angular/core'; | |
@Directive({ | |
selector: '[background-image]' | |
}) | |
export class BackgroundImage { | |
private el: HTMLElement; | |
constructor(el: ElementRef) { | |
this.el = el.nativeElement; |