Skip to content

Instantly share code, notes, and snippets.

View axemclion's full-sized avatar

Parashuram N axemclion

View GitHub Profile
@axemclion
axemclion / chrome-selenium-timeline.js
Created September 19, 2015 04:06
Getting Chrome timeline from Selenium Log
var wd = require('wd');
// This is for Chromedriver directly.
// If you are using Selenium, use http://localhost:4444/wd/hub
var browser = wd.promiseRemote('http://localhost:9515');
var URL = 'http://islreview.com/'; // Change this to a custom URL
var config = {
"browserName": "chrome",
"chromeOptions": {
@axemclion
axemclion / README.md
Last active September 7, 2019 14:41
Angular E2E Tests (Protractor) - Performance Measurement

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 September 5, 2019 06:03
Fix Yoga conflict when using Flipper with React Native (for rn <0.62)
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 August 12, 2019 18:30
Adding Flipper to ReactNative
// 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 08:37
Protractor-Perf Example
*.log
node_modules/
@axemclion
axemclion / feedly.user.js
Last active May 9, 2019 12:24
Feedly Open in New Background Tab
// ==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 February 1, 2019 12:20
React Native Time Travel Debugging with VSCode
/* 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 November 11, 2018 21:02
React Native Android Startup - logging
@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 August 18, 2018 05:14
Using browser-sync with Cordova
// 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 January 6, 2018 15:58
Greasemonkey script to show password on doubleclick
// ==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');