Skip to content

Instantly share code, notes, and snippets.

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 really have SREs and they make engi
@avshabanov
avshabanov / Gruntfile.js
Last active August 29, 2015 14:18
Sample gruntfile for mixed (plain JS + reactjs) project processed by browserify
module.exports = function(grunt) {
function prepareSkeleton() {
grunt.file.mkdir('target/web/js');
grunt.file.mkdir('target/web/tmp/js');
}
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
package com.alexshabanov.neocharseq
trait Str {
/** Appends the contents of this stream. */
fun appendTo(stream: Appendable)
fun charAt(pos: Int): Char
fun length(): Int
final Object o1 = jdbcOperations.query("SELECT book_id, series_id, pos FROM book_series", new RowMapper<Object>() {
@Override
public Object mapRow(ResultSet rs, int i) throws SQLException {
final Map<String, Object> result = new HashMap<String, Object>();
result.put("book_id", rs.getLong("book_id"));
result.put("series_id", rs.getLong("series_id"));
result.put("pos", rs.getInt("pos"));
return result;
}
});
@avshabanov
avshabanov / SampleXmlHttpRequestWithRsvpPromise.js
Created April 15, 2015 06:20
XMLHttpRequest + rsvp.Promise
/**
* Creates a new HTTP request for data fetched by using async AJAX interface.
* TODO: make common
*
* @arg method String, that identifies HTTP request method, e.g. 'GET', 'PUT', 'POST', 'DELETE'
* @arg url URL to the AJAX resource, e.g. '/rest/ajax/foo/bar/baz'
* @arg requestBody An object, that represents a request, can be null
* @return A new rsvp.Promise instance
*/
function makeAjaxRequest(method, url, requestBody) {
@avshabanov
avshabanov / README.md
Created April 28, 2015 04:54
Simple Repl on Java

Start

java -cp out/production/SimpleRepl/ repl.SimpleRepl

Profiling using JMX

Start app:

@avshabanov
avshabanov / IdConcealingUtil.java
Created May 4, 2015 06:47
Id Concealing Utility
package com.truward.booklib.util;
import javax.annotation.Nonnull;
/**
* Utility class for mangling/unmangling IDs. Expected to introduce some level of fool proof rather than
* cryptographically strong transformations.
*
* @author Alexander Shabanov
*/
@avshabanov
avshabanov / InvokeInterfaceCost.java
Created May 5, 2015 05:44
InvokeInterface: Java vs C
/**
* @author Alexander Shabanov
*/
public class InvokeInterfaceCost {
public interface Modify {
int apply(int value);
}
public static final class DecOne implements Modify {

I just had to set up Jenkins to use GitHub. My notes (to myself, mostly):

Detailed Instructions

For setting up Jenkins to build GitHub projects. This assumes some ability to manage Jenkins, use the command line, set up a utility LDAP account, etc. Please share or improve this Gist as needed.

Install Jenkins Plugins

#! /bin/bash
# certificates are valids during 365 days
VALID=365
TMPPASS="test"
while [[ -z "$password" ]]
do
read -s -p "Enter password for the Certificate Authority (CA) key: " password
echo