Skip to content

Instantly share code, notes, and snippets.

View merin83's full-sized avatar
☀️
Creating New Things

Md. Estiak Ahmmed (Merin) merin83

☀️
Creating New Things
View GitHub Profile
@merin83
merin83 / .php
Created July 5, 2018 11:07
Decode JSON.stringify(object) in php
_log(json_decode(stripslashes_deep($ajax_data['formStyleSettings'])), true);
@merin83
merin83 / restapi.txt
Last active May 5, 2018 11:19 — forked from chrismccoy/restapi.txt
WordPress REST API Resources
Allow ALL cross origin requests to WordPress REST API
https://github.com/Shelob9/rest-all-cors
WordPress theme using Rest API and Vue.js
https://github.com/rtCamp/VueTheme
WordPress Post from Front End using REST API and Vue.js
http://jimfrenette.com/2017/01/post-from-front-end-wp-api-vuejs/
An offline-first SPA using Vue.js, the WordPress REST API and Progressive Web Apps
@merin83
merin83 / zip.txt
Created January 9, 2018 07:03
zip.zip
zip -r -X folder_name.zip folder_name/
@merin83
merin83 / .txt
Last active December 18, 2017 07:35
Change Mamp Domain name
# From Chrome v63 or above it redirects all the .dev domain in localhost to https and it causes trouble for your local development
here is what i've done for my wordpress development with mamp,
i) first i've change the domain name .dev to .test https://cl.ly/2g0z3H3m3F2d
ii) then i've also change my wordpress installed folder name from .dev to .test https://cl.ly/291d31043K3e
iii) now you have to open your hosts file and there you will find your wordpress site url change the .dev to .test https://cl.ly/213o1O3h4305
iv) finally in your wordpress site database from the database wp_options table cahnge the site url and home url to .test https://cl.ly/3k3v3X0C2K26
in case of multisite make sure your wp_site, wp_blogs url also changed to .test domain
@merin83
merin83 / FirebaseToFirestore.js
Created December 6, 2017 12:20 — forked from JoeRoddy/FirebaseToFirestore.js
Convert Firebase Database JSON to Firestore Collections
var db = firebase.firestore();
var content = require("./sourceData.json");
content &&
Object.keys(content).forEach(contentKey => {
const nestedContent = content[contentKey];
if (typeof nestedContent === "object") {
Object.keys(nestedContent).forEach(docTitle => {
firebase
.firestore()
foo() {
echo "Parameter #1 is $1" #and this is the argument value
echo "$2"
}
foo "hello" "what" #this are the argument you are passing to foo function
@merin83
merin83 / multiple array paremeter in bash function
Created November 12, 2017 13:57
multiple_array_paremeter_func.sh
function copyFiles() {
arr=("$@")
for i in "${arr[@]}";
do
echo "$i"
done
}
array=("one" "two" "three")
package main
import (
"bytes"
"log"
"context"
"fmt"
"net/http"
"time"
"encoding/json"
@merin83
merin83 / Cut #2
Last active October 30, 2017 13:25
2nd and 7th position string
while read C; do
text=${C:1:1}
text=$text${C:6:1}
echo $text
done
or
while read C; do
cut -c 2,7 <<< ${C}
@merin83
merin83 / Cut #1
Created October 30, 2017 09:43
nth position string in bash ( the long way )
read n
text=""
for ((i=0; i<n; i++))
do
temp=""
read input
temp=${input:2:1}
text=$text$temp
done
for ((i=0; i<n; i++))