Skip to content

Instantly share code, notes, and snippets.

View mukhtharcm's full-sized avatar
🎯
Focusing

Muhammed Mukhthar CM mukhtharcm

🎯
Focusing
View GitHub Profile
@mukhtharcm
mukhtharcm / redirecting-github-pages.md
Created July 13, 2020 11:51 — forked from domenic/redirecting-github-pages.md
Redirecting GitHub pages after a repository move

Redirecting GitHub Pages after a repository move

The problem

You have a repository, call it alice/repo. You would like to transfer it to the user bob, so it will become bob/repo.

However, you make heavy use of the GitHub Pages feature, so that people are often accessing https://alice.github.io/repo/. GitHub will helpfully redirect all of your repository stuff hosted on github.com after the move, but will not redirect the GitHub Pages hosted on github.io.

The solution

@mukhtharcm
mukhtharcm / git_submodules.md
Created July 18, 2020 06:10 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(home: Home()));
}
class Home extends StatefulWidget {
@override
_HomeState createState() => _HomeState();
}
@mukhtharcm
mukhtharcm / post_list.dart
Created March 14, 2021 10:05
Gist for Blogger api in Flutter Post
class PostList {
String kind;
String nextPageToken;
String prevPageToken;
List<Items> items;
PostList({this.kind, this.nextPageToken, this.prevPageToken, this.items});
PostList.fromJson(Map<String, dynamic> json) {
kind = json['kind'];
@mukhtharcm
mukhtharcm / ternary-operator-flutter.dart
Last active March 15, 2021 12:25
Example for using ternary operator in Flutter.
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@mukhtharcm
mukhtharcm / not_model.g.dart
Created March 16, 2021 12:19
TypeAdaptor Example for blog
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'note_model.dart';
// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************
class NoteModelAdapter extends TypeAdapter<NoteModel> {
@override
@mukhtharcm
mukhtharcm / main.dart
Created July 29, 2025 13:19
Dart Variables and Printing
void main() {
// Variables are like labeled boxes to store information.
// String: For text
String name = "Ahmed";
// int: For whole numbers
int age = 28;
// double: For numbers with decimals
@mukhtharcm
mukhtharcm / main.dart
Created July 29, 2025 13:23
Dart Basics: Math and comparisons
void main() {
int a = 10;
int b = 5;
// Math
print("a + b = ${a + b}"); // Addition
print("a - b = ${a - b}"); // Subtraction
print("a * b = ${a * b}"); // Multiplication
print("a / b = ${a / b}"); // Division
@mukhtharcm
mukhtharcm / main.dart
Created July 29, 2025 13:25
Dart Basics: Conditionals
void main() {
double userWealth = 5000.0;
double nisab = 3000.0; // The minimum threshold for Zakat
print("Your wealth is: $userWealth");
print("The Nisab threshold is: $nisab");
// The 'if' statement checks if a condition is true.
if (userWealth > nisab) {
// This code runs ONLY if the condition is true.
@mukhtharcm
mukhtharcm / main.dart
Created July 29, 2025 13:35
Dart basics: Lists & For Loops
void main() {
// A List holds an ordered collection of items.
// The type of item is specified in the angle brackets < >.
// A List of Strings
List<String> shoppingList = ["Apples", "Milk", "Bread"];
print("Shopping List:");
for (String item in shoppingList) {
print("- $item");
}