Skip to content

Instantly share code, notes, and snippets.

View tawhidulIKhan's full-sized avatar
💭
Connecting dots

Tawhidul Islam Khan tawhidulIKhan

💭
Connecting dots
View GitHub Profile
const fetchUsers = require("./index");
const getError = require("./error");
const getFood = require('./food');
const axios = require("axios");
jest.mock('axios');
test('should ger users data', async () => {
const users = [{ name: 'Bob' }];
const resp = { data: users };
@tawhidulIKhan
tawhidulIKhan / wp-plugin-basic.php
Last active June 28, 2022 14:03
wp-plugin-basic.php
/**
* Plugin Name: Test plugin
* Plugin URI: https://tawhid.me
* Description: lorem ipusm.
* Version: 1.0.0
* Author: Tawhidul Islam Khan
* Author URI: https://tawhid.me
* WC requires at least: 5.0.0
* WC tested up to: 6.5.1
@tawhidulIKhan
tawhidulIKhan / 1618044448.txt
Last active April 10, 2021 08:47
Created with Copy to Gist
After run this in cmd
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
cd android && ./gradlew assembleDebug
then you can get apk app/build/outputs/apk/debug/app-debug.apk
@tawhidulIKhan
tawhidulIKhan / 1618044370.txt
Created April 10, 2021 08:46
Created with Copy to Gist
I've renamed the project' subfolder from: "android/app/src/main/java/MY/APP/OLD_ID/" to: "android/app/src/main/java/MY/APP/NEW_ID/"
Then manually switched the old and new package ids:
In: android/app/src/main/java/MY/APP/NEW_ID/MainActivity.java:
package MY.APP.NEW_ID;
In android/app/src/main/java/MY/APP/NEW_ID/MainApplication.java:
#!/usr/bin/env bash
# Shell Boilerplate
path="$1.test"
dbname="db_$1"
dbuser="root"
dbpass="secret"
url="localhost/$1.test";
title="Title"
admin_user="admin"
admin_password="secret"
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@tawhidulIKhan
tawhidulIKhan / Instructions.sh
Created November 18, 2020 06:07 — forked from GhazanfarMir/Instructions.sh
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@tawhidulIKhan
tawhidulIKhan / table-responsive.js
Last active September 14, 2020 16:19
Table Responsive
const makeTableResponsive = (mq, t) => {
var q = window.matchMedia(mq);
if (q.matches) {
let headings = [];
let tables = document.querySelectorAll(t);
if (tables && tables.length > 0) {
tables.forEach(table => {
let thead = table.querySelector("thead");
let headingTags = thead.querySelectorAll("th");
let tbody = table.querySelector("tbody");
https://www.youtube.com/watch?v=IL7Jd9rjgrM
php artisan cache:clear
php artisan route:cache
php artisan view:clear
php artisan config:cache
echo "All cached cleared"