Skip to content

Instantly share code, notes, and snippets.

View Muhammed-Rahif's full-sized avatar
💻
Developers have a national anthem and it starts with: Lorem ipsum dolor sit amet

Muhammed Rahif Muhammed-Rahif

💻
Developers have a national anthem and it starts with: Lorem ipsum dolor sit amet
View GitHub Profile
import 'package:flutter/widgets.dart';
// From https://gist.github.com/ltOgt/3771c824fc1c8811f5ec1a81a9a4937b
/// Conditionally wrap a subtree with a parent widget without breaking the code tree.
///
/// [condition]: the condition depending on which the subtree [child] is wrapped with the parent.
/// [child]: The subtree that should always be build.
/// [parentBuilder]: builds the parent with the subtree [child].
///
@Muhammed-Rahif
Muhammed-Rahif / islamic-quiz-api.json
Last active January 11, 2023 13:51
Islamic Quiz Api Json
[
{
"question": "What is the name of the holy book of Islam?",
"answers": ["The Qur'an", "The Bible", "The Vedas", "The Sutras"],
"source": "....Quran was revealed as a guide for humanity with clear proofs of guidance and the standard ˹to distinguish between right and wrong˺.... -Qur'an, Surah Al-Baqarah 2:185",
"answerIndex": 0
},
{
"question": "Which of the following is not one of the Five Pillars of Islam?",
"answers": ["Prayer", "Fasting", "Charity", "Hiking"],
@sindresorhus
sindresorhus / esm-package.md
Last active November 20, 2024 12:29
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@Muhammed-Rahif
Muhammed-Rahif / express-app.js
Last active September 6, 2021 14:56
This is a mongodb localhost:27017 connection code in node js express. We can connect simply mongodb(PORT: localhost:27017 ) to our node js project as this code...
db.connect((err)=>{
if (err) {
console.log("Database connection Error :"+err);
}else{
console.log("Database connected to port 27017");
}
})
@ltOgt
ltOgt / conditional_parent_widget.dart
Created June 29, 2020 14:50
Flutter Widget to conditionally wrap a subtree with a parent without breaking the code tree
import 'package:flutter/widgets.dart';
/// Conditionally wrap a subtree with a parent widget without breaking the code tree.
///
/// [condition]: the condition depending on which the subtree [child] is wrapped with the parent.
/// [child]: The subtree that should always be build.
/// [conditionalBuilder]: builds the parent with the subtree [child].
///
/// ___________
/// Usage:
@Nargonath
Nargonath / packages-list.md
Last active November 10, 2024 08:19
Npm packages for beautiful CLI
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active November 20, 2024 16:36
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@parmentf
parmentf / GitCommitEmoji.md
Last active November 20, 2024 16:29
Git Commit message Emoji