Skip to content

Instantly share code, notes, and snippets.

View surendharreddy's full-sized avatar

Surendhar Reddy surendharreddy

View GitHub Profile
@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.

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 / 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
@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 / 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 / slim-redux.js
Created January 2, 2020 08:51 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
/**
* Base64 encode/decode
* Inspired by: https://github.com/davidchambers/Base64.js/blob/master/base64.js
*/
const chars =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
export const Base64 = {
btoa: (input) => {
let str = input
let output = ''
@surendharreddy
surendharreddy / run_jar.py
Created August 7, 2020 19:00 — forked from isaacmg/run_jar.py
A simple example of using a DAG to run a jar file.
from airflow import DAG
from airflow.operators import BashOperator
from datetime import datetime
import os
import sys
args = {
'owner': 'airflow'
, 'start_date': datetime(2017, 1, 27)
, 'provide_context': True
brew cask install adoptopenjdk/openjdk/adoptopenjdk8
brew cask install android-sdk
# [alternative] echo to profile and source
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
export ANDROID_HOME=/usr/local/share/android-sdk
echo y | sdkmanager "system-images;android-29;google_apis;x86"
yes | sdkmanager --licenses