Skip to content

Instantly share code, notes, and snippets.

View mazfreelance's full-sized avatar
🎯
Focusing

nimza mazfreelance

🎯
Focusing
View GitHub Profile
@mazfreelance
mazfreelance / gist:9afe62cfb4c69d880ed5bf27cb1260ef
Last active September 19, 2023 04:10
setup PostgresSQL database
# Access PostgreSQL: Once PostgreSQL is installed, you can access it using the command-line tool psql.
# Open your terminal or command prompt and run:
psql -U postgres
# Create a Database: To create a new database, you can use the following SQL command inside the psql prompt:
CREATE DATABASE yourdbname;
# Create a User with a Password: You can create a new user and set a password for that user using the following SQL commands:
CREATE USER yourusername WITH PASSWORD 'yourpassword';

first commit with tag

  • <tag> - eg: v0.0.1
$ git add.
$ git commit -m "Initial release"
$ git tag <tag> 
$ git push origin master --tags
@mazfreelance
mazfreelance / add-local-dependency-composer.md
Last active September 26, 2023 02:14
add local dependencies into composer.json

the following directory structure in your repository

├── apps
│   └── my-app
│       └── composer.json
├── packages
│   └── my-custom-package
│       └── composer.json
@mazfreelance
mazfreelance / NEW GIT url
Last active October 8, 2021 07:35
Github shut down password authentication. u should change repo url if want clone , pull , push and so on.
old : https://github.com/<username>/<username/project_name.git>
new : https://<username>:<personal_token>@github.com/<username/project_name.git>
- generate personal token
Settings > Developer settings > Personal access tokens
git remote set-url origin <url>
git remote -v (view remote url)
@mazfreelance
mazfreelance / README.md
Last active January 30, 2020 09:17
Javascript: Month range picker using daterangepicker()
@mazfreelance
mazfreelance / README.md
Last active January 22, 2020 04:19
JQUERY: multiselect list swap
@mazfreelance
mazfreelance / append data to selection form
Created January 14, 2020 04:02
append data to selection form using ajax
$.ajax({
url: '../example.php',
type: 'post',
data: {},
success: function( data, textStatus, jQxhr ){
// console.log(data);
var itemID = <?php echo json_encode($item_id); ?>;
// console.log(itemID);
$.each(data['data'], function(key, value) {
$('select#select_item').append($("<option></option>").attr("value",key).text(value)).trigger('change');
@mazfreelance
mazfreelance / deleteimagepost
Last active August 20, 2019 10:25
PHP - Summernote library: Store uploaded image file into folder server.
$file_name = str_replace(base_url().'/uploads/email/', '', $src); // striping host to get relative path
if(unlink($file_name))
{
echo 'File Delete Successfully';
}
@mazfreelance
mazfreelance / Dynamic List Laravel
Created September 6, 2018 03:15
Dynamic List Laravel
//Model
namespace App;
use Illuminate\Database\Eloquent\Model;
class ModelName extends Model
{
protected $table = 'table_name_dB';
}
@mazfreelance
mazfreelance / JQUERY checkbox validation
Created April 13, 2018 01:49
validation checkbox select atleast one
//html
<input type="checkbox" class="checkbox" name="checkbox[]" value="checkbox 1"/>
<input type="checkbox" class="checkbox" name="checkbox[]" value="checkbox 2"/>
<p id="validation"></p>
//form submit
$('#form-id').submit(function(evt){
evt.preventDefault();
...
if(!$('.checkbox').is(":checked")) {