Skip to content

Instantly share code, notes, and snippets.

View abdulhannanali's full-sized avatar
💭
WUNDERWALL!!!!

Hannan Ali abdulhannanali

💭
WUNDERWALL!!!!
View GitHub Profile
@abdulhannanali
abdulhannanali / fileBrowserHandler.htm
Last active March 26, 2018 16:53 — forked from greenido/fileBrowserHandler.htm
Simple test to FileSystem APIs (HTML5)
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>Chrome File API tester</title>
<script>
window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
@abdulhannanali
abdulhannanali / transformStream.js
Created October 14, 2017 08:07
Custom Transform stream using ReadableStream and WritableStream instance.
/**
* Creates a push controller and exposes a public interface to the readable's controller
* by exposing the controller to it's parent scope
*
* Hacky but neat trick in order to transform data
* without the usage of Event Emitters
*/
function createPushReadable() {
let rController;

Keybase proof

I hereby claim:

  • I am abdulhannanali on github.
  • I am computistic (https://keybase.io/computistic) on keybase.
  • I have a public key ASDluo9mSP0chY4BMUs-7gIEDSS4OV8-gBuHUoTXO0V91wo

To claim this, I am signing this object:

@abdulhannanali
abdulhannanali / dabblet.css
Created September 16, 2017 18:08 — forked from chriscoyier/dabblet.css
Checkbox Hack
/* Checkbox Hack */
body {
}
input[type=checkbox] {
position: absolute;
top: -9999px;
left: -9999px;
}
@abdulhannanali
abdulhannanali / dabblet.css
Created September 5, 2017 09:42
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@abdulhannanali
abdulhannanali / dabblet.css
Created September 5, 2017 09:42 — forked from anonymous/dabblet.css
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
console.log('This is going to be printed out in npx and that is going to be awesome');
console.log('npx is an awesome utility that comes preinstalled with `npx` yayyyyy!');
@abdulhannanali
abdulhannanali / serviceworker-registration.js
Created July 2, 2017 11:38
Show a ServiceWorker Installed Popup
// Display a Information about ServiceWorker Installation being Completed.
// An alternative and more battle tested way to do the same thing is found on Google I/O 2016 PWA (IOWA)
// https://github.com/GoogleChrome/ioweb2016/blob/8cfa27261f9d07fe8a5bb7d228bd3f35dfc9a91e/app/scripts/helper/service-worker-registration.js#L34-L46
/// One way to register the Caching complete event for the service workers
/// I am using this in my application and this seems to be working
if ('serviceWorker' in navigator) {
const initialController = navigator.serviceWorker.controller;
navigator.serviceWorker.register('./serviceWorker.js').then(registration => {
if (registration.installing) {
@abdulhannanali
abdulhannanali / pixel-list.js
Last active April 26, 2017 08:58
Pixel List defines a custom iterator to iterate the list of Pixel containing x and y coordinated in a sorted order based on their distance from (0, 0). Based on the idea in Getify's YDKS This and Object Prototypes Book to define a custom iterator
const Pixel = require('./pixel-it');
// Contains all the pixels within a list
const pixelList = []
// Custom iterator of object is accessed by using
// Symbol.iterator a computed property name
pixelList[Symbol.iterator] = function () {
// Defining a function for the custom iterator
const sortedList = sortList(this);
/**
* Purger.js is a helpful utility to purge the cache based on the Jekyll's sitemap
* generated, which allows us to have a lot of great functionality in there.
* This utility is written for blog called https://fascinations.hannanali.tech,
* check out this article to read meaningful articles from me
*/
const Cloudflare = require('cloudflare')
const xml2js = require('xml2js')
const fs = require('fs')
const sitemapReader = require('./sitemapReader')