This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias python="python3" | |
alias gi="git init ." | |
alias k8="kubectl" | |
alias penv="python3 -m venv venv && source venv/bin/activate" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable no-nested-ternary */ | |
/* eslint-disable no-mixed-operators */ | |
import React from "react"; | |
import Link from "next/link"; | |
import classNames from "classnames"; | |
import useStyles from "@common_slick/Banner/style"; | |
import Thumbor from "@common_image"; | |
import ProductVideo from "@common_slick/Banner/productVideo"; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** | |
* @typedef {Object} User - an user object | |
* @property {string} firstName - First name of user | |
* @property {string} lastName - Last name of user | |
* @property {string} email - the user's email | |
* @property {string} company - Name of company | |
* @property {string} department - The department that the user is in | |
* @property {string[]} permissions - An array of strings representing the user's permissions | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function UserPanel({ | |
firstName, | |
lastName, | |
company, | |
department, | |
active, | |
permissions, | |
}) { | |
return ( | |
<> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const adventureRouter = new Map([ | |
["find the Holy Grail", goToGrailQuest], | |
["save Princess Peach", goToMarioWorldQuest], | |
["save Princess Zelda", goToLegendOfZeldaQuest], | |
]); | |
function ChooseAdventure({ adventurer, choice }) { | |
return ( | |
<div id="adventure"> | |
<div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ChooseAdventure({ adventurer, choice }) { | |
return ( | |
<div id="adventure"> | |
{choice === "find the holy grail" && ( | |
<div> | |
Howdy there {adventurer.name}! Are you ready to find the holy grail? | |
<button onClick={() => goToGrailQuest(adventurer)}>Yes</button>{" "} | |
<button onClick={changeAdventure}>Change Adventure</button> | |
</div> | |
)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
class Person { | |
final String firstName; | |
final String lastName; | |
Person({required this.firstName, required this.lastName}); | |
factory Person.fromMap(Map<String, dynamic> m) { | |
return Person( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Gets the start and end dates of all months going back 18 months. | |
/* DROP TABLE IF EXISTS month_table; # For debugging | |
CREATE TABLE month_table | |
( | |
m_id INT, | |
month_name VARCHAR(20), | |
start_date DATETIME, | |
end_date DATETIME | |
); */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::fs::File; | |
use std::io::{BufRead, BufReader}; | |
use ansi_term::{Colour, Style}; | |
use rand::Rng; | |
fn main() { | |
let phrases_src = "src/phrases.txt"; | |
let phrases_file = File::open(phrases_src).unwrap(); | |
let reader = BufReader::new(phrases_file); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib.request | |
from bs4 import BeautifulSoup | |
start = 2801 | |
# only_trs = SoupStrainer('tbody') | |
end = 2832 | |
for i in range(start, end): | |
with urllib.request.urlopen(f'https://www.mechon-mamre.org/p/pt/pt{i}.htm') as response: | |
html = response.read() | |
soup = BeautifulSoup(html, 'html.parser') |
NewerOlder