Skip to content

Instantly share code, notes, and snippets.

View MahbbRah's full-sized avatar
🎯
Focusing

Mahbub Rahman MahbbRah

🎯
Focusing
  • Dinajpur, Bangladesh
View GitHub Profile
@MahbbRah
MahbbRah / react-native-push-notification
Created November 30, 2018 09:38
Setup Push Notification with React Native (Instructions/Guide)
Setup of React native push notification is very easy things. But documentations and all that isn't right the way it should be.
So in this short snippet I'm going to explain, How you can achieve this without any issues!
#This guid is for only Android Developers for now
#First step
> we will use this library for push notification: https://github.com/zo0r/react-native-push-notification Install this library on with your project
> and then do a link it as mentioned. But Only linking is not enough at all!
@MahbbRah
MahbbRah / Javascript_fetch_request_php_server.md
Last active January 9, 2020 09:30
Making http POST/GET request from React-Native/React/Javascript side (Using Fetch API) to PHP server
// A function that sends http POST request to PHP server by using Javascript Fetch API with async/await :) 
async function POST(url, payload){

    var body = Object.keys(payload).map((key) => {
        return encodeURIComponent(key) + '=' + encodeURIComponent(payload[key]);
    }).join('&');

 let options = {
@MahbbRah
MahbbRah / centering-react-native-content.md
Created December 12, 2018 02:07
Centering react native elements/contents from all the way, With Flex/Flexbox
// This example has been collected from react-Native official Project. :)


//Markup example
<View style={styles.container}>
  <Text style={styles.welcome}>Welcome to React Native!</Text>
  <Text style={styles.instructions}>To get started, edit App.js</Text>
 {instructions}
@MahbbRah
MahbbRah / agile_dev_basics.md
Last active April 19, 2019 06:42
This is a short assignment for my versity class top of Agile Development Methodology.

Name: Mahabur Rahman

Roll: 171442643

Dept: CSE(Eve)

Subject: System Analysis and Design

Assignment: Agile Development Methodology

@MahbbRah
MahbbRah / image_loading_check.js
Created May 1, 2019 09:48
Checking if a image loaded or not via img with js
function checkImage(imageSrc, good, bad) {
var img = new Image();
img.onload = good;
img.onerror = bad;
img.src = imageSrc;
}
//now we need to run the function written above to see if the image is loaded or not via callback
checkImage(
@MahbbRah
MahbbRah / gitPush.bash
Last active July 7, 2019 04:35
merging git all commands in a bash function to use as a command
# to use this function as a bash command add this to your bash_profile ~ root directory in windows and then reload bash profile
# and you're ready to go simply type: gitPush "commit message that you want to add";;
gitPush() {
git add .
#Here "$1" as the arugment that'll collect the mnessage for commit
git commit -am "$1"
git push -u origin master
}
@MahbbRah
MahbbRah / ffmpeg_commands.md
Last active August 5, 2019 11:17
I will try to include useful commands for ffmpeg video processing library :)

#Extract Audio from video ffmpeg -i 'input_file' -f mp3 -ab 192000 -vn 'output.mp3'

#Remove Audio From Video ffmpeg -i 'input_video_file' -vcodec copy -an 'output_video_file'

#Merge audio with a video. `ffmpeg -i video.mp4 -i audio.wav \

@MahbbRah
MahbbRah / enableExec.php
Created August 27, 2019 02:58
Enable exec shell_exec in php
By default in Xampp, wamp server you can't run these functions `exec` or `shell_exec` to run these shell commands you
need to edit `php.ini` file and add/edit this command to like this `set safe_mode_exec_dir (line after = is empty, so IT IS ON!!!) set it off!`
for more: https://stackoverflow.com/questions/12757891/enable-shell-exec-in-wamp-server
@MahbbRah
MahbbRah / check_username_in_password.js
Last active September 19, 2019 13:23
Check if password includes user name or part of it
function checkPasswordForUserName(userFullName, userPass) {
const userNamesList = userFullName.toLowerCase().split(" ");
const firstThreeChars = userFullName.substring(0, 3);
const lowerCasePassword = userPass.toLowerCase();
const isUserNameInPassword = (name) => (
lowerCasePassword.includes(name) ||
lowerCasePassword.includes(firstThreeChars)
);
@MahbbRah
MahbbRah / pattern-for-requestAnimationFrame.js
Last active March 31, 2021 09:54
Pattern for using requestAnimationFrame instead setInterval or setTimeout because it's much efficient and faster
let request
const performAnimation = () => {
request = requestAnimationFrame(performAnimation)
//You can do whatever you want continously or conditional based on your needs, have fun!
//Here your code goes for using as setTimeout simply call cancelAnimationFrame(request) or to use as setInterval don't use the cancelAnimation
}
requestAnimationFrame(performAnimation)