Skip to content

Instantly share code, notes, and snippets.

View ahlusar1989's full-sized avatar
🏀
Let's Go!

Saran Ahluwalia ahlusar1989

🏀
Let's Go!
View GitHub Profile
import React from 'react';
import App from './containers/AppContainer';
import Login from './containers/LoginContainer';
import Signup from './containers/SignUpContainer';
import MapContainer from './containers/MapContainer';
import ListingsContainer from './containers/ListingsContainer';
import createBrowserHistory from 'history/createBrowserHistory'
import { Router, Route, Switch, Redirect } from 'react-router-dom';
const history = createBrowserHistory()
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<style>
</style>
<script type="text/javascript">
function now() {
return new Date().toLocaleDateString()
}
</script>
const jsreport = require("jsreport-core")();
const { fetchReportTemplate } = require("../reports/report-template");
const router = require('express').Router()
const fs = require('fs');
const express = require('express');
const path = require('path');
const reportingApp = express();
jsreport.use(require('jsreport-express')({ app: reportingApp }));
jsreport.use(require('jsreport-chrome-pdf')());
@ahlusar1989
ahlusar1989 / GibbsLDA.py
Created March 23, 2018 21:16 — forked from ChangUk/GibbsLDA.py
Collapsed Gibbs sampler for Latent Dirichlet Allocation
#-*- coding: utf-8 -*-
"""
GIBBS SAMPLING IMPLEMENTATION FOR LATENT DIRICHLET ALLOCATION (2003)
IMPLEMENTED BY CHANG-UK, PARK
DATA FORMAT: "DocID\t WordID\t FREQUENCY\n"
"""
import sys
import random
/* global require, exports */
var walkdir = require('walkdir'),
fs = require('fs'),
readInstalled = require('read-installed'),
emitter = require('events').EventEmitter;
function listdep(parent, dep, level, deps) {
var stack = [];
{
"name": "petal length (cm) > 2.45000004768",
"children": [
{
"name": "petal width (cm) > 1.75",
"children": [
{
"name": "petal length (cm) > 4.85000038147",
"children": [
{
@ahlusar1989
ahlusar1989 / jupyter-google-cloud.md
Last active January 4, 2018 15:13 — forked from valentina-s/jupyter-google-cloud.md
Jupyter Notebook on Google Cloud Compute Instance

On Instance:

pip install jupyter[notebook]

jupyter notebook --generate-config

# nano .jupyter/jupyter_notebook_config.py

echo "c = get_config()
c.NotebookApp.ip = '*'
@ahlusar1989
ahlusar1989 / pytorch_keras_gcloud.txt
Created January 2, 2018 16:24 — forked from motiur/pytorch_keras_gcloud.txt
Keras and Pytorch in Google Cloud VM
# This script is designed to work with ubuntu 16.04 LTS
# with keras 1.2.2 and the latest Pytorch with CUDA 8 support
##########################################################################
#This is used to install CUDA 8 driver for Tesla K80
##########################################################################
#!/bin/bash
echo "Checking for CUDA and installing."
# Check for CUDA and try to install.
if ! dpkg-query -W cuda-8-0; then
@ahlusar1989
ahlusar1989 / middlewares.py
Created October 11, 2017 19:47 — forked from seagatesoft/middlewares.py
An example of RotateUserAgentMiddleware
from random import choice
from scrapy import signals
from scrapy.exceptions import NotConfigured
class RotateUserAgentMiddleware(object):
"""Rotate user-agent for each request."""
def __init__(self, user_agents):
self.enabled = False
self.user_agents = user_agents
"use-strict";
const Promise = require("bluebird");
const superagent = require("superagent");
function createEvent(data) {
return new Promise((resolve, reject) => {
superagent
.post(`${/events}`)
.send(data)