Skip to content

Instantly share code, notes, and snippets.

Avatar

Surendhar Reddy surendharreddy

View GitHub Profile
View .tmux.conf
unbind-key C-b
set-option -g prefix C-f
# Refresh with source file
bind-key R source-file ~/.tmux.conf
# Use zsh as default shell
set-option -g default-shell /bin/zsh
# Enable mouse support
View android.sh
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
@surendharreddy
surendharreddy / run_jar.py
Created Aug 7, 2020 — forked from isaacmg/run_jar.py
A simple example of using a DAG to run a jar file.
View run_jar.py
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
View Base64.js
/**
* 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 / slim-redux.js
Created Jan 2, 2020 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
View slim-redux.js
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])) {
@surendharreddy
surendharreddy / JSStackTrace.java
Last active Nov 18, 2019
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)
View JSStackTrace.java
/**
* 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;
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@surendharreddy
surendharreddy / resetXcode.sh
Created Nov 6, 2019 — forked from maciekish/resetXcode.sh
Reset Xcode. Clean, clear module cache, Derived Data and Xcode Caches. You can thank me later.
View resetXcode.sh
#!/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
View 20111011_SteveYeggeGooglePlatformRant.md

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 Jun 19, 2019 — forked from nepsilon/git-change-commit-messages.md
How to change your commit messages in Git? — First published in fullweb.io issue #55
View git-change-commit-messages.md

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.

You can’t perform that action at this time.