Skip to content

Instantly share code, notes, and snippets.

View villander's full-sized avatar

Michael Villander villander

View GitHub Profile
@villander
villander / android-staging.sh
Created November 11, 2015 15:23 — forked from jakecraige/android-staging.sh
I have this file in the bin folder of my app and use it to generate a signed apk for android
#!/bin/bash
AppName=EventAssist
APPNAME=event-assist
ember cordova:build --environment=staging --platform=android
echo "keystorepassword" | jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore keys/${APPNAME}.keystore cordova/platforms/android/ant-build/${AppName}-release-unsigned.apk $APPNAME
rm cordova/platforms/android/ant-build/${AppName}.apk
@villander
villander / environment.js
Created November 17, 2015 14:53 — forked from ultimatemonty/environment.js
PubNub with Ember CLI
// config/environment.js
module.exports = function(environment) {
var ENV = {
modulePrefix: 'ember-cli-pubnub',
environment: environment,
baseURL: '/',
locationType: 'auto',
EmberENV: {
FEATURES: {
@villander
villander / cordova-device-ready.js
Created November 19, 2015 00:30 — forked from 03xb7/cordova-device-ready.js
Wait for Phonegap's deviceready event before initializing an Ember application
import isOnCordova from '../utils/is-on-cordova';
export function initialize(container, application) {
application.deferReadiness();
document.addEventListener('deviceready', function() {
application.advanceReadiness();
}, false);
if(!isOnCordova()){
document.dispatchEvent(new Event('deviceready'));
}
<button>Click</button>
<p>Delay was <span></span> milliseconds.</p>
<script>
var button = document.querySelector( "button" ),
span = document.querySelector( "span" ),
delay;
window.vila = 0;
button.addEventListener( "touchend", function() {
@villander
villander / gist:4ae46ac590e4ff26a3f7
Created November 26, 2015 04:49 — forked from tomdale/gist:3981133
Ember.js Router API v2

WARNING

This gist is outdated! For the most up-to-date information, please see http://emberjs.com/guides/routing/!

It All Starts With Templates

An Ember application starts with its main template. Put your header, footer, and any other decorative content in application.handlebars.

<header>

###Code Review

É uma técnica onde o desenvolvedor tem seu código revisado por outro desenvolvedor antes de commitar o código.

O commitador deve explicar cada arquivo que está sendo commitado, tanto do ponto de vista técnico quanto de negócio.

Cada trecho de código apontado como alteração pelo "diff" deve ser devidamente explicado ao revisor.

É papel do revisor questionar sobre o código, sugerir melhorias e exigir detalhes sobre a regra de negócio.

// Ember.run.queues
// => ["sync", "actions", "routerTransitions", "render", "afterRender", "destroy"]
/*Ember.run.schedule('actions', this, function() {
console.log('hehehe');
// Do more things
});
Ember.run.schedule('sync', this, function() {
// Do more things
console.log('opa');
});
actions : {
login: function(id) {
Ember.run(() => {
this.store.find('profile', { orderBy: 'profileId', equalTo: id }).then(profile => {
profile = profile.get('firstObject');
this.get('session').set('currentProfile', profile);
return this.store.find('conversation', { orderBy: 'me', equalTo: profile.get('id') }).then(conversations => {
let other = conversations.get('firstObject.other');
this.transitionTo('conversation', other.get('profileId'));
createConversations : function(){
var conversations = [{
"me": "flama@cae",
"other": "flama@julio"
}, {
"me": "flama@cae",
"other": "flama@miprotzek"
}, {
"me": "flama@cae",
"other": "flama@rpacheco"
import Ember from 'ember';
export default Ember.Component.extend(Ember.Evented, {
classNames: ['chat'],
audio: Ember.inject.service('audio'),
pubnub: Ember.inject.service('pubnub'),