Skip to content

Instantly share code, notes, and snippets.

@omatt
omatt / main.dart
Created September 10, 2021 04:49
Sample Bloc
import 'dart:async';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@omatt
omatt / custom_stepper.dart
Last active June 24, 2021 19:48
Modified Flutter Stepper widget with optional alignment parameters, dotted line seperators. An option to customize 'Next' and 'Cancel button is also available. Original Source: https://github.com/flutter/flutter/blob/d79295af24/packages/flutter/lib/src/material/stepper.dart
// Copyright 2014 The Flutter 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 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
// TODO(dragostis): Missing functionality:
// * mobile horizontal mode with adding/removing steps
// * alternative labeling
// Copyright 2014 The Flutter 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 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
// TODO(dragostis): Missing functionality:
// * mobile horizontal mode with adding/removing steps
// * alternative labeling
@omatt
omatt / 2015 Q2 Anime
Last active August 29, 2015 14:19
On-going Anime for 2015 Q2
### Watching
1. Nagato Yuki-chan no Shōshitsu
2. Nisekoi 2
3. Ore Monogatari
4. Shokugeki no Soma
5. Dungeon ni Deai wo Motomeru no wa Machigatteiru Darou ka
6. Punch Line
7. Yamada-kun and the Seven Witches
8. Houkago no Pleiades
@omatt
omatt / English Central
Last active August 29, 2015 14:17
English Central Android demo app references
https://www.google.com.ph/search?q=android+setNavigationMode+deprecated
// ActionBar.setNavigationMode is deprecated
https://developer.android.com/training/material/lists-cards.html
http://www.binpress.com/tutorial/android-l-recyclerview-and-cardview-tutorial/156
// RecyclerView and CardView
http://javatechig.com/android/listview-with-section-header-in-android
// ListView with section header
@omatt
omatt / CircleCrop
Last active August 29, 2015 14:16
Circle Crop Effect on Bitmap. Designed specifically for Android ImageViews.
/**
* Returns a Bitmap object with a circle crop effect.
* This can be used in an ImageView and it must use
* "centerCrop" on its scaleType to achieve desired output.
* <p>
* Reference: {@link} http://stackoverflow.com/a/14051472/2497859
*
* @param bitmap The bitmap that we're going to "circle crop"
* @return Bitmap with a circle crop overlay
* @see android.graphics.Bitmap
@omatt
omatt / Sort
Last active August 29, 2015 14:15
/**
* Sort a 2d array
*
* @author Omatt
* @version 2015/02/22
*/
public class Sort{
private static final int maxRow = 5, maxCol = 5;
private static String cube[][] = new String[maxRow][maxCol];
public static void main(String[] args){
@omatt
omatt / SampleCustomFragmentTabs
Last active August 29, 2015 14:05
Custom Fragment Tabs reference
public class InfosLegalesActivity extends BaseDrawerNormalActivity {
private FragmentTabHost mTabHost;
private static TextView txtTitleInfosLegales;
@Override
protected int getLayoutContentId() {
return R.layout.layout_infoslegales;
}
@Override
@omatt
omatt / GitBashCommands
Last active November 28, 2022 18:34
Git Bash console helpful commands.
$ git config --global user.name <Name Here>
$ git config --global user.email <Email Address>
// Set-up name and email address to be used
$ git init
// Initialize git on current dir/folder
$ git add <file>
// You can add files one-by-one or all of them with asterisk (*)
// Include the file extension of the files
@omatt
omatt / InputPHP
Last active December 23, 2015 16:09
Sample PHP code that accepts input and redirecting to another page.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<title>Seatwork</title>
<script type="text/javascript">
function valForm(){
if(document.myForm.firstName.value==""){
if(document.myForm.firstName.value==""){
document.getElementById("fName").innerHTML = "this is required";
}