Skip to content

Instantly share code, notes, and snippets.

View axemclion's full-sized avatar

Parashuram N axemclion

View GitHub Profile
@axemclion
axemclion / feedly.user.js
Created September 24, 2014 00:52
Feedly - Open Link in Background
// ==UserScript==
// @name Feedly - Open entry in background
// @description Adds 'h' as a hotkey to open selected entry in background tab
// @namespace userscripts.org/users/Lyk
// @author Lyk
// @include http://feedly.com/*
// @include https://feedly.com/*
// @include http://*.feedly.com/*
// @include https://*.feedly.com/*
// @grant GM_openInTab
@axemclion
axemclion / linkify.user.js
Created November 25, 2008 14:17
Linkify - Ubiquity Command
/*
This is a command to linkify the selected text with search results in Google
Particularily useful to insert links while blogging
*/
CmdUtils.CreateCommand(
{
name: ["linkify"],
icon: "http://axemclion.github.com/favicon.ico",
author:
{
@axemclion
axemclion / Performance.md
Last active March 7, 2017 23:45
Performance Data using browser-perf for old and new versions of http://www.html5rocks.com
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@axemclion
axemclion / client.bundle.js
Last active February 6, 2017 23:45
ReactVR-DBMonster
This file has been truncated, but you can view the full file.
(function(global) {
global.__DEV__=true;
global.__BUNDLE_START_TIME__=Date.now();
})(typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : this);
(function(global) {
@axemclion
axemclion / IndexedDB.setVersionShim.js
Created May 11, 2012 00:29
Shim that converts Chrome's SetVersion to the standard IndexedDB onupgradeneeded events
////////////////////////////////////////////////////////////////////////////////////////////////////
var openReqShim = function(dbName, version){
var me = this;
var IDBRequest = function(){
this.onsuccess = this.onerror = this.onblocked = this.onupgradeneeded = null;
};
function copyReq(req){
req = req || dbOpenReq;
@axemclion
axemclion / react-event-mirror.js
Created August 29, 2016 20:30
ReactNative EventMirroring
const EventPluginRegistry = require('react/lib/EventPluginRegistry');
import ReactNativeEventEmitter from 'react/lib/ReactNativeEventEmitter';
export default class Plugin {
extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
if (!nativeEvent.isMirrored) {
// TODO send this to a socket server so that it is propogated to other servers
console.log('MirrorEventPlugin:', topLevelType, targetInst, nativeEvent, nativeEventTarget);
nativeEvent.isMirrored = true;
@axemclion
axemclion / ABSTRACT.md
Created March 12, 2016 04:32
Rise of the Web Workers

Modern web applications are awesome. And complicated. The Javascript libraries that power them today do a lot of work to abstract out the hard parts. Whether using constructs like Virtual DOM, or fancy change detection algorithms, the amount of work that the Javascript library does is only increasing.

Unfortunately, all this work now competes for the same resources that the browser needs, to do things like render a page, or apply styles. In many cases, this makes the browser slow, preventing the web application from attaining its full, smooth experience.

Web workers have been in the browser for a while, but they have mostly been used for engaging demos like adding mustaches in a cat video :)

In this talk, we will explore how mainstream Javascript libraries like React or Angular use Web Workers to get great performance. We will look at quantitative numbers from hundreds of test runs that conclusively show how Web Workers can make apps faster. Finally, we will also look at practical examples to convert exi

@axemclion
axemclion / React-Worker-Latency.js
Last active February 11, 2016 02:15
Latency Performance calculations for React-Worker-DOM
var start, results = [];
var ITERATIONS = 100;
var addButton = document.querySelectorAll('.btn.btn-primary')[0];
var addItem = function() {
if (results.length < ITERATIONS) {
start = performance.now();
addButton.click();
} else {
console.log('Testing done, average is %s milliseconds, all data is', results.reduce(function(a, b) {
return a + b;
@axemclion
axemclion / index.android.js
Last active January 20, 2016 06:18
Cordova Plugins in React native
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
View,
NativeModules,
TouchableHighlight,