Skip to content

Instantly share code, notes, and snippets.

View theshaneyu's full-sized avatar
🤹‍♀️
chilling

Shane Yu theshaneyu

🤹‍♀️
chilling
View GitHub Profile
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active November 19, 2024 10:49
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@dhammack
dhammack / Logistic_Regression.ipynb
Created December 21, 2013 16:45
Logistic Regression. Multiclass (softmax) classification, various nonlinear basis functions, training with gradient descent + momentum, comparisons with sklearn's implementation. Based on Bishop 4.3
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zcaceres
zcaceres / Include-in-Sequelize.md
Last active July 27, 2024 13:21
using Include in sequelize

'Include' in Sequelize: The One Confusing Query That You Should Memorize

When querying your database in Sequelize, you'll often want data associated with a particular model which isn't in the model's table directly. This data is usually typically associated through join tables (e.g. a 'hasMany' or 'belongsToMany' association), or a foreign key (e.g. a 'hasOne' or 'belongsTo' association).

When you query, you'll receive just the rows you've looked for. With eager loading, you'll also get any associated data. For some reason, I can never remember the proper way to do eager loading when writing my Sequelize queries. I've seen others struggle with the same thing.

Eager loading is confusing because the 'include' that is uses has unfamiliar fields is set in an array rather than just an object.

So let's go through the one query that's worth memorizing to handle your eager loading.

The Basic Query