Skip to content

Instantly share code, notes, and snippets.

Avatar

Parashuram N axemclion

View GitHub Profile
@axemclion
axemclion / README.md
Last active Sep 7, 2019
Angular E2E Tests (Protractor) - Performance Measurement
View README.md

Protractor and Performance Test

Protractor is the end to end test case runner for AngularJS. These end to end test cases can be repurposed to record performance metrics when the scenario is being run. This is a sample repository with an example of how this can be done.

Usage

Step 0 - Setup

Install all dependencies using npm install

Step 1 - Prepare configuration

@axemclion
axemclion / fix-yoga-react-native.sh
Created Sep 5, 2019
Fix Yoga conflict when using Flipper with React Native (for rn <0.62)
View fix-yoga-react-native.sh
sed -i '.bak' s/\'yoga\'/\'Yoga\'/ node_modules/react-native/ReactCommon/yoga/yoga.podspec
sed -i '.bak' s/\#\{version\}\.React/1\.14\.3/ node_modules/react-native/ReactCommon/yoga/yoga.podspec
sed -i '.bak' s/\#.Pinning/spec.pod_target_xcconfig=\{\'DEFINES_MODULE\'=\>\'YES\'\\}\#/ node_modules/react-native/ReactCommon/yoga/yoga.podspec
sed -i '.bak' s/\"yoga\",.\"\#\{version\}\.React\"/\"Yoga\"/ node_modules/react-native/React/React-Core.podspec
sed -i '.bak' s/\'yoga\'/\'Yoga\'/ ios/Podfile
@axemclion
axemclion / MainApplication.java
Created Aug 12, 2019
Adding Flipper to ReactNative
View MainApplication.java
// Call this in MainApplication.onCreate(), just after Soloader line.
private static void initialize(Context context) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.facebook.flipper.ReactNativeFlipper");
aClass.getMethod("initializeFlipper", Context.class).invoke(null, context);
@axemclion
axemclion / .gitignore
Last active May 28, 2019
Protractor-Perf Example
View .gitignore
*.log
node_modules/
@axemclion
axemclion / feedly.user.js
Last active May 9, 2019
Feedly Open in New Background Tab
View feedly.user.js
// ==UserScript==
// @name Feedly - Open entry in background (Modified)
// @description Adds 'h' as a hotkey to open selected entry in background tab
// @namespace gist.github.com/axemclion/11b6968d2418caad7528e1e629af3886/edit
// @author axemclion
// @include http://feedly.com/*
// @include https://feedly.com/*
// @include http://*.feedly.com/*
// @include https://*.feedly.com/*
// @grant GM.openInTab
@axemclion
axemclion / debugger.js
Last active Feb 1, 2019
React Native Time Travel Debugging with VSCode
View debugger.js
/* PreReqs - Run these before starting Recording
For recording, run with --record parameter
npm install sync-request@4.1.0 websocket@1.0.23 flatten-source-map@0.0.2 && mkdir -p logs
*/
var PACKAGER = 'localhost:8081'; //CHANGE this to where the package is running
var vm = require('vm');
var url = require('url');
var path = require('path');
@axemclion
axemclion / MainApplication.java
Created Nov 11, 2018
React Native Android Startup - logging
View MainApplication.java
@Override
public void onCreate() {
super.onCreate();
///////// Add lines below this to capture times of the large sections
final String TAG = "RN_STARTUP"; // If you already have a TAG for the app, use that instead.
final TimingLogger timingLogger = new TimingLogger("AXE", "REACT_NATIVE_STARTUP");
timingLogger.reset();
ReactMarker.addListener(new ReactMarker.MarkerListener() {
@Override
@axemclion
axemclion / browser-sync.js
Last active Aug 18, 2018
Using browser-sync with Cordova
View browser-sync.js
// Browser-Sync support for Cordova projects
// To use this, add the following snippet as a after_run hook using something like
// <hook type="after_prepare" src="hooks/browser-sync.js" />
// Also add ws: 'unsafe-inline' to the CSP in index.html
// The do Cordova run, and changing anything in www/ will live-reload the cordova app on emulator/device
module.exports = function(context) {
if (context.opts.options[0] === '--browser-sync-mode') {
// Prepare was called by this script, so don't run the script again
return;
@axemclion
axemclion / showpassword.user.js
Created Jan 6, 2018
Greasemonkey script to show password on doubleclick
View showpassword.user.js
// ==UserScript==
// @name Show Password
// @version 1
// @grant none
// ==/UserScript==
function handleDblClick(e){
var pwd = e.target;
var type = pwd.getAttribute('type');
pwd.setAttribute('type', type === 'password' ? 'text': 'password');
@axemclion
axemclion / feedly.user.js
Created Sep 24, 2014
Feedly - Open Link in Background
View feedly.user.js
// ==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