Skip to content

Instantly share code, notes, and snippets.

View adityapatadia's full-sized avatar

Aditya Patadia adityapatadia

View GitHub Profile
@adityapatadia
adityapatadia / bb-migrate.sh
Created April 24, 2024 17:13
Bitbucket to Github migration script
###############Shell script for migrating all repo’s reading from file################
#!/bin/bash
name_of_github_org=yourorg
while IFS="" read -r p || [ -n "$p" ]
do
git clone --bare $p;
repo=`echo "$p" | cut -d "/" -f 2`
@adityapatadia
adityapatadia / html-to-pdf.js
Created July 25, 2020 06:40
HTML to PDF conversion using Puppeteer
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
adityapatadia / neural_network.py
Last active October 5, 2018 15:11
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)