This file contains 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
#1 npm install gh-pages --save-dev | |
#2 |
This file contains 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
var arr = ["1","2","3","4","5"]; | |
arr = arr.map(Number); | |
console.log(arr) |
This file contains 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
/** | |
* @description Callback on the file selection. On Upload | |
* - Check if their is seats available on the row | |
* - Check if best seats available in row | |
* @param {int} seatsNeeded - count of best seats needed in a row | |
* @param {int} allSeats - count of total seats in a row | |
* @param {number[]} bookedSeats - list of booked seats in a row | |
* @param {consecutive|non-consecutive} type - should we need consecutive or non-consecutive seats | |
* @returns {number[] | false} - list of best seats available or false | |
*/ |
This file contains 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
<?php | |
function getRailwayTime($time){ | |
$am = explode('am',str_replace(array('am','Am','aM', 'AM'),'am', $time)); | |
$pm = explode('pm',str_replace(array('pm','Pm','pM', 'PM'),'pm', $time)); | |
$output = 0; | |
if(isset($am[1])){ | |
$output = $am[0]; | |
}else if(isset($pm[1])){ | |
if((int)$pm[0] > 0){ |
This file contains 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
<?php | |
function getNextDates($blockDates, $countOfNextDatesToShow = 0) | |
{ | |
//date format - 'Y-m-d' | |
//strtotime(" +1 day") - add 1 to current date | |
//strtotime(" +1 weekday") - add 1 to current date execulding saturday & sunday | |
$_blockDates = []; | |
$nextDates = array_fill(0, $countOfNextDatesToShow, ""); | |
foreach ($blockDates as $date) |
This file contains 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
div { | |
height: 200px; | |
width: 100px; | |
border: 1px solid black; | |
overflow: auto; | |
} | |
p { | |
height: 80px; | |
background: blue; |
This file contains 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
//React Hook Form - handle server error | |
import { useForm } from "react-hook-form"; | |
import { useMutation } from "react-query"; | |
import axios from "axios"; | |
const Login = () => { | |
const [userData, setUserData] = useState({}); | |
const { register, handleSubmit, errors, setError } = useForm(); |
This file contains 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
//create a div with id | |
<div id="snap-chat"></div> | |
//include the script to render the widget | |
<script> | |
!function(e,n,c,s,t,a,o){e.SnapChatGlobalName="sc",e.sc=e.sc||function(){(e.sc.q=e.sc.q||[]).push(arguments)},e.sc.l=1*new Date,a=n.createElement(c),o=n.getElementsByTagName(c)[0],a.async=1,a.src="https://karthicksivakumar191194.github.io/snapchat/snapchat_bundle.js",o.parentNode.insertBefore(a,o)}(window,document,"script"); | |
sc("snap-chat"); | |
</script> | |
// sc("snap-chat"); | arg1 - HTML ID(required) |
This file contains 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
API Gateway | |
API Gateway build with golang for managing license and with proxy to forward the request to micro service | |
https://api-gatewayy.herokuapp.com/ | |
Add the License Key to Headers with key name "LicenseKey" | |
Test License Key: | |
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NDE5OTI2NTUsImxpY2Vuc2VfZG9tYWluIjoiYXBpLWdhdGV3YXl5Lmhlcm9rdWFwcC5jb20ifQ.L1tMC7I3KWfHtFunAGyieBlvxcJQjUOEt_2BcDVom_o |
This file contains 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
Go to your terminal, ssh into your server, cd into your project and run this command. | |
crontab -e | |
This will open the server Crontab file, paste the code below into the file, save and then exit. | |
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1 | |
//Do not forget to replace /path/to/artisan with the full path to the Artisan command of your Laravel Application. |
NewerOlder