model User {
id Int @id @default(autoincrement())
email String @unique
role Role // normal Relation field
profile Profile? // Relation field part of 0-1 relation
}
model Profile {
id Int @id @default(autoincrement())
This file contains hidden or 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
// Given an array of strings, group anagrams together. | |
/** | |
* @param {string[]} strs | |
* @return {string[][]} | |
* @description Given an array of strs, group anagrams together. | |
* @note inputs will be in lowercase. | |
The order of your output does not matter. | |
*/ | |
This file contains hidden or 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
// Cubic O(n³) | |
// https://www.youtube.com/watch?v=2MmGzdiKR9Y Feb: 01/2019 | |
function maxSubArray(nums) { | |
let maximumSubArraySum = Number.NEGATIVE_INFINITY; | |
/* | |
We will use these outer 2 for loops to investigate all | |
windows of the array. | |
We plant at each 'left' value and explore every |
This file contains hidden or 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
/* From http://thatemil.com/blog/2015/01/03/reset-your-fieldset/ by Emil Björklund */ | |
legend { | |
display: table; | |
padding: 0; | |
} | |
fieldset { | |
border: 0; | |
margin: 0; | |
min-width: 0; |
- See the 30-second guide
I've been using this for several years now, so here are some of the ways I have set it up to be most productive.
See my taskrc
below for implementation details.
In general, I've had the most success by keeping lists of tasks short and to the point, avoiding the anxiety of seeing 100 tasks and feeling like I'm going to drown.
This file contains hidden or 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
#!/bin/bash | |
FILE=$1 | |
if [[ -f $FILE ]]; then | |
git filter-branch -f --index-filter "git rm -r --cached $FILE --ignore-unmatch" --prune-empty --tag-name-filter cat -- --all | |
else | |
echo File required | |
fi |
First principles battery
-
what are the materials constituents of batteries
-
what is spot market value of the material constituents
-
Cobalt, nickel, aluminium, carbon and polymers for separation and steel can.
Break that down on a material basis and say okay if we bought that in London metal exchange, what would each of those things cost. Its $80 per kilowatt hour
This file contains hidden or 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
//https://egghead.io/lessons/javascript-add-a-browser-build-to-an-npm-module | |
import { join } from "path"; | |
export default { | |
entry: "./src/index.js", | |
output: { | |
path: join(__dirname, "dist"), | |
libraryTarget: "umd", | |
library: "starWarsNames" | |
}, |
This file contains hidden or 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
/* begin table creation */ | |
create table department | |
(dept_id smallint unsigned not null auto_increment, | |
name varchar(20) not null, | |
constraint pk_department primary key (dept_id) | |
); | |
create table branch | |
(branch_id smallint unsigned not null auto_increment, |