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
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});
@valterh4ck3r
valterh4ck3r / promise.md
Created October 29, 2017 16:40 — forked from wkrueger/promise.md
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

@valterh4ck3r
valterh4ck3r / keycloak.sh
Created December 12, 2017 14:10 — forked from paoloantinori/keycloak.sh
Keycloak Admin API Rest Example
#!/bin/bash
export TKN=$(curl -X POST 'http://localhost:8080/auth/realms/master/protocol/openid-connect/token' \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin" \
-d 'password=admin' \
-d 'grant_type=password' \
-d 'client_id=admin-cli' | jq -r '.access_token')
curl -X GET 'http://localhost:8080/auth/admin/realms' \
@valterh4ck3r
valterh4ck3r / README-Template.md
Last active December 14, 2017 13:07 — forked from PurpleBooth/README-Template.md
Removed Test Link My Profile

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@valterh4ck3r
valterh4ck3r / how-to-link-two-android-projects.md
Created March 6, 2018 00:50 — forked from nolanlawson/how-to-link-two-android-projects.md
How to link an Android app to a local library project
@valterh4ck3r
valterh4ck3r / install virtualenv ubuntu 16.04.md
Created March 27, 2018 14:07 — forked from Geoyi/install virtualenv ubuntu 16.04.md
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
@valterh4ck3r
valterh4ck3r / bottom_sheet.dart
Created January 28, 2019 16:34 — forked from andrelsmoraes/bottom_sheet.dart
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';
@valterh4ck3r
valterh4ck3r / patterns.dart
Created January 29, 2019 19:02 — forked from marcusedu/patterns.dart
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);
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(
@valterh4ck3r
valterh4ck3r / bottom_navigation_with_tab_bar_screen.dart
Created April 27, 2019 17:12 — forked from DeyvidJLira/bottom_navigation_with_tab_bar_screen.dart
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 {