How do I select text nodes with jQuery?

jQuery doesn’t have a convenient function for this. You need to combine contents(), which will give just child nodes but includes text nodes, with find(), which gives all descendant elements but no text nodes. Here’s what I’ve come up with: Note: If you’re using jQuery 1.7 or earlier, the code above will not work. To fix this, … Read more

How can I move a tag on a git branch to a different commit?

Use the -f option to git tag: You probably want to use -f in conjunction with -a to force-create an annotated tag instead of a non-annotated one. Example Delete the tag on any remote before you pushgit push origin :refs/tags/<tagname> Replace the tag to reference the most recent commitgit tag -fa <tagname> Push the tag to the remote origingit push origin master … Read more

zsh command cannot found pip

Maybe you have installed both python2 and python3. python3 may have been installed later. You may try to use pip3 instead of pip. First, input the command: If you see the version, the pip3 can be used. Then you can input command line to install nltk: I got a way to help you use pip in zsh. We can use nano to edit files. In nano, ctrl+X to save and exit … Read more

What makes Lisp macros so special?

Reading Paul Graham’s essays on programming languages one would think that Lisp macros are the only way to go. As a busy developer, working on other platforms, I have not had the privilege of using Lisp macros. As someone who wants to understand the buzz, please explain what makes this feature so powerful. Please also … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)