Skip to content

Instantly share code, notes, and snippets.

View GAM3RG33K's full-sized avatar

GAM3RG33K

View GitHub Profile
/**
* Split a single string into multiple paragraphs based on the last
* punctuation found in the substring while iterating.
*
* @param dataString long string which is to be divided into paragraphs
* @param maxAllowedLength number of maximum characters allowed in one
* paragraph.
* @return list of paragraphs
*/
private static List<String> splitParagraph(String dataString, int maxAllowedLength) {
@GAM3RG33K
GAM3RG33K / How I Do PlantUML.md
Created October 1, 2019 12:09 — forked from jerieljan/How I Do PlantUML.md
PlantUML with Style -- How I do PlantUML

I use PlantUML a lot. It's what I use for drawing all sorts of diagrams and it's handy because of its easy markup (once you get used to it) while making things easy to maintain as projects grow (thanks to version control)

This gist details how I do my PlantUML workspace in a project.

  • The idea is to keep a globals directory for all diagrams to follow (like the "stylesheet" below) to keep things consistent.
  • The stylesheet.iuml file keeps the use of colors consistent through use of basic FOREGROUND, BACKGROUND and ACCENT colors.
  • The style-presets.iuml file defines these colors so you can make "presets" or "themes" out of them.
  • As stated in the stylesheet.iuml, you'll need the Roboto Condensed and Inconsolata fonts for these to work properly.
@GAM3RG33K
GAM3RG33K / Deploy a Flutter Web project on Wildfly server.md
Last active July 26, 2022 20:08
How to deploy a Flutter Web project on Wildfly server

Brief

There are two approaches for deploying a website on "Wild-fly":

  1. Using simple file handlers and URL mapping
  2. By creating and deploying WAR file

Note: Make sure the all the deployment files are ready in a folder and contains the "index.html" file directly under the deployment folder.

@GAM3RG33K
GAM3RG33K / ReadMe.md
Last active December 3, 2019 09:01
Image asset Theme color Issue

#prerequisite

  • Flutter SDK : master branch
    Flutter 1.12.15-pre.26 • channel master • https://github.com/flutter/flutter.git
    Framework • revision 1b835a722b (6 days ago) • 2019-11-26 23:48:51 -0500
    Engine • revision e3e5f8dabc
    Tools • Dart 2.7.0
    

#setup

@GAM3RG33K
GAM3RG33K / main.dart
Created December 24, 2019 11:13
Cutom Thumb shape Gist
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@GAM3RG33K
GAM3RG33K / main.dart
Created December 28, 2019 16:47
Flutter's Overlay Feature Demo
import 'package:flutter/material.dart';
/*
Overlay allows you to show your desired widget above everything.
All you have to do is pass a `context` and your `widget`. **It will be shown even above the Dialogs as well.**
When using `overlay`, your given widget will be shown above all the widgets.
However, **Keep in mind that the position of the `Overlayed` widget will be in reference to the parent widget area.**
So, **Do not forget to position the widget accordingly.**
@GAM3RG33K
GAM3RG33K / ReadMe.md
Created February 14, 2020 07:07
A Guide to setup and use Plantuml
@GAM3RG33K
GAM3RG33K / main.dart
Created March 6, 2020 09:56
flutter dialog and option menu dispose issue
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
@GAM3RG33K
GAM3RG33K / floating_widget.dart
Created March 18, 2020 10:40
A Floating Widget in Flutter
import 'package:flutter/material.dart';
/// Enum for selecting floating widget's initial alignment
enum WidgetAlignment {
/// The widget will be positioned of top left corner of the parent
topLeft,
/// The widget will be positioned of top right corner of the parent
topRight,
@echo off
:: ======= Script to restart the adb with new port(5050) and connect a fixed ip through it =======
:: ======= Author: Harshvardhan Joshi =======
:: ======= Date: 28-11-2019 =======
:: set /A port=%1
:: set client_ip=%2
set /A port=5050
set /p client_ip="Enter Mobile device's IP address: "