Skip to content

Instantly share code, notes, and snippets.

<form class="example-form">
<mat-form-field class="example-full-width">
<input matInput placeholder="State" aria-label="State" [matAutocomplete]="auto" [formControl]="stateCtrl">
<mat-autocomplete #auto="matAutocomplete">
<mat-option (onSelectionChange)="onSelectFn($event,state)" *ngFor="let state of filteredStates | async" [value]="state.name">
<img style="vertical-align:middle;" aria-hidden src="{{state.flag}}" height="25" />
<span>{{ state.name }}</span> |
<small>Population: {{state.population}}</small>
</mat-option>
</mat-autocomplete>
<div>
<table class="table table-bordered table-condensed table-striped table-hover">
<thead>
<tr>
<th>SL</th> <th>Size</th> <th>Diameter</th>
<th class="text-center">
<input type="checkbox" name="all" [checked]="isAllChecked()" (change)="checkAll($event)"/>
</th>
</tr>
@shaiful16
shaiful16 / rpi
Last active January 27, 2018 00:08
#!flask/bin/python3
from flask import json,jsonify
from flask import Flask, url_for, request
import RPi.GPIO as GPIO # always needed with RPi.GPIO
app = Flask(__name__)
GPIO.setmode(GPIO.BCM) # choose BCM or BOARD numbering schemes. I use BCM
GPIO.setup(2, GPIO.OUT) # motor 1
@shaiful16
shaiful16 / DirectoryStructureToJson.java
Created June 1, 2017 08:08
Directory Structure to json by java
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
/**Directory Structure to json*/
public class DirectoryStructureToJson{
@Autowired
private MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter;
@RequestMapping(value = "/findFacultyWithDepartment", method = RequestMethod.GET)
public ResponseEntity<List<Faculty>> findFacultyWithDepartment() throws Exception {
System.out.println("findFacultyWithDepartment");
String str =mappingJackson2HttpMessageConverter.getObjectMapper()
.registerModule(new SimpleModule().addSerializer(
Faculty.class, new FacultySerializer())
{
"name": "ius-ep-ui",
"version": "0.0.1",
"description": "description",
"main": "index.html",
"moduleType": [],
"keywords": [ "" ],
"authors": [ "Shaiful Islam" ],
"license": "MIT",
"homepage": "index.html",
@CrossOrigin
@RequestMapping(value = "/fileRead", method = RequestMethod.GET)
public @ResponseBody String fileRead() throws Exception {
File file = new ClassPathResource("countries.txt").getFile();
FileInputStream fis = null;
@shaiful16
shaiful16 / json parse
Created October 5, 2016 14:42
json parse
$scope.jsonStr =
[
"{\"id\":\"2\",\"name\":\"shaiful\"}",
"{\"id\":\"1\",\"name\":\"ferdous\"}"
]
$scope.students = [];
$scope.prr=function(){
for(var i = 0; i < $scope.jsonStr.length; i++){
[
{
"id":1,
"name":"CSE",
"programList":[
{
"id":1,
"name":"CS",
"description":"aaaaaaaaaaaa"
},