Skip to content

Instantly share code, notes, and snippets.

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

Valter Negreiros valterh4ck3r

🏠
Working from home
View GitHub Profile
@maciejmalycha
maciejmalycha / MutableHttpServletRequest.java
Last active August 28, 2017 17:07
Mutable HttpServletRequest
public class MutableHttpServletRequest extends HttpServletRequestWrapper {
private Map<String,String[]> parameters = new HashMap<String,String[]>();
public MutableHttpServletRequest(HttpServletRequest request) {
super(request);
}
public void setParameter(String name, String value) {
parameters.put(name, new String[] {value});
@iChintanSoni
iChintanSoni / SharedPreferenceUtils.java
Last active December 5, 2018 01:52
Utility class for working with SharedPreferences
import android.content.Context;
import android.content.SharedPreferences;
public class SharedPreferenceUtils {
private static SharedPreferenceUtils mSharedPreferenceUtils;
protected Context mContext;
private SharedPreferences mSharedPreferences;
private SharedPreferences.Editor mSharedPreferencesEditor;
private SharedPreferenceUtils(Context context) {
import 'package:flutter/material.dart';
import 'dart:math' as math;
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
@DeyvidJLira
DeyvidJLira / bottom_navigation_with_tab_bar_screen.dart
Created April 27, 2019 17:11
Create screen in the Flutter with TabBar in only one of the item of the bottom navigation bar.
import 'package:flutter/material.dart';
class TabBarWithBottomNavigationScreen extends StatefulWidget {
@override
_TabBarWithBottomNavigationScreenState createState() => _TabBarWithBottomNavigationScreenState();
}
class _TabBarWithBottomNavigationScreenState extends State<TabBarWithBottomNavigationScreen> with SingleTickerProviderStateMixin {
@kostiakoval
kostiakoval / PrefUtils.java
Created March 29, 2014 15:49
SharedPreferences util
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
public class PrefUtils {
/**
* Called to save supplied value in shared preferences against given key.
* @param context Context of caller activity
@marcusedu
marcusedu / patterns.dart
Last active December 11, 2019 05:14
Expressões regulares de uso comum
final RegExp email = RegExp(
r"^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]"
r"{0,253}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,253}[a"
r"-zA-Z0-9])?)*$",
caseSensitive: false,
multiLine: false);
final RegExp mobileBrazilianPhone = RegExp(r"^\(?0?\d{2}\)? ?9 ?\d{4}-?\d{4}$",
caseSensitive: false, multiLine: false);
@wkrueger
wkrueger / promise.md
Last active May 4, 2020 14:37
Guia Promise

Guia Promises

Pode-se afirmar que no momento Promises são a forma mais "padrão" no momento de se tratar com assincronismo no JS. Para quem trabalha com javascript, conhecê-las é essencial. Uma dificuldade comum é que esta API tem uma curva de aprendizado um tanto acentuada de início, especialmente se comparado com as alternativas mais antigas: callbacks e o módulo async. No meu caso, levei ao menos uns 3 meses pra "cair a ficha".

-- na verdade promises ainda são um remendo para o problema do assincronismo do JS. Elas ainda possuem certa dificuldade

@mikestone14
mikestone14 / gist:11198630
Created April 23, 2014 00:08
Getting a GoDaddy domain to point to a Heroku app.
@valterh4ck3r
valterh4ck3r / build_runnder.sh
Created October 7, 2020 22:54
Flutter - Mobx Code Gen Delete Conflicts
flutter packages pub run build_runner watch --delete-conflicting-outputs
@andrelsmoraes
andrelsmoraes / bottom_sheet.dart
Created June 22, 2018 21:03
Modal Bottom Sheet with Input Fields fix for Flutter (Fix issue with overlap with keyboard and fix for tapping to dismiss) - Flutter Version: Channel beta, v0.5.1
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';