Skip to content

Instantly share code, notes, and snippets.

View pavei's full-sized avatar

Vinicius Pavei pavei

  • Asksuite
  • Brazil
View GitHub Profile
config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/dash', {templateUrl: 'partials/dash.html', controller: 'DashCtrl', requireLogin: true});
$routeProvider.when('/user/list', {templateUrl: 'partials/user.list.html', controller: 'UserListCtrl', requireLogin: true});
$routeProvider.when('/user/new', {templateUrl: 'partials/user.form.html', controller: 'UserNewCtrl', requireLogin: true});
$routeProvider.when('/user/edit', {templateUrl: 'partials/user.form.html', controller: 'UserEditCtrl', requireLogin: true});
$routeProvider.when('/user/login', {templateUrl: 'partials/user.login.form.html', controller: 'UserLoginFormCtrl', requireLogin: false});
$routeProvider.otherwise({redirectTo: '/dash'});
}]).run(function ($rootScope, $location, Services, Enviroment) {
@pavei
pavei / gist:ec30ef8a10b7c7773bdc
Created July 18, 2014 13:16
Schema DDL Generator with PlayFramework
/**
* Populate test database with sample data.
*
* @throws IOException
*/
public static void setUpDb() throws IOException {
server = Ebean.getServer("default");
ServerConfig config = new ServerConfig();
config.setDdlGenerate(true);
config.setDdlRun(true);
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
images = [];
<ion-header>
<ion-navbar primary>
<ion-title>
Galeria de Fotos
</ion-title>
<ion-buttons end>
<button ion-button icon-only (click)="changeGrid()">
<ion-icon *ngIf="!grid" name="md-grid"></ion-icon>
// this is a custom dictionary to make it easy to extend/override
// provide a name for an entry, it can be anything such as 'copyAssets' or 'copyFonts'
// then provide an object with a `src` array of globs and a `dest` string
module.exports = {
copyAssets: {
src: ['{{SRC}}/assets/**/*'],
dest: '{{WWW}}/assets'
},
copyIndexContent: {
src: ['{{SRC}}/index.html', '{{SRC}}/manifest.json', '{{SRC}}/service-worker.js'],
import { Component } from '@angular/core';
import {NavController, NavParams, Platform} from 'ionic-angular';
import {CameraPreview} from "@ionic-native/camera-preview";
@Component({
selector: 'page-story-photo',
templateUrl: 'story-photo.html',
})
export class StoryPhotoPage {
page-story-photo {
.fab-md-danger {
color: white !important;
background-color: transparent !important;
box-shadow: none !important;
}
.fab-md-dark {
background-color: white;
<ion-content padding>
<ion-fab right top small >
<button ion-fab color="danger" (click)="back()">
<ion-icon name="md-arrow-forward"></ion-icon>
</button>
</ion-fab>
<ion-fab left top small >
<button ion-fab color="danger">
<ion-icon name="ios-settings"></ion-icon>
/**
* Switch from back to front cämera
*/
refresh(){
this.cameraPreview.switchCamera();
}
/**
* Back button