This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Listen to content.js events | |
chrome.extension.onMessage.addListener( | |
function(request, sender, sendResponse) { | |
if (request.count || request.count === 0) { | |
chrome.browserAction.setBadgeText({'text': request.count.toString()}) | |
} | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
// Select the target node (tweet modal) | |
var target = $('.PermalinkOverlay-modal').get(0); | |
// Create an observer instance | |
var observer = new MutationObserver(function(mutations) { | |
mutations.forEach(function(mutation) { | |
// Get the Twitter modal window replies count | |
var loneTweetsCount = $('.PermalinkOverlay-body .ThreadedConversation--loneTweet .tweet').length |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// select the target node | |
var target = document.querySelector('#some-id'); | |
// create an observer instance | |
var observer = new MutationObserver(function(mutations) { | |
mutations.forEach(function(mutation) { | |
console.log(mutation.type); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
element.addEventListener("DOMNodeInserted", function (ev) { | |
// ... | |
}, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Style guide definition | |
const styleGuide = { | |
cloudy: '#F2F4F7', | |
darkGray: '#4A637C', | |
gray: '#7A8D9F', | |
// ...more colors or mixins | |
}; | |
return ( | |
// The theme styles are available everywhere (thanks to React's context API) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//.jshintrc | |
{ | |
// JSHint Meteor Configuration File | |
// Match the Meteor Style Guide | |
// | |
// By @raix with contributions from @aldeed and @awatson1978 | |
// Source https://github.com/raix/Meteor-jshintrc | |
// | |
// See http://jshint.com/docs/ for more details |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.4.0.rc.1) | |
// Compass (v1.0.0.alpha.20) | |
// ---- | |
// Mixin Breakpoints | |
@mixin breakpoint($class) | |
@if $class == mobile | |
@media (max-width: 767px) | |
@content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.clear(); | |
var old = console.log; | |
console.log = function() { | |
var args = [].slice.apply(arguments).concat([(new Error()).stack.split(/\n/)[2].trim()]); | |
return old.apply(this, args); | |
}; | |
function test(t) { |
NewerOlder