Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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";
}
@omatt
omatt / Colors
Created September 22, 2013 14:25
Set colors in Java using hex color codes. Generate hex color codes in here - http://hexcolorgenerator.com/
Color colorA = new Color(0xFF0096); // Use the hex number syntax
Color bColor = Color.decode("0xFF0096"); // or with the use of decode
object.setColor(Color.white);
setBackground(Color.white);
/** Alternatively using hex color codes to expand the color library **/
object.setColor(new Color(0xFF0096));
object.setColor(Color.decode("0xFF0096"));
@omatt
omatt / BufferedReader
Created September 22, 2013 09:53
Data readers
/** Java BufferedReader **/
import java.io.*;
// initialize class
{
public static void main(String [] args)throws IOException{
BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
String inputString = buffer.readLine();
int inputInt = Integer.parseInt(buffer.readLine());
@omatt
omatt / EncapsulationSample
Created September 19, 2013 06:40
Simple implementation of the Object Oriented Concept - Encapsulation
/**
* Sample for Object Oriented Programming Concepts
*
* Encapsulation
*
* @author Reyes, Omar Matthew B.
* @version 2013/09/07
*/
public class EncapsulationSample{
@omatt
omatt / TropoDataStorage
Last active December 16, 2015 04:29
Tropo Sample storing online accounts user data.
var askAccount = ask("What's the online account details that you want to know?You can select Facebook or Twiiter", {
choices: "facebook, twitter, github",
timeout: 20.0,
attempts: 3,
onBadChoice: function(askAccount) {
say("I'm sorry, I didn't understand that. You can select facebook or twitter.");
},
onChoice: function(askAccount) {
if(askAccount.value == "facebook"){
say("Your username is sample@facebook.com");
@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