Skip to content

Instantly share code, notes, and snippets.

View r4um's full-sized avatar

Pranay Kanwar r4um

View GitHub Profile
@r4um
r4um / .gitconfig
Created December 7, 2020 05:49 — forked from carolynvs/.gitconfig
git wip - Show what branches you have been working on lately
[alias]
wip = for-each-ref --sort='authordate:iso8601' --format=' %(color:green)%(authordate:relative)%09%(color:white)%(refname:short)' refs/heads

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

@r4um
r4um / LetsDestroyC.md
Created February 7, 2020 22:55 — forked from shakna-israel/LetsDestroyC.md
Let's Destroy C

Let's Destroy C

I have a pet project I work on, every now and then. CNoEvil.

The concept is simple enough.

What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?


@r4um
r4um / buddyinfo.py
Created January 6, 2018 17:06 — forked from labeneator/buddyinfo.py
Pretty prints /proc/buddyinfo
#!/usr/bin/env python
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 textwidth=79 autoindent
"""
Python source code
Last modified: 15 Feb 2014 - 13:38
Last author: lmwangi at gmail com
Displays the available memory fragments
by querying /proc/buddyinfo
@r4um
r4um / gist:d0ff90e9e6e745199c00556be9f94ca9
Created November 25, 2017 17:15 — forked from colestanfield/gist:fac042d3108b0c06e952
sbt-assembly merge strategy for aop.xml files
// Create a new MergeStrategy for aop.xml files
val aopMerge: MergeStrategy = new MergeStrategy {
val name = "aopMerge"
import scala.xml._
import scala.xml.dtd._
def apply(tempDir: File, path: String, files: Seq[File]): Either[String, Seq[(File, String)]] = {
val dt = DocType("aspectj", PublicID("-//AspectJ//DTD//EN", "http://www.eclipse.org/aspectj/dtd/aspectj.dtd"), Nil)
val file = MergeStrategy.createMergeTarget(tempDir, path)
@r4um
r4um / Notes.md
Created October 2, 2017 14:32 — forked from chrisvest/Notes.md
PrintCompilation on different versions of HotSpot VM

About PrintCompilation

This note tries to document the output of PrintCompilation flag in HotSpot VM. It was originally intended to be a reply to a blog post on PrintCompilation from Stephen Colebourne. It's kind of grown too big to fit as a reply, so I'm putting it here.

Written by: Kris Mok [email protected]

Most of the contents in this note are based on my reading of HotSpot source code from OpenJDK and experimenting with the VM flags; otheres come from HotSpot mailing lists and other reading materials listed in the "References" section.

This

@r4um
r4um / SynchSB.java
Created October 2, 2017 14:12 — forked from rednaxelafx/SynchSB.java
Demo JDK8 HotSpot C2's escape analysis + lock elision
public class SynchSB {
StringBuilder sb = new StringBuilder();
public synchronized int length() {
return sb.length();
}
public synchronized StringBuilder append(String str) {
return sb.append(str);
}
@r4um
r4um / dockerpsns.sh
Created September 18, 2017 07:36 — forked from brendangregg/dockerpsns.sh
docker ps --namespaces
#!/bin/bash
#
# dockerpsns - proof of concept for a "docker ps --namespaces".
#
# USAGE: ./dockerpsns.sh
#
# This lists containers, their init PIDs, and namespace IDs. If container
# namespaces equal the host namespace, they are colored red (this can be
# disabled by setting color=0 below).
#
@r4um
r4um / wait_timeout.go
Created July 7, 2017 13:55 — forked from x32net/wait_timeout.go
Golang - WaitGroup Timeout
package main
import (
"fmt"
"sync"
"time"
)
func main() {
wg := sync.WaitGroup{}
@r4um
r4um / count_hbase.sh
Created May 22, 2017 17:02 — forked from tsuna/count_hbase.sh
Script to get stats on the number of KeyValue and size of an HBase table, directly from HFiles
#!/bin/bash
# Copyright (c) 2010, 2011 Benoit Sigoure. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.