Skip to content

Instantly share code, notes, and snippets.

View LiviuLvu's full-sized avatar

Liviu Iancu LiviuLvu

View GitHub Profile
@praveenpuglia
praveenpuglia / shadow-dom.md
Last active March 28, 2024 15:06
Everything you need to know about Shadow DOM

I am moving this gist to a github repo so more people can contribute to it. Also, it makes it easier for me to version control.

Please go to - https://github.com/praveenpuglia/shadow-dom-in-depth for latest version of this document. Also, if you find the document useful, please shower your love, go ⭐️ it. :)

Shadow DOM

Heads Up! It's all about the V1 Spec.

In a nutshell, Shadow DOM enables local scoping for HTML & CSS.

@todd-dsm
todd-dsm / git-submodule-untracked-content
Created January 17, 2017 14:51
how to solve the "untracked content" / "modified content" message?
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: .gitmodules
modified: vim/after/ftplugin/json.vim
new file: vim/bundle/Dockerfile
new file: vim/bundle/ansible-vim
@chantastic
chantastic / on-jsx.markdown
Last active March 20, 2024 01:03
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@tonsky
tonsky / user.keymap
Created June 4, 2014 12:04
LightTable keymap of Sublime shortcuts
{ :+
{ :editor
{ "pmeta-/" [:toggle-comment-selection]
"ctrl-shift-up" [:editor.sublime.selectLinesUpward]
"ctrl-shift-down" [:editor.sublime.selectLinesDownward]
"pmeta-d" [:editor.sublime.selectNextOccurrence]
"ctrl-m" [:editor.sublime.goToBracket]
"ctrl-shift-m" [:editor.sublime.selectBetweenBrackets]
"shift-pmeta-space" [:editor.sublime.selectScope]
"ctrl-pmeta-up" [:editor.sublime.swapLineUp]
@imcmahon
imcmahon / gist:4335d05967f54bb6d14e
Created May 15, 2014 17:12
jQuery remove all classes with the same prefix
$('html').removeClass(function (index, css) {
return (css.match (/\bpage-\S+/g) || []).join(' '); // removes anything that starts with "page-"
});
@sojack
sojack / setOverprintToFalse.js
Created September 24, 2011 15:47
Adobe Illustrator - set overprint to false
var myDocument = activeDocument,
numberOfChangedItems = 0; // counts the number of items with overprint stroke or fill
//loop through all path items and set overprint to false:
for (var i = 0; i < myDocument.pathItems.length; i++) {
var myPath = myDocument.pathItems[i];
if (myPath.strokeOverprint == true | myPath.fillOverprint == true){numberOfChangedItems++;};
if (myPath.strokeOverprint == true){myPath.strokeOverprint = false; myPath.selected=true;};
if (myPath.fillOverprint == true){myPath.fillOverprint = false; myPath.selected=true;};
}