Skip to content

Instantly share code, notes, and snippets.

View devbkhadka's full-sized avatar

Dev devbkhadka

  • SmartMobe Solutions PVT. LTD.
  • Kathmandu, Nepal
View GitHub Profile
FROM devkhadka/ubuntuwithssh:1.0
@devbkhadka
devbkhadka / linear_regression_blog.ipynb
Last active August 12, 2019 12:46
Linear Regression Gradient Descent - Intuition, Math and Code
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@devbkhadka
devbkhadka / saving_dnn_classifier.ipynb
Last active August 22, 2019 12:44
saving and restoring custom dnn classifier built using tensorflow for using it with RandomizedSearchCV
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@devbkhadka
devbkhadka / commands.sh
Last active September 16, 2019 16:29
provision ubuntu server to host django site using nginx and gunicorn
# this command is necessary to tell Systemd to load our new config file
elspeth@server:$ sudo systemctl daemon-reload
# this command tells Systemd to always load our service on boot
elspeth@server:$ sudo systemctl enable gunicorn-superlists-staging.ottg.eu
# this command actually starts our service
elspeth@server:$ sudo systemctl start gunicorn-superlists-staging.ottg.eu
# Check the Systemd logs for using
@devbkhadka
devbkhadka / linear_regression_tutorial.ipynb
Created November 10, 2019 02:14
Linear Regression Tutorial With Intution, Math and Code
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@devbkhadka
devbkhadka / numpy_tutorial.ipynb
Created November 10, 2019 02:16
Numpy Tutorial - Vectorization, Broadcasting, Fancy Indexing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@devbkhadka
devbkhadka / App.test.js
Last active April 11, 2020 13:29
Jest Tutorial
import React from 'react';
import { render } from '@testing-library/react';
import App from '../App';
import Restaurants from '../Restaurants'
import {fetchRestaurants} from '../utils'
import * as fixtures from '../fixtures'
import { act } from 'react-dom/test-utils';
// First mock whole '../Restaurants' and '../utils'
// By default it will mock all the functions in module to return undefined
@devbkhadka
devbkhadka / restaurants.json
Last active April 12, 2020 06:38
jest tutorial
[
{
"id": 1,
"name": "MacDonald",
"location": [27.696927, 85.329353]
},
{
"id": 2,
"name": "Bajeko Sekuwa",
"location": [26.212754, 84.961525]
@devbkhadka
devbkhadka / App.js
Last active April 12, 2020 08:03
Jest Tutorial
import React, { useEffect, useState } from 'react';
import './App.css';
import { fetchRestaurants } from './utils';
import Restaurants from './Restaurants';
function App() {
const [restaurants, setRestaurants] = useState(null)
useEffect(()=>{
fetchRestaurants()
.then(setRestaurants)
@devbkhadka
devbkhadka / Restaurants.test.js
Last active April 12, 2020 08:34
jest tutorial
import React from 'react'
import {render, fireEvent} from '@testing-library/react'
import Restaurants from '../Restaurants'
import * as fixtures from '../fixtures'
import {calculateDistance} from '../utils'
jest.mock('../utils')
describe("Restaurants Component", ()=>{
it("should render restaurants passed to it", ()=>{
// render function returns a handle