Skip to content

Instantly share code, notes, and snippets.

View kayode-adechinan's full-sized avatar

Kayode Adechinan kayode-adechinan

  • Dakar, Senegal
View GitHub Profile

Remove pycache files

$ py3clean .
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>repl.it</title>
</head>
<body>
<div>Click the upload icon below to upload a file.</div>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>repl.it</title>
</head>
<body>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>repl.it</title>
</head>
<body>
# center in page
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dead center!</title>
<style>

Tdd

import static org.assertj.core.api.Assertions.assertThat;

@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
public class HttpRequestTest {

	@LocalServerPort
	private int port;
@kayode-adechinan
kayode-adechinan / scraping-cheat-sheet.md
Created January 10, 2020 10:10
Scraping cheat sheet

Beautifulsoup weather app

import pandas as pd
import requests
from bs4 import BeautifulSoup

page = requests.get("http://forecast.weather.gov/MapClick.php?lat=37.7772&lon=-122.4168")
soup = BeautifulSoup(page.content, 'html.parser')
seven_day = soup.find(id="seven-day-forecast")
forecast_items = seven_day.find_all(class_="tombstone-container")
@kayode-adechinan
kayode-adechinan / django-cheat-sheet.md
Last active March 26, 2020 11:00
Django Cheat Sheet

Random string - random username

from django.utils.crypto import get_random_string
User.objects.create_user(username=get_random_string(), email='', password='123')

Build API

install

@kayode-adechinan
kayode-adechinan / cheat-sheet-angular.md
Last active January 17, 2020 17:18
Angular Cheat Sheet

if

<div *ngIf="condition; else elseBlock">Content to render when condition is true.</div>
<ng-template #elseBlock>Content to render when condition is false.</ng-template>

ngFor

<ul>
    <li *ngFor="let element of array"></li>
input, textarea {
outline: none;
border:1px solid #ccc !important;
box-shadow:none !important;
}