Skip to content

Instantly share code, notes, and snippets.

View surendharreddy's full-sized avatar

Surendhar Reddy surendharreddy

View GitHub Profile
@surendharreddy
surendharreddy / JSStackTrace.java
Last active November 18, 2019 03:21
JS Stack Trace with a fix too handle `NoSuchKeyException` when parsing JS stack frames without line numbers. (https://github.com/facebook/react-native/commit/c953e0b4319da0976ece877c09b648a55bc57d9f#diff-b1f4759dd5826c5a70a67e2790a1febf)
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.util;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@surendharreddy
surendharreddy / tmux-cheatsheet.markdown
Created November 9, 2019 15:56 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@surendharreddy
surendharreddy / resetXcode.sh
Created November 6, 2019 07:26 — forked from maciekish/resetXcode.sh
Reset Xcode. Clean, clear module cache, Derived Data and Xcode Caches. You can thank me later.
#!/bin/bash
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Caches/com.apple.dt.Xcode/*
open /Applications/Xcode.app

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@surendharreddy
surendharreddy / git-change-commit-messages.md
Created June 19, 2019 03:43 — forked from nepsilon/git-change-commit-messages.md
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

@surendharreddy
surendharreddy / Update-branch.md
Created May 2, 2019 02:37 — forked from santisbon/Update-branch.md
Bring your feature branch up to date with master. Deploying from Git branches adds flexibility. Bring your branch up to date with master and deploy it to make sure everything works. If everything looks good the branch can be merged. Otherwise, you can deploy your master branch to return production to its stable state.

Updating a feature branch

First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch)

$ git checkout master

Fetch the remote, bringing the branches and their commits from the remote repository. You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master

$ git remote rm origin
$ git remote add origin git@github.com:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@surendharreddy
surendharreddy / gist:020345c6518f5fe3dc264af62e0cc5e5
Created October 18, 2018 01:49 — forked from steipete/ios-xcode-device-support.sh
Using iOS 12.1 devices with Xcode 10.0
// The trick is to link the DeviceSupport folder from the beta to the stable version.
// Updated on Oct 9th, 2018 for Xcode 10
ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/12.1\ \(16B5068g\) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
// Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
// sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
@surendharreddy
surendharreddy / mobile-dev-tips.md
Last active September 19, 2018 04:59
Mobile Development Tips

iOS

Record iPhone Simulator

  • Run the following command to record iPhone Simulator xcrun simctl io booted recordVideo video-name.mp4

Android

Taking screen shots on Geny motion

@surendharreddy
surendharreddy / react-native-errors.md
Last active September 28, 2018 03:24
Fixes for React Native most common errors.

[Android] app crashes with Fatal Exception: java.lang.NoClassDefFoundError okhttp3.OkHttpClient$Builder

/* Add following dependency to dependencies in android/app/build.gradle */ implementation 'com.android.support:multidex:1.0.3'

Import the following dependencies in MainApplication.java import android.support.multidex.MultiDex; import android.content.Context;

and add