Skip to content

Instantly share code, notes, and snippets.

View NaxAlpha's full-sized avatar
😎
Solving Intelligence

Nauman Mustafa NaxAlpha

😎
Solving Intelligence
View GitHub Profile
@NaxAlpha
NaxAlpha / 1.json
Last active September 9, 2021 05:58
Badge Test
{
"message": "healthy",
"label": "ping",
"color": "green"
}
import os
[
(
fp := os.path.join('data', fn),
ff := open(fp),
text := ff.read(),
[
(
line := ln.strip(),
line := '"{}"'.format(line)
@NaxAlpha
NaxAlpha / sitemaps.txt
Created June 16, 2020 10:38
Sitemaps of top tech news websites
https://www.zdnet.com/sitemap/
https://gizmodo.com/sitemap.xml
https://betanews.com/sitemap.xml
https://www.wired.com/sitemap.xml
https://lifehacker.com/sitemap.xml
https://arstechnica.com/sitemap.xml
https://www.pcworld.com/sitemap.xml
https://www.engadget.com/sitemap.xml
https://www.geekwire.com/sitemap.xml
https://www.techradar.com/sitemap.xml
@NaxAlpha
NaxAlpha / imdb.py
Created June 16, 2020 10:34
IMDB Selenium Scrapper
# Researches a topic on the internet and collects content required for video generation.
from enum import Enum
from selenium import webdriver
# from selenium.webdriver.common.keys import Keys
# Trailer Compiler Template
@NaxAlpha
NaxAlpha / style.css
Last active April 29, 2019 10:09
Report Style
* {
margin: 0;
padding: 0;
font-family: 'Open Sans', sans-serif;
}
.padded {
padding: 20px
}
@NaxAlpha
NaxAlpha / gdrive-download.sh
Created February 10, 2019 08:55
Download Large File from Google Drive: https://stackoverflow.com/a/49444877/3139808
#!/bin/bash
# Usage bash gdrive-download.sh <file_id> <file_name>
fileid="$1"
filename="$2"
curl -c ./cookie -s -L "https://drive.google.com/uc?export=download&id=${fileid}" > /dev/null
curl -Lb ./cookie "https://drive.google.com/uc?export=download&confirm=`awk '/download/ {print $NF}' ./cookie`&id=${fileid}" -o ${filename}
rm cookie
@NaxAlpha
NaxAlpha / gdrive-download.sh
Created February 10, 2019 08:55
Download Large File from Google Drive: https://stackoverflow.com/a/49444877/3139808
#!/bin/bash
fileid="$1"
filename="$2"
curl -c ./cookie -s -L "https://drive.google.com/uc?export=download&id=${fileid}" > /dev/null
curl -Lb ./cookie "https://drive.google.com/uc?export=download&confirm=`awk '/download/ {print $NF}' ./cookie`&id=${fileid}" -o ${filename}
rm cookie
@NaxAlpha
NaxAlpha / gan.py
Last active December 23, 2018 07:41
MNIST Vanilla GAN Failure: Worked after weight initialization!
# Implements GAN
from itertools import chain
import torch
from torch.optim import *
from torch.autograd import *
from torch.nn.modules import *
import torchvision.transforms as T
from torchvision.datasets import MNIST
from torch.utils.data import DataLoader
@NaxAlpha
NaxAlpha / fab-pure.py
Last active July 12, 2018 09:27
[VX] Tensorflow-Fun: Build Fibonacci Series using Tensorflow
# Pure TF implm.
# Fibonacci series using tensorflow
import tensorflow as tf
import numpy as np
import time
def build_graph2(max_count):
init = np.zeros([max_count], dtype=int)
m0 = tf.Variable(init,dtype=tf.int32)
i0 = tf.constant(2)
@NaxAlpha
NaxAlpha / msra_to_east.py
Created July 5, 2018 08:06
EAST Helper Scripts
# This script converts msra ground truth format to east training format
# Download and extract MSRA, cd <MSRA_DIR>, mkdir out and run this script
# https://github.com/argman/EAST
import os
import math
import shutil
import numpy as np
rotate = lambda xy, theta: [xy[0] * math.cos(theta) - xy[1] * math.sin(theta),xy[0] * math.sin(theta) + xy[1] * math.cos(theta)]