Skip to content

Instantly share code, notes, and snippets.

View mfsiat's full-sized avatar
👾
bugs everywhere

Md. Nasirul Islam mfsiat

👾
bugs everywhere
View GitHub Profile
@mfsiat
mfsiat / prefix.json
Created April 24, 2021 10:42
Prefix query in Elasticsearch
{
"query": {
"bool": {
"must": [
{
"prefix": {"business_name_filtered": "johukum"}
}
]
}
} ,
{
"query": {
"bool": {
"must": [
{
"regexp": {
"business_name.keyword": "jo[a-zA-Z ]*hukum"
}
}
],
@mfsiat
mfsiat / term.json
Created April 24, 2021 09:56
Searches termwise but it cant search that good
{
"query": {
"bool": {
"must": [
{
"term": {
"business_name": "softopark"
}
}
],
@mfsiat
mfsiat / match.json
Created April 24, 2021 09:42
Match Query
{
"query": {
"bool": {
"must": [
{
"match": {
"business_name": "jo hukum"
}
}
],

Shuveccha nin amar pokkho theke

import React, { Component } from 'react'
import { Consumer } from '../../context'; // importing the consumer from the context.js
class Tracks extends Component {
render() {
return (
<Consumer>
{value => {
// the value will be passed from the context.js
@mfsiat
mfsiat / app.component.ts
Created November 6, 2019 06:31
How to declare types for properties and how to call methods from the html files
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { UserComponet } from './components/user/user.component';
@NgModule({
declarations: [
AppComponent,
UserComponet
const express = require('express');
const router = express.Router();
const fetch = require('node-fetch');
router.get('/:platform/:platformUserIdentifier', async (req, res) => {
try {
const headers = {
'TRN-Api-Key': process.env.TRACKER_API_KEY
};
@mfsiat
mfsiat / App.js
Last active August 28, 2019 17:56
render() {
return (
<View >
<View >
<FlatList
data = {this.state.busLists}
renderItem = {({item}) => (
<View>
<Text>{item}</Text>
</View>
@mfsiat
mfsiat / CreateController.php
Last active June 25, 2019 11:23
Suppose we have a blog and we want to create post under a specific id to do that we need to validate our id using login and on the function we create a new object and under that object we put our data and to specify the specific id we put an user id
public function store(Request $request)
{
$this->validate($request, [
'title' => 'required',
'body' => 'required'
]);
// Create Post
$post = new Post;
$post->title = $request->input('title');