Skip to content

Instantly share code, notes, and snippets.

@flaneur2020
Created March 9, 2012 08:42
Show Gist options
  • Select an option

  • Save flaneur2020/2005685 to your computer and use it in GitHub Desktop.

Select an option

Save flaneur2020/2005685 to your computer and use it in GitHub Desktop.
snippets for lifestyle.

jquery

parents()方法很好用,配合first()可以省掉一大串难于维护的.parent()

$('.some_class').parents('form').first()

git

clear the ignored files which has already been tracked:

git rm -r --cached .
git add .
git commit -m "fixing .gitignore"

不方便修改项目的.gitignore时可以修改.git/info/exclude,相当于项目中私人的.gitignore

@zhuangya
Copy link

jQuery 的那种选择器还是尽量少用啦。。效率什么的。
另外,也许这样更好?

$('.some_class').parent('form:first');

?

@flaneur2020
Copy link
Author

@zhuangya 学习了,thx :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment