Skip to content

Instantly share code, notes, and snippets.

View bgoonz's full-sized avatar
🎯
learning

Bryan C Guner bgoonz

🎯
learning
View GitHub Profile
@alizeynalli
alizeynalli / WebScraping_Review_Lab.ipynb
Created April 17, 2021 11:08
Created on Skills Network Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zaydek
zaydek / virtualScroller.js
Created April 17, 2021 11:09
Probably a bad idea
React.useEffect(() => {
let animationFrame = 0
function virtualScroller(targets, { offset, topOffset, bottomOffset } = {}) {
offset ??= 0
topOffset ??= offset ?? 0
bottomOffset ??= offset ?? 0
cancelAnimationFrame(animationFrame)
animationFrame = window.requestAnimationFrame(() => {
for (let x = 0, len = targets.length; x < len; x++) {
let target = targets[x]
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['font.family'] = 'MEIRYO'
plt.rcParams["font.size"] = 18
w, h, dpi = 1920, 1080, 144
fig = plt.figure(figsize=(w / dpi, h / dpi), dpi=dpi, facecolor='white')
@deeppunj
deeppunj / PY0101EN-4-2-WriteFile.ipynb
Created April 17, 2021 11:38
Created on Skills Network Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@k8scat
k8scat / install_python3.8_ubuntu16.sh
Last active April 17, 2021 16:54
Install Python3.8 on Ubuntu 16
#!/bin/bash
#
# Install Python3.8 and pip on Ubuntu 16
# Maintainer: [email protected]
set -e
add-apt-repository -y ppa:deadsnakes/ppa
apt-get update -y
apt-get install -y python3.8 python3.8-distutils
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
@shinysu
shinysu / app.py
Created April 17, 2021 11:42
Todolist
from flask import Flask, render_template, request, redirect, url_for
from dbfunctions import add_new_task, get_complete_tasks, get_incomplete_tasks, mark_task_complete
app = Flask(
__name__,
template_folder = 'client/templates'
)
@app.route('/')
def index():
function exponentialBackoff(i, dt) {
const f = j => j >= 0 ? Math.exp(j/3)*dt : 0
const ret = f(i)-f(i-1)
if(ret < dt) {
return dt
} else {
return ret
}
}
def remove_instance(nums, val):
"""
Given an array nums, and a value val, returns the new length of the array with the value removed
i.e. the number of items in nums with val
Input: nums=[5, 2, 2, 5, 3] and val = 5
Output: 3
"""
try:
#check for cases of an empty array
if len(nums) == 0:
getDiscountPercentageValue(products: Product[]): number {
let discountValue = 0;
if (products.length === 1) {
return 0;
}
let allProductsQuantity = products.reduce((sum, product) => sum + product.quantity, 0);
if (allProductsQuantity > 10 && allProductsQuantity <= 50) {
discountValue += 10;
@Assistance4u
Assistance4u / PY0101EN-2-3-Dictionaries.ipynb
Created April 17, 2021 12:07
Created on Skills Network Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.