Skip to content

Instantly share code, notes, and snippets.

View vicradon's full-sized avatar
🥑
creating technical content

Osinachi Chukwujama vicradon

🥑
creating technical content
View GitHub Profile
@vicradon
vicradon / paint.py
Created January 27, 2019 09:26
A simple event driven paint program which is part of the turtledemo in python
from turtle import *
def switchupdown(x = 0, y = 0):
'this defines how the pen responds to mouse input'
if pen()["pendown"]:
end_fill()
up()
else:
down()
begin_fill()
from turtle import *
speed(0), ht()
diff, a = 0.6, 45
def tree(d, n):
'this function uses recursion to draw'
if n > 1:
fd(d)
from turtle import *
def drawSquare(side):
for i in range(4):
fd(side)
lt(90)
tracer(0)
pu(), goto(-300, 0), pd()
ht(), width(5)
@vicradon
vicradon / The events in PWAs.md
Last active July 11, 2019 08:52
Events in PWAs. The install and fectch events

About

This app is an implementation of a PWA example from github. It will teach the basics of PWAs and the right ways to build, I guess.

Things to try out

  1. Put the css in a custom css folder
  2. Add a manu and some other pages

Caching Assets

This is done in the install event listener.

  • The code is put in a callback
@vicradon
vicradon / data.json
Last active September 9, 2019 03:01
{
"name":"Think Bits",
"size":6,
"developers":["python", "web", "c++"],
"people":["Godson", "Kingsley", "Ralph", "Samuel", "Samson", "Boniface"],
"sameLevel":true,
"structure":"https://i.ibb.co/bKQtjM3/object-structure.jpg"
}
import React from "react"
import ReactDOM from "react-dom"
function App(){
let style = {
fontSize:"4rem"
}
let date = new Date(2019, 10, 4, 22);
const hours = date.getHours();
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="root"></div>
<script src="index.pack.js"></script>
</body>
</html>
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="root"></div>
<script src="index.pack.js"></script>
</body>
</html>
@vicradon
vicradon / JSFiles.js
Created October 13, 2019 03:33
Product Components Challenge in Scrimba React Tut
/* APP.JS */
import React from "react"
import productsData from "./vschoolProducts"
import Product from "./Product"
function App() {
const productComponents = productsData.map(prod => <Product key = {prod.id} name = {prod.name} description = {prod.description} />)
return (
<div>
{ productComponents }
@vicradon
vicradon / Class Based Components.js
Created October 13, 2019 05:16
REACT CLASS BASED COMPONENTS
/*
Challenge:
1. Convert all 3 components to be class-based
2. Fix the small bug
*/
import React, { Component } from "react"
import ReactDOM from "react-dom"