Skip to content

Instantly share code, notes, and snippets.

View luizcarraro's full-sized avatar
🏠
Working from home

Luiz Carraro luizcarraro

🏠
Working from home
  • Pato Branco - BR
View GitHub Profile
@luizcarraro
luizcarraro / framework7.js
Created June 19, 2017 12:06
Framework7 Ember initializer
import Ember from 'ember';
export function initialize(container) {
return Ember.run.schedule('afterRender', function () {
new Framework7();
});
}
export default {
name: 'framework7',
@luizcarraro
luizcarraro / ios-cordova-build.sh
Created June 19, 2017 12:08
iOS build with cordova
#!/bin/bash
# param of enviroment: staging, production and development
# IMPORTANT: change __Project__ for your project name
echo -e '\033[01;32m >>>>>>>>>>>>>>>>>>>>>>>> ETAPA 1/3 > APLICANDO CONFIGURAÇÕES IOS AO PROJETO \033[00;37m'
sed -i '' 's/material/ios/g' ember-cli-build.js
echo -e '\033[01;32m >>>>>>>>>>>>>>>>>>>>>>>> ETAPA 2/3 > FAZENDO BUILD PARA IOS \033[00;37m'
ember cordova:build --environment=$1 --platform=ios
@luizcarraro
luizcarraro / android-cordova-build.sh
Last active June 28, 2017 11:58
Android build with cordova
#!/bin/bash
# $1 = staging, production or development
BUILDPATH=cordova/platforms/android/build/outputs/apk/
echo -e '\033[01;32m >>>>>>>>>>>>>>>>>>>>>>>> ETAPA 1/4 > APLICANDO CONFIGURAÇÕES ANDROID AO PROJETO \033[00;37m'
sed -i '' 's/ios/material/g' ember-cli-build.js
echo -e '\033[01;32m >>>>>>>>>>>>>>>>>>>>>>>> ETAPA 2/4 > FAZENDO BUILD PARA ANDROID \033[00;37m'
ember cordova:build --environment=$1 --platform=android
@luizcarraro
luizcarraro / badRequest.js
Created June 19, 2017 17:48
Custom sails badrequest response for ember processing
/**
* 400 (Bad Request) Handler
*
* Usage:
* return res.badRequest();
* return res.badRequest(data);
* return res.badRequest(data, 'some/specific/badRequest/view');
*
* e.g.:
* ```
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
classificacao: {
pessoa: {
tipo: 'FISICA'
}
}
});
// Trocar body pela Div
body:before {
-webkit-animation: 10s normal forwards zoomin ease-in;
animation: 10s normal forwards zoomin ease-in;
background-image: url("http://www.artisanaljavascript.com/images/tradition.jpg");
background-size: cover;
content: " ";
height: 100%;
position: fixed;
-webkit-transform-origin: center center 0;
@luizcarraro
luizcarraro / open-external-link.js
Created July 27, 2017 11:37
ELECTRON: Open link in external default OS browser
@luizcarraro
luizcarraro / capture-links.js
Created September 22, 2017 12:48
Ember Helper para Capturar links e os torna clicáveis
@luizcarraro
luizcarraro / electron_context_menu.js
Created September 25, 2017 12:40
[ELECTRON] Menu-contexto com opções de copiar, colar e cortar em inputs e divs
(function () {
'use strict';
const remote = require('electron').remote;
const Menu = remote.Menu;
const MenuItem = remote.MenuItem;
const isAnyTextSelected = function () {
return window.getSelection().toString() !== '';
};
@luizcarraro
luizcarraro / Arvore.c
Created October 2, 2017 11:37
Arvore Binária do Brunão (Com suporte a Linux 64bits)
#include <stdio.h>
#include <stdlib.h>
typedef struct nodo{
int valor;
struct nodo *esquerda, *direita;
}Nodo;
Nodo *arvore;