Skip to content

Instantly share code, notes, and snippets.

View eliyas5044's full-sized avatar
🏠
Working from home

Eliyas Hossain eliyas5044

🏠
Working from home
View GitHub Profile
"dependencies": {
"@angular/common": "2.0.0-rc.6",
"@angular/compiler": "2.0.0-rc.6",
"@angular/compiler-cli": "0.6.0",
"@angular/core": "2.0.0-rc.6",
"@angular/forms": "2.0.0-rc.6",
"@angular/http": "2.0.0-rc.6",
"@angular/platform-browser": "2.0.0-rc.6",
"@angular/platform-browser-dynamic": "2.0.0-rc.6",
"@angular/router": "3.0.0-rc.2",
@eliyas5044
eliyas5044 / article.component.ts
Created October 6, 2016 17:08
angular front-end with laravel 5.3 back-end
import {Component, OnInit} from "@angular/core";
import {ArticleService} from "./article.service";
import {Article} from "./article";
@Component({
moduleId: module.id,
selector: 'article',
template: `
<h1>All Articles</h1>
<hr>
<div *ngFor="let article of articles">
@eliyas5044
eliyas5044 / Country Currency Codes JSON
Created November 15, 2018 08:29 — forked from grosscorporation/Country Currency Codes JSON
currency symol, name, plural, and decimal digits for all major and minor currencies
[
{
"USD" : {
"symbol" : "$",
"name" : "US Dollar",
"symbol_native" : "$",
"decimal_digits" : 2,
"rounding" : 0,
"code" : "USD",
"name_plural" : "US dollars"
@eliyas5044
eliyas5044 / currencies.json
Created November 15, 2018 09:13
Country currencies as an array
[
{
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@eliyas5044
eliyas5044 / deploy.sh
Last active November 6, 2019 08:38
Git webhooks to automatically deploy in server from Gitlab webhook
#!/bin/bash
# redirect stdout/stderr to a file
exec > /home/daily/webhooks/dailycricket-dev/output.log 2>&1
# pull latest code from gitlab
echo "Starting to pull from gitlab..."
git pull origin master
# remove node_modules
echo "Removing node_modules folder..."
@eliyas5044
eliyas5044 / bn.php
Created June 8, 2020 03:53
Phonetic mapping of Bengali to English.
<?php
return [
// Bengali (Bangla)
'bn' => [
'ভ্ল' => 'vl',
'পশ' => 'psh',
'ব্ধ' => 'bdh',
'ব্জ' => 'bj',
'ব্দ' => 'bd',
@eliyas5044
eliyas5044 / MySQL.md
Last active December 29, 2022 18:13
MySQL Commands for Laravel

MySQL CLI

To login into mysql, enter db_password

mysql -u db_user -p

Create database

CREATE DATABASE db_name;
@eliyas5044
eliyas5044 / bulk_insert_or_update.php
Created December 16, 2020 10:38
Bulk insert or update in Laravel
// first get ids from table
$exist_ids = DB::table('shipping_costs')->pluck('area_id')->toArray();
// get requested ids
$requested_ids = $request->get('area_ids');
// get updatable ids
$updatable_ids = array_values(array_intersect($exist_ids, $requested_ids));
// get insertable ids
$insertable_ids = array_values(array_diff($requested_ids, $exist_ids));
// prepare data for insert
$data = collect();
@eliyas5044
eliyas5044 / Nuxt-DOM-error-with-vuetify.md
Created May 16, 2021 16:07
Fixing Nuxt client-side rendered virtual DOM error in vuetify
  1. Define isHydrated in data property and set default value false.
data: {
  return {
    isHydrated: false,
  };
},
  1. Define breakpoint computed property and set some default value of $vuetify breakpoints.
rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress /var/www/html/example.com/storage/app/public forge@ip_address:/home/forge/example.com/storage/app