Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Bilal bilal-fazlani

🏠
Working from home
View GitHub Profile
@bilal-fazlani
bilal-fazlani / dashboard.js
Last active Apr 7, 2018
signalr-react-demo
View dashboard.js
import React from "react";
import {connect} from "react-redux";
import {bindActionCreators} from "redux";
import {loadEmployeesAsync} from "../reducers/employees";
import {Link} from "react-router-dom";
class Dashboard extends React.Component {
async componentWillMount(){
//loading data only first time
@bilal-fazlani
bilal-fazlani / App.js
Created Apr 7, 2018
signalr-react-demo
View App.js
import React, {Component} from 'react';
import {Link, Route, withRouter} from "react-router-dom";
import About from "./Components/About";
import EmployeeDetails from "./Components/EmployeeDetails";
import AddEmployee from "./Components/AddEmployee";
import EditEmployee from "./Components/EditEmployee";
import Dashboard from "./Components/Dashboard";
class App extends Component {
render() {
@bilal-fazlani
bilal-fazlani / index.js
Created Apr 7, 2018
signalr-react-demo
View index.js
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();
@bilal-fazlani
bilal-fazlani / index.html
Last active Apr 7, 2018
signalr-react-demo
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<title>React App</title>
</head>
@bilal-fazlani
bilal-fazlani / index.js
Last active Apr 7, 2018
signalr-react-demo
View index.js
import React from 'react';
import {render} from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
import {Provider} from "react-redux";
import store, {history} from "./store";
import {ConnectedRouter} from "react-router-redux";
const target = document.querySelector('#root');
View Employee.cs
namespace SignalRServer.Models
{
public class Employee
{
public int Id { get; set; }
public string Name { get; set; }
public double Age { get; set; }
}
}
@bilal-fazlani
bilal-fazlani / Person.cs
Created Mar 10, 2018
LiteDB.AutoAPI example
View Person.cs
public class Person : LiteDbModel
{
public string Name { get; set; }
public double Age { get; set; }
public string City { get; set; }
}
@bilal-fazlani
bilal-fazlani / RequestResponseCopyExtensions.cs
Created Nov 21, 2017
These are some extension methods that enable copying of http requests and response objects.
View RequestResponseCopyExtensions.cs
using System.IO;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Newtonsoft.Json;
namespace Utilities
{
public static class RequestResponseCopyExtensions
You can’t perform that action at this time.