Skip to content

Instantly share code, notes, and snippets.

View cyberfly's full-sized avatar

Muhammad Fathur Rahman cyberfly

View GitHub Profile
userReactionExist(alias) {
let user_id = 1;
let user_reaction = _.find(this.reactions, function (reaction) {
if (reaction.alias == alias) {
if (reaction.user.id == user_id) {
return true;
}
}
_.isEqual(_.sortBy(array1), _.sortBy(array2))
// example
validateArray(field_key) {
let original_array = this.pre_toggle_data[field_key];
let new_array = this.task_data[field_key];
// check contains the same value
mounted() {
// we can set auto focus
this.editor = new Editor({
autoFocus: true
});
// or we can focus programatically
// using lodash
_.map(assignees, "id");
# start console
poetry run python manage.py shell
# import model
from plum.plum_project.models import Project
# list Model fields
poetry run python manage.py show_urls
# create new project
django-admin startproject learndjango
cd learndjango
# migrate db
python3 manage.py migrate
@cyberfly
cyberfly / bookmark
Last active September 4, 2020 01:06
Final choice:
https://medium.com/@marek_94752/how-to-start-with-vue-or-any-other-framework-lib-in-django-in-few-minutes-b34fd4291f7
https://pascalw.me/blog/2020/04/19/webpack-django.html
Others Reference:
https://dev.to/tkainrad/using-vuejs-alongside-django-29ka
https://www.youtube.com/watch?v=Yx_dJ3CoTRk
https://djangowaves.com/tutorial/how-to-use-vue-and-django/
# install nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
# reload terminal
# check version
nvm --version
# install node
# reset db for dev
rm db.sqlite3
poetry run plum manage reset_db
poetry run plum manage migrate
poetry run plum seed-data --user_password=123
# reset password for dev
u = Member.objects.get(id=1)