Skip to content

Instantly share code, notes, and snippets.

View gblnovaes's full-sized avatar
🎯
Focusing

Gabriel gblnovaes

🎯
Focusing
View GitHub Profile
@gblnovaes
gblnovaes / gist:a774363b2c3be05a648e97a75b74c283
Created February 18, 2021 19:18
How to create flutter project with company package.
How to create flutter project with company package.
flutter create --org br.com.project_name project_name
** Roteiro Estudo Programação para Iniciantes
- Estudar os seguintes comando de condicoes basica, encontrado em todas as linguagens.
-- operadores
-- entrada e saida do usuario
-- condicionais (if,else)
-- Loops(for,dowhile,white...)
@gblnovaes
gblnovaes / csvreader
Created January 5, 2017 11:31
CSV READER
public class CSVFile {
InputStream inputStream;
Context context;
List resultCSVlist = new ArrayList();
public CSVFile(InputStream inputStream, Context context) {
this.inputStream = inputStream;
this.context = context;
}
@gblnovaes
gblnovaes / SharedPreferences
Created August 3, 2016 19:55
SharedPreferences in Fragment
The method getSharedPreferences is a method of the Context object, so just calling getSharedPreferences from a Fragment will not work...because it is not a Context! (Activity is an extension of Context, so we can call getSharedPreferences from it).
So you have to get your applications Context by
// this = your fragment
SharedPreferences preferences = this.getActivity().getSharedPreferences("pref", Context.MODE_PRIVATE);
@gblnovaes
gblnovaes / gist:94e6921bc8ed2f42c762a9ad6945c338
Created July 30, 2016 11:08
color arrow back in toolbar
<style name="BaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorControlNormal">@color/white</item>
//the rest of your codes...
</style>
[{
"id": 1,
"nome": "Carlos",
"telefone": "Jenkins",
"email": "[email protected]",
"foto": "http://dummyimage.com/197x230.png/dddddd/000000"
}, {
"id": 2,
"nome": "Virginia",
"telefone": "Lee",
@gblnovaes
gblnovaes / gist:70a93eb7b4cfafaf51474162b7837e76
Created April 9, 2016 11:02
Android Studio 2.0 Error update
Erro apresentado:
Error:Unable to start the daemon process: could not reserve enough space for object heap.
Please assign more memory to Gradle in the project's gradle.properties file.
For example, the following line, in the gradle.properties file, sets the maximum Java heap size to 1,024 MB:
<em>org.gradle.jvmargs=-Xmx1024m</em>
<a href="http://www.gradle.org/docs/current/userguide/build_environment.html">Read Gradle's configuration guide</a><br><a href="http://docs.oracle.com/javase/7/docs/technotes/guides/vm/gc-ergonomics.html">Read about Java's heap size</a>
Solução:
@gblnovaes
gblnovaes / Adcionando android na linha de comando
Created October 12, 2015 18:53
Adcionando android na linha de comando
Android manager has a graphical interface. Not sure using terminal only for such development is a good idea.
Anyways, run with -u (no UI) option :
android update sdk -u
Accept licenses (y) and install whatever is needed.
Add android tools to $PATH:
Lets say sdk directory is /home/user/sdk then:
@gblnovaes
gblnovaes / IONIC Stuff.md
Last active September 3, 2015 19:13 — forked from nncl/IONIC Stuff.md
Ionic stuff

IONIC Stuff

Some useful codes

  1. To start, run ionic serve
  2. To start and see both iOS and Android screens, run ionic serve -l
var service = angular.module('inApp');
service.factory('AuthService', function($http,$location,$window) {
return {
hasToken: function() {
// verifica se tem token senao tiver direciona para o login.
var token = $window.localStorage.getItem('access_token');
var redirect = '/#';
if(token == null || !token){