Skip to content

Instantly share code, notes, and snippets.

View alvinwan's full-sized avatar
🦉
🧀🍰

Alvin Wan alvinwan

🦉
🧀🍰
View GitHub Profile
@alvinwan
alvinwan / README.md
Last active August 14, 2021 22:46
getCurrentYear

GetCurrentYear.js

  1. Define an element with id currentYear.
  2. Paste the following, after that element
<script>document.querySelector('#currentYear').innerHTML = new Date().getFullYear();</script>

Or the following. I don't see why you would pick the longer one though.

@alvinwan
alvinwan / loops.py
Last active July 6, 2021 08:19
skillshare responses
i = 5
while i <= 15:
print(i)
i += 2
@alvinwan
alvinwan / words-tinyimagenet200.txt
Created September 23, 2020 06:31
Class names for TinyImageNet200
n01443537 goldfish, Carassius auratus
n01629819 European fire salamander, Salamandra salamandra
n01641577 bullfrog, Rana catesbeiana
n01644900 tailed frog, bell toad, ribbed toad, tailed toad, Ascaphus trui
n01698640 American alligator, Alligator mississipiensis
n01742172 boa constrictor, Constrictor constrictor
n01768244 trilobite
n01770393 scorpion
n01774384 black widow, Latrodectus mactans
n01774750 tarantula
@alvinwan
alvinwan / imagenet_idx_to_label.json
Last active June 8, 2020 09:06
ImageNet ILSVRC2012 class indices to class names
{"0": "tench, Tinca tinca", "1": "goldfish, Carassius auratus", "2": "great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias", "3": "tiger shark, Galeocerdo cuvieri", "4": "hammerhead, hammerhead shark", "5": "electric ray, crampfish, numbfish, torpedo", "6": "stingray", "7": "cock", "8": "hen", "9": "ostrich, Struthio camelus", "10": "brambling, Fringilla montifringilla", "11": "goldfinch, Carduelis carduelis", "12": "house finch, linnet, Carpodacus mexicanus", "13": "junco, snowbird", "14": "indigo bunting, indigo finch, indigo bird, Passerina cyanea", "15": "robin, American robin, Turdus migratorius", "16": "bulbul", "17": "jay", "18": "magpie", "19": "chickadee", "20": "water ouzel, dipper", "21": "kite", "22": "bald eagle, American eagle, Haliaeetus leucocephalus", "23": "vulture", "24": "great grey owl, great gray owl, Strix nebulosa", "25": "European fire salamander, Salamandra salamandra", "26": "common newt, Triturus vulgaris", "27": "eft", "28": "spotted salamander, Amby
@alvinwan
alvinwan / nbdt.py
Created April 10, 2020 10:13
Getting Started with Neural-Backed Decision Trees
from nbdt.model import HardNBDT
from nbdt.models import wrn28_10_cifar10
model = wrn28_10_cifar10()
model = HardNBDT(
pretrained=True,
dataset='CIFAR10',
arch='wrn28_10_cifar10',
model=model)
{
"type": "Program",
"start": 0,
"end": 73,
"body": [
{
"type": "FunctionDeclaration",
"start": 0,
"end": 73,
"id": {
@alvinwan
alvinwan / cube-style-5.css
Created February 21, 2019 18:19
The noob's guide to 3D Transforms with CSS - Cube Example, Style 5
.front { transform: rotateY(0deg) translateZ(5em); }
.right { transform: rotateY(90deg) translateZ(5em); }
.left { transform: rotateY(-90deg) translateZ(5em); }
.back { transform: rotateY(180deg) translateZ(5em); }
.top { transform: rotateX(90deg) translateZ(5em); }
.bottom { transform: rotateX(-90deg) translateZ(5em); }
@alvinwan
alvinwan / cube-style-4.css
Created February 21, 2019 18:19
The noob's guide to 3D Transforms with CSS - Cube Example, Style 4
.front { transform: rotateY(0deg) }
.right { transform: rotateY(90deg) }
.left { transform: rotateY(-90deg) }
.back { transform: rotateY(180deg) }
.top { transform: rotateX(90deg) }
.bottom { transform: rotateX(-90deg) }
@alvinwan
alvinwan / cube-style-3.css
Created February 21, 2019 18:19
The noob's guide to 3D Transforms with CSS - Cube Example, Style 3
.face {
width:100%;
height:100%;
position:absolute;
background-color:rgba(3, 121, 255, 0.5);
color:#FFF;
line-height:10em;
text-align:center;
}
@alvinwan
alvinwan / cube-style-2.css
Created February 21, 2019 18:18
The noob's guide to 3D Transforms with CSS - Cube Example, Style 2
.cube {
width:100%;
height:100%;
position:relative;
animation: spinning 2s infinite;
transform-style:preserve-3d;
}
@keyframes spinning {
from { transform: translateZ(-5em) rotateY(0deg); }