Skip to content

Instantly share code, notes, and snippets.


Aditya Patadia adityapatadia

View GitHub Profile
adityapatadia / html-to-pdf.js
Created Jul 25, 2020
HTML to PDF conversion using Puppeteer
View html-to-pdf.js
async function printPDF(html){
const browser = await puppeteer.launch({headless: true, args: ["--no-sandbox=true"]});
const page = await browser.newPage();
await page.setContent(html);
const pdf = await page.pdf({ format: 'A4' });
await browser.close();
return pdf
adityapatadia / Dockerfile
Created Sep 10, 2019
Libvips build with mozjpeg
View Dockerfile
FROM node:12.8-buster
ENV NODE_ENV=production
RUN apt-get -y update && \
apt-get -y install build-essential libtiff5-dev libpng-dev \
libfftw3-dev librsvg2-dev libgif-dev libexif-dev \
libexpat1-dev pkg-config glib2.0-dev libimagequant-dev libgsf-1-dev \
liborc-0.4-dev liblcms2-dev autoconf nasm libtool automake \
adityapatadia /
Last active Oct 5, 2018
Simple Neural Network in Python which learns AND gate
import numpy as np
def sigmoid(x, derivative=False):
return x*(1-x) if derivative else 1/(1+np.exp(-x))
class NeuralNetwork:
def __init__(self, x, y):
self.input = x
self.weights1 = np.random.rand(self.input.shape[1],4)
You can’t perform that action at this time.