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
#!/bin/bash | |
# Made by st0rmis | |
# Get the last tag, increment major, minor or patch version and push it | |
declare -a valid_versions=('major' 'minor' 'patch') | |
CURTAG=`git fetch --tags && git tag -l --sort=-creatordate | head -1` | |
CURTAG="${CURTAG/v/}" | |
IFS='.' read -a vers <<< "$CURTAG" |
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 | |
namespace App\Rules; | |
use Closure; | |
use Illuminate\Contracts\Validation\ValidationRule; | |
class LatitudeRule implements ValidationRule | |
{ | |
/** |
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
axios.interceptors.response.use( | |
(response) => { | |
return response; | |
}, | |
(error) => { | |
if (error.response && error.response.status === 401) { | |
// Use router.push() to navigate to the login screen | |
router.push('/login'); // Adjust the route as needed | |
// Throw an exception to stop further execution | |
return Promise.reject('Unauthorized'); |
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 | |
/** | |
* This function was inspired by this mysql tutorial https://www.youtube.com/watch?v=QgnCB8X_sN4 | |
* @param float $latitude | |
* @param float $longitude | |
* @param int $bearing 0 = north, 180 = south, 90 = east, 270 = west | |
* @param int $distance m = miles or km = kilometer | |
* @param string $distance_unit | |
* |
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
##################### | |
# | |
# Use this with or without the .gitattributes snippet with this Gist | |
# create a fixle.sh file, paste this in and run it. | |
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF) | |
# This Gist normalizes handling by forcing everything to use Unix style. | |
##################### | |
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF |
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 TABLE IF NOT EXISTS `country` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`iso` char(2) NOT NULL, | |
`name` varchar(80) NOT NULL, | |
`nicename` varchar(80) NOT NULL, | |
`iso3` char(3) DEFAULT NULL, | |
`numcode` smallint(6) DEFAULT NULL, | |
`phonecode` int(5) NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=MyISAM DEFAULT CHARSET=latin1; |
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
package tech.caveman; | |
import com.mongodb.MongoClient; | |
import com.mongodb.client.MongoCollection; | |
import com.mongodb.client.MongoDatabase; | |
import org.bson.Document; | |
import java.util.ArrayList; | |
import java.util.List; |
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
[ | |
{ | |
"name": "Afghanistan", | |
"dial_code": "+93", | |
"code": "AF" | |
}, | |
{ | |
"name": "Aland Islands", | |
"dial_code": "+358", | |
"code": "AX" |
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
/(0|\+?254)7([0-3|7])(\d){7}/ |
NewerOlder