Skip to content

Instantly share code, notes, and snippets.

View nikahmadz's full-sized avatar
🔰
Senior Application Developer

Nik Ahmad Z nikahmadz

🔰
Senior Application Developer
View GitHub Profile
@nikahmadz
nikahmadz / background.js
Created September 17, 2017 08:17 — forked from danharper/background.js
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@nikahmadz
nikahmadz / making-javascript-faster.md
Created September 13, 2017 12:25
Making Javascript faster

Making Javascript faster

This is a list of guidelines to make your Javascript faster, often associated with jsPerf benchmarks.

Profile before optimizing

If you have an existing codebase, don't get carried away with premature optimizations. Profile to find the slow bits and pick the low hanging fruit.

Some of the latter lessons in Code School's Chrome DevTools course will teach you how to profile your code.

@nikahmadz
nikahmadz / resizeImage.css
Created July 10, 2017 09:18 — forked from oliverdoetsch/resizeImage.css
automatically resize blogger images to fit full blog post area
.post-body img {
width: $(content.width);
height: auto;
margin-left: -1em;
padding: 0;
border: none;
max-width: 100%;
}
.post-body .tr-caption-container {
@nikahmadz
nikahmadz / AND_OR_NOT
Created July 10, 2017 09:17 — forked from oliverdoetsch/AND_OR_NOT
Blogger: Globally conditional data tags for all page types
#AND
<b:if cond='data:blog.pageType == "index"'>
<b:if cond='data:blog.searchQuery'>
<!--search_page AND index_page-->
</b:if>
</b:if>
#OR
@nikahmadz
nikahmadz / ThemeBasics.md
Last active April 27, 2024 09:00
Tutorial Notes On Building A Blogger Theme

Theme Basics

Theme Basics is a series of tutorial notes on building a Blogger theme.

Discover tips and learn how to start building your own Blogger theme:

  • Minimum code requirements.
  • Basic templates.
  • Tags & Data definitions.
  • Resources and examples.