Skip to content

Instantly share code, notes, and snippets.

View axemclion's full-sized avatar

Parashuram N axemclion

View GitHub Profile
@axemclion
axemclion / WavePhishedPage.html
Created February 10, 2010 10:33
Google Wave Phishing Demo
<html><head>
<style type="text/css"><!--
body,td,div,p,a,font,span {font-family: arial,sans-serif;}
body {margin-top:2}.c {width:4; height: 4}
html body { bgcolor: "#ffffff"; padding: 0; margin: 0; }
A:link {color:#0000cc; }
A:visited { color:#551a8b; }
A:active { color:#ff0000; }
@axemclion
axemclion / README.md
Last active December 6, 2023 10:07
Using Chrome Traces to Automate Rendering Performance

Using Chrome Traces to Automate Rendering Performance

Ten years ago, increasing the performance of a website usually meant tweaking the server side code to spit out responses faster. Web Performance engineering has come a long way since then. We have discovered patterns and practices that make the (perceived) performance of websites faster for users just by changing the way the front end code is structured, or tweaking the order of elements on a HTML page. Majority of the experiments and knowledge has been around delivering content to the user as fast as possible.

Today, web sites have grown to become complex applications that offer the same fidelity as applications installed on computers. Thus, consumers have also started to compare the user experience of native apps to the web applications. Providing a rich and fluid experience as users navigate web applications has started to play a major role in the success of the web.

Most modern browsers have excellent tools that help measure the runtime performa

@axemclion
axemclion / JSIObject.cpp
Last active October 4, 2023 19:36
React Native JSI Example
// This sample is a Work in Progress for JSI , and specific functions may change.
#pragma once
#include <string>
#include <unordered_map>
#include <jsi/jsi.h>
// This SameplJSIObject needs to inheric from HostObject, and this is the object that will be exposed to JS.
@axemclion
axemclion / FlutterToastPlugin.java
Created December 2, 2018 21:17
An adapter to use React Native's Native Modules in Flutter
package com.example.helloflutterplugin;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.modules.toast.ToastModule;
import com.nparashuram.reactnative.ReactNativeModuleAdapter;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
import io.flutter.plugin.common.PluginRegistry.Registrar;
@axemclion
axemclion / PerfLogger.java
Last active August 12, 2023 02:56
React Native Android - Systrace from ReactMarkers
package com.nparashuram;
import android.os.Process;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.ViewTreeObserver;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.bridge.ReactContext;
@axemclion
axemclion / MessageQueueSpy.js
Last active February 8, 2023 06:25
Message Queue - Replay React Native Message Queue
import MessageQueue from 'react-native/Libraries/BatchedBridge/MessageQueue.js';
const WHITELIST = ['UIManager'];
const NOOP = () => { };
let queue = [];
let now = 0;
export default {
start() {
MessageQueue.spy(msg => {
@axemclion
axemclion / screenscraper.user.js
Created July 26, 2009 16:56
Screen Scraper Template
// ==UserScript==
// @name ScreenScraperTemplate
// @namespace http://dy-verse.blogspot.com
// @include http://page.you.wanna.scrape/path?pageName?pageNumber=*
// ==/UserScript==
/**
* This function is responsible for submitting the data
* @param {Object} parsedData
* @param {Object} record
@axemclion
axemclion / app.jsx
Last active September 5, 2020 14:31
CodePush + Push Notifications for A/B Testing
import Push from 'mobile-center-push';
import CodePush from 'react-native-code-push';
import { AppState } from 'react-native';
export default class MyApp extends Component {
// Component Logic ...
}
Push.setEventListener({
pushNotificationReceived: function (pushNotification) {
@axemclion
axemclion / index.js
Last active March 13, 2020 09:00
DBMonster Perf Comparisons
var urls = {
react: 'http://run.plnkr.co/plunks/Wwgjjpl9NHMO5Nd1TUyN/',
ember: 'https://dbmonster.firebaseapp.com/',
underscore: 'http://jashkenas.github.io/dbmonster/',
ractive: 'http://www.rich-harris.co.uk/ractive-dbmonster/',
paperclip: 'http://paperclip-dbmonster.herokuapp.com/'
}
var browserPerf = require('browser-perf');
var FILE = 'data.json';
@axemclion
axemclion / adding_flipper.diff
Last active September 29, 2019 04:10
Adding Flipper to an existing React Native project
diff --git a/android/app/build.gradle b/android/app/build.gradle
index 6560b78..eade6f6 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -176,12 +176,21 @@ android {
}
}
+ packagingOptions {
+ pickFirst '**/libc++_shared.so'