Skip to content

Instantly share code, notes, and snippets.

Avatar
🔨
Building

Cozy! ItsCosmas

🔨
Building
View GitHub Profile
View blogCardRow.jsx
import React from "react";
import { Link } from "react-router-dom";
import img_side from "../../assets/img/img.jpg";
const BlogCardRow = () => {
return (
<div className='blog__card-row'>
<figure className='blog__card-row__fig'>
<Link href='' className='blog__card-link'>
View blogCardCol.jsx
import React from "react";
import { Link } from "react-router-dom";
import hotpost from "../../assets/img/hot-post-1.jpg";
const BlogCardCol = () => {
return (
<div className='blog__card-column'>
<figure className='blog__card-fig'>
<Link to='/article' className='blog__card-link'>
View blog.scss
@import '../../assets/scss/abstracts/variables';
@import '../../assets/scss/abstracts/mixins';
.blog {
padding: 4rem;
&__section {
padding: 2rem;
}
View Blog.jsx
// The Home Page
import React, { Component } from "react";
import "./Blog.scss";
import BlogCardCol from "./BlogCardCol";
import BlogCardRow from "./BlogCardRow";
class Blog extends Component {
render() {
@ItsCosmas
ItsCosmas / docker-help.md
Created Jun 21, 2019 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips
View docker-help.md

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

View kwargs.py
# KEYWORD ARGUMENTS
def keyword_function(argument=1, **kwargs):
print(argument)
print(kwargs)
keyword_function(x=1, y=2, z=3)
View function_args.py
# FUNCTION ARGUMENTS
def function(named_arg, *args):
print(named_arg)
print(args)
function("arg1", "arg2", "arg3", "arg4")
View decorators.py
# USEFUL for extending functionality of functions you don't wanna modify
# this function takes a function as its parameter
def decorator(function):
def wrap():
print("Adding Printing Functionality")
function()
print("Adding Print Functionality")
View generators.py
def even_numbers(x):
for i in range(x):
if i % 2 == 0:
yield i
for i in even_numbers(100):
print(i)
View assertions.py
# ASSERIONS
print(1)
assert 2 + 2 == 4
print(2)
assert 1 + 1 == 3
print(3)
# Assertions are often placed at the start of a function to check for valid input
# and at the end to check for valid output