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 / 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.
@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 / 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 / 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 / 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 / object.property.js
Last active October 18, 2017 03:05
Object Property Utility : Set readonly property value for an object
/*
Set readonly property value for an object
*/
// Utils
var
op=function(o,p,v){
o=o||{};
var f=Object.defineProperty;
if(!io(v)){opv(v)}
if(f){
@nikahmadz
nikahmadz / gs.js
Created October 18, 2017 03:20
GetScript: Inject external script to a document
/*
you'll need to include supporting script like: w,d,dm,i{},ti,to,wc
they are shortcuts for: window,document,DomJs,VariableTest,Timer,and console.
*/
var
gs=function(a){
if(!io(a)||!is(a.src)){we(': Invalid source: '+a.src);return}
@nikahmadz
nikahmadz / example.js
Created February 11, 2018 09:43
Never use for..in loop in Javascript
// Somewhere deep in your JavaScript library...
Array.prototype.foo = 1;
// While you have no idea that your code will misbehave.
var a = []; // Create a new empty array.
a[5] = 5; // Perfectly legal JavaScript that resizes the array.
// normal loop saves you
@nikahmadz
nikahmadz / config.js
Last active February 17, 2018 17:37
full firebase ui config
config={
callbacks:{
signInSuccess: function(currentUser, credential, redirectUrl) {
// Do something.
// Return type determines whether we continue the redirect automatically
// or whether we leave that to developer to handle.
return true;
},
signInFailure: function(error) {
@nikahmadz
nikahmadz / _.spinner.md
Last active April 13, 2018 03:07
CSS Spinner

CSS Spinners