Skip to content

Instantly share code, notes, and snippets.

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 / README.md
Created December 28, 2022 09:32 — forked from atenni/README.md
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

@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"],

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

@Muhammed-Rahif
Muhammed-Rahif / GitCommitEmoji.md
Created November 2, 2021 14:15 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
var express = require('express');
// Import of express-session
var session = require('express-session');
// Configure
app.use(session({secret:"Key",cookie:{maxAge:600000}}))
// Usage
app.use("./",(req,res) => {
req.session.YOUR_KEY = YOUR_VALUE
@Muhammed-Rahif
Muhammed-Rahif / index.html
Last active April 15, 2021 04:06
Get multiple selected (checked) CheckBox values in Array using jQuery
<table id="tblFruits">
<tr>
<td><input id="chkMango" type="checkbox" value="mango"/><label for="chkMango">Mango</label></td>
</tr>
<tr>
<td><input id="chkApple" type="checkbox" value="apple"/><label for="chkApple">Apple</label></td>
</tr>
<tr>
<td><input id="chkBanana" type="checkbox" value="banana"/><label for="chkBanana">Banana</label></td>
@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");
}
})