Skip to content

Instantly share code, notes, and snippets.

View lusan's full-sized avatar
🎯
Focusing

Lusan Das lusan

🎯
Focusing
View GitHub Profile
/**
* This Google Sheets script keeps data in the specified column sorted any time
* the data changes.
*
* After much research, there wasn't an easy way to automatically keep a column
* sorted in Google Sheets, and creating a second sheet to act as a "view" to
* my primary one in order to achieve that was not an option. Instead, I
* created a script that watches for when a cell is edited and triggers
* an auto sort.
*
@lusan
lusan / index.html
Created December 19, 2017 19:24 — forked from RafaelC457ro/index.html
Rxjs input file image compressed to base64 // source http://jsbin.com/tewiral
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Rxjs input file image compressed to base64</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/4.0.6/rx.all.js"></script>
<script src="https://unpkg.com/rx-dom@7.0.3/dist/rx.dom.js"></script>
<script src="https://cdn.rawgit.com/xkeshi/image-compressor/master/dist/image-compressor.js"></script>
server {
location ~* (serviceworker\.js)$ {
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
expires off;
proxy_no_cache 1;
}
}
# Or try this block
location /sw.js {
@lusan
lusan / service-workers.md
Created January 9, 2018 14:44 — forked from Rich-Harris/service-workers.md
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@lusan
lusan / frontendDevlopmentBookmarks.md
Created February 21, 2018 06:52 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
@lusan
lusan / frontendDevlopmentBookmarks.md
Created February 21, 2018 06:52 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
@lusan
lusan / .bash_profile
Created July 30, 2018 05:43 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@lusan
lusan / index.html
Created September 28, 2018 13:08 — forked from jeffposnick/index.html
beforeinstallprompt demo
<html>
<head>
<title>Test</title>
<link rel="manifest" href="manifest.json">
</head>
<body>
<p>
If the <code>beforeinstallprompt</code> event fires, there will be a button displayed allowing
you to use <code>prompt()</code> on the deferred event.
</p>
@lusan
lusan / composing-software.md
Created February 4, 2019 05:29 — forked from rosario/composing-software.md
Eric Elliott's Composing Software Series
@lusan
lusan / 1_primitive_comparison.js
Created July 1, 2019 06:20 — forked from nicbell/1_primitive_comparison.js
JavaScript object deep comparison. Comparing x === y, where x and y are values, return true or false. Comparing x === y, where x and y are objects, returns true if x and y refer to the same object. Otherwise, returns false even if the objects appear identical. Here is a solution to check if two objects are the same.
//Primitive Type Comparison
var a = 1;
var b = 1;
var c = a;
console.log(a == b); //true
console.log(a === b); //true
console.log(a == c); //true
console.log(a === c); //true