Skip to content

Instantly share code, notes, and snippets.

View nimitbhargava's full-sized avatar
💻
Building awesome things

Nimit Bhargava nimitbhargava

💻
Building awesome things
View GitHub Profile
@nimitbhargava
nimitbhargava / webserver.py
Last active August 10, 2017 18:19
Building A Server With HTTPBaseServer in Python | Documentation on HTTPBaseServer (https://docs.python.org/2/library/basehttpserver.html)
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
class WebServerHandler(BaseHTTPRequestHandler):
def do_GET(self):
if self.path.endswith("/hello"):
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()
@nimitbhargava
nimitbhargava / get-new-courses.js
Last active February 16, 2018 13:11
Udacity Courses Catalog - `new` filter
$('div[data-course-summaries] div[data-course-summary]').each(function () {
var card = $(this);
var courseID = card.attr('id');
var coursePublished = $('#'+courseID+' .col-sm-9 .row .col-sm-8 .h-slim .badges .badge').data('cloak') === "" ? "old" : "new";
if(coursePublished === "old") card.css("display","none");
});
@nimitbhargava
nimitbhargava / laravel-homestead-setup.md
Last active May 13, 2020 12:15
Laravel Homestead Setup

Setup

  1. Download Vagrant and then vagrant box add laravel/homestead. Please use 3) virtualbox option if asked.
  2. cd ~; git clone https://github.com/laravel/homestead.git ~/Homestead
  3. cd ~/Homestead
  4. bash init.sh (create the Homestead.yaml configuration file and will be placed in the Homestead directory)
  5. vi Homestead.yaml Modify this
- map: theyyam.test
@nimitbhargava
nimitbhargava / docker-compose.yml
Created March 30, 2020 17:04
Wordpress Docker Setup
version: '3.3'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress