// 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 = {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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! |
// 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}Name: Mahabur Rahman
Roll: 171442643
Dept: CSE(Eve)
Subject: System Analysis and Design
Assignment: Agile Development Methodology
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 | |
| } |
#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 \
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) | |
| ); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |