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
["0"] => array (
["name"] => "american-sign-language-interpreting",
["className"] => "fa fa-american-sign-language-interpreting",
),
["1"] => array (
["name"] => "asl-interpreting (alias)",
["className"] => "fa fa-asl-interpreting",
),
["2"] => array (
["name"] => "assistive-listening-systems",
<?php
$filename = 'snippets.json';
$f = file_get_contents( $filename );
$data = json_decode( $f, true );
echo "<pre>";
convertJSONtoArray( $data, 0 );
echo "</pre>";
function convertJSONtoArray( $data, $level ) // level - уровень вложенности чтобы табуляцию писать правильную
{
foreach( $data as $key1 => $value1 )
var all = [];
var main = [];
jQuery('.glyph div').each(function(index, div) {
var name = jQuery('div.pbs').find('.mls');
var className = jQuery(name).text();
all.push(className);
});
main = all[0].split(" ");
main.forEach((item) => {
if(item.length) {
@merin83
merin83 / 0_reuse_code.js
Created January 18, 2017 13:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@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++))
@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}
package main
import (
"bytes"
"log"
"context"
"fmt"
"net/http"
"time"
"encoding/json"
@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")
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 / 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()