Skip to content

Instantly share code, notes, and snippets.

View obadajasm's full-sized avatar

Obada Jasem obadajasm

View GitHub Profile
@lukepighetti
lukepighetti / database.dart
Last active March 25, 2021 18:43
A dead simple JSON based key/value store that is unbelievably useful for scripts and tools
import 'dart:convert';
import 'dart:io';
class Database {
/// A simple JSON file database
Database(String path) : file = File(path);
final File file;
var _store = <String, dynamic>{};
@udacityandroid
udacityandroid / onCreate method in MainActivity.java
Created May 13, 2016 18:17
Use OnClickListeners for All Categories - onCreate method in MainActivity.java
// Find the View that shows the numbers category
TextView numbers = (TextView) findViewById(R.id.numbers);
// Set a click listener on that View
numbers.setOnClickListener(new View.OnClickListener() {
// The code in this method will be executed when the numbers View is clicked on.
@Override
public void onClick(View view) {
Intent numbersIntent = new Intent(MainActivity.this, NumbersActivity.class);
startActivity(numbersIntent);