Skip to content

Instantly share code, notes, and snippets.

View source-nerd's full-sized avatar

Sam source-nerd

View GitHub Profile
@source-nerd
source-nerd / supress-warning-idea.md
Created August 10, 2022 10:57 — forked from vegaasen/supress-warning-idea.md
SuppressWarnings with IntelliJ Idea

@SuppressWarnings - IntelliJ modes

Information

This list may grow each year with either new versions or patches. Enjoy!

Usage

Following is an example related to the usage of the various ignore capabilities.

@source-nerd
source-nerd / scrape_market_watch.py
Created April 30, 2021 18:34
Scrape Market watch for real time stock price
import re
import requests
from bs4 import BeautifulSoup
class ScrapeMarketWatch:
def __init__(self, stock: str):
self.stock = stock.strip().lower()
self.url = 'https://www.marketwatch.com/investing/stock/' + self.stock + '?mod=over_search'
def get_page(self):
@source-nerd
source-nerd / france_schengen.py
Created February 29, 2020 16:31
France schengen visa appointment bot
from selenium import webdriver
import time
from selenium.webdriver import ActionChains
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
@source-nerd
source-nerd / Windows 10 Pro Activation.md
Created February 18, 2020 23:14
Windows 10 Pro Activation
@source-nerd
source-nerd / Windows 10 Pro Activation.md
Created February 18, 2020 23:14
Windows 10 Pro Activation
# native Python progress bar without using any library
from time import sleep
def progress_bar(percent=0, width=30):
left = width * percent // 100
right = width - left
print('\r[', '#' * left, ' ' *right, ']', f'{percent: .0f}%', sep='', end='', flush=True)
if __name__ == "__main__":
@source-nerd
source-nerd / confusion_matrix_pretty_print.py
Created March 30, 2019 04:27 — forked from shaypal5/confusion_matrix_pretty_print.py
Pretty print a confusion matrix with seaborn
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
def print_confusion_matrix(confusion_matrix, class_names, figsize = (10,7), fontsize=14):
"""Prints a confusion matrix, as returned by sklearn.metrics.confusion_matrix, as a heatmap.
Arguments
---------
confusion_matrix: numpy.ndarray
@source-nerd
source-nerd / naive-rae.py
Created February 22, 2019 23:04 — forked from ktnyt/naive-rae.py
Naive implementation of a recursive autoencoder
import numpy as np
import theano
import theano.tensor as T
class RAE(object):
def __init__(self, input, rng, d, W=None, b=None, U=None, c=None):
dv = d
dh = d * 2
self.dv = dv
@source-nerd
source-nerd / yosemite ntfs read+write.txt
Created February 4, 2019 23:06 — forked from bjorgvino/yosemite ntfs read+write.txt
osxfuse + ntfs-3g + Yosemite = NTFS R/W
Remove osxfuse if installed via homebrew:
> brew uninstall osxfuse
Install osxfuse binary and choose to install the MacFUSE compatibility layer:
http://sourceforge.net/projects/osxfuse/files/latest/download?source=files
Reboot (optional but recommended by osxfuse)
Install ntfs-3g via homebrew:
> brew update && brew install ntfs-3g
# Command to download file via aria2c using magnet link.
# See website and documentation at https://aria2.github.io
# -d specifies the directory to store the downloaded file
# --seed-time=0 disables seeding after download has completed
aria2c -d ~/Downloads --seed-time=0 "magnet_link_here"