Skip to content

Instantly share code, notes, and snippets.

View virajkulkarni14's full-sized avatar
💻
Code on...

Viraj G. Kulkarni (विराज गु. कुलकर्णी) virajkulkarni14

💻
Code on...
View GitHub Profile

Keybase proof

I hereby claim:

  • I am virajkulkarni14 on github.
  • I am virajkulkarni (https://keybase.io/virajkulkarni) on keybase.
  • I have a public key whose fingerprint is 7C5A CA58 6A2C 6323 082D 6D6F 41DD BD87 7221 03FE

To claim this, I am signing this object:

@virajkulkarni14
virajkulkarni14 / AsyncComponent.jsx
Created May 8, 2017 17:42 — forked from lencioni/AsyncComponent.jsx
<AsyncComponent> at Airbnb used for Webpack code splitting
// Usage:
//
// function loader() {
// return new Promise((resolve) => {
// if (process.env.LAZY_LOAD) {
// require.ensure([], (require) => {
// resolve(require('./SomeComponent').default);
// });
// }
// });
@virajkulkarni14
virajkulkarni14 / local-storage.js
Created April 23, 2017 04:59 — forked from GianlucaGuarini/local-storage.js
A simple script to deal safely with the localStorage
/**
* Deal with the localStorage avoiding odd issues due to paranoids that have disabled it by default
*/
const ls = window.localStorage
/**
* Call any method on the localStorage avoiding to throw errors
* @param {string} method - method we want to call
* @param {array} args - serialized params that will be proxied to the method we are going to call
* @returns {null|string} whatever the method call will return
@virajkulkarni14
virajkulkarni14 / ChangeScreenshotsFolder.md
Last active April 20, 2017 19:11
How to Change Default Screenshot Save Location on MacOS
  1. Copy and paste this command to the terminal window to run it:

    defaults write com.apple.screencapture location /path/to/your/folder

    Eg. ~/Pictures/Screenshots/

  2. Now, run the below command for the changes to take effect immediately:

    killall SystemUIServer

@virajkulkarni14
virajkulkarni14 / function_invocation.js
Created April 3, 2017 19:15 — forked from myshov/function_invocation.js
11 Ways to Invoke a Function
console.log(1);
(_ => console.log(2))();
eval('console.log(3);');
console.log.call(null, 4);
console.log.apply(null, [5]);
new Function('console.log(6)')();
Reflect.apply(console.log, null, [7])
Reflect.construct(function(){console.log(8)}, []);
Function.prototype.apply.call(console.log, null, [9]);
Function.prototype.call.call(console.log, null, 10);
@virajkulkarni14
virajkulkarni14 / husain.md
Created April 3, 2017 02:56 — forked from voodootikigod/husain.md
JSConf US 2015 Track A Transcript for Jafar Husain: Async Programming in ES7

All right, everybody! Welcome to my talk. ES2016, the evolution of JavaScript. First a little bit about me. My name is Jafar Husain. I'm a tech lead at Netflix, I work for Falcor, an upcoming open data platform, which we intend to release pretty soon, and I'm also one of Netflix's representatives on TC-39, which is JavaScript's standard's committee. This talk used to be called ES7, the evolution of JavaScript, but something happened a couple of committee meetings ago. We decided to change ES6 to ES2015 and ES7 to ES2016. I want to explain this name change. We as a committee want to start shipping JavaScript every year. Just the way you would ship software in an agile way, we want to add features and ship them

@virajkulkarni14
virajkulkarni14 / 1-easy.js
Created April 2, 2017 04:07 — forked from nybblr/1-easy.js
3 examples of using Async Generators and Async Iteration in JavaScript!
// Create a Promise that resolves after ms time
var timer = function(ms) {
return new Promise(resolve => {
setTimeout(resolve, ms);
});
};
// Repeatedly generate a number starting
// from 0 after a random amount of time
var source = async function*() {