Skip to content

Instantly share code, notes, and snippets.

View manuphatak's full-sized avatar
🎯
Focusing

Manu Phatak manuphatak

🎯
Focusing
View GitHub Profile
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

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

@jirutka
jirutka / rules-both.iptables
Created September 18, 2012 12:42
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <[email protected]>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@wsargent
wsargent / docker_cheat.md
Last active June 29, 2024 19:32
Docker cheat sheet
@stuart11n
stuart11n / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@akolosov
akolosov / gist:cedaac86b333a4ced95f
Last active February 5, 2025 05:47
vim 7.4 with lua+GUI on Ubuntu 14.04
#!/bin/sh
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev mercurial libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo mkdir /usr/include/lua5.1/include
sudo ln -s /usr/include/luajit-2.0 /usr/include/lua5.1/include
cd ~
hg clone https://code.google.com/p/vim/
@manuphatak
manuphatak / css_class.py
Created September 20, 2015 21:43
Django css class tag. Combine conditional classes.
# Python Libraries
import re
# Django Packages
from django import template
register = template.Library()
_re_camel_humps = re.compile('([a-z])([A-Z0-9])')
"""
@manuphatak
manuphatak / default_args_class_decorator.py
Created September 20, 2015 22:08
Class decorator that overrides default kwargs.
from functools import wraps
def defaults(method='__init__', **default_args):
"""Class decorator. Overrides method default arguments."""
def decorate(cls):
func = getattr(cls, method)
@wraps(func)
@manuphatak
manuphatak / pipeline.py
Last active December 12, 2015 07:03
Idiomatic text processing. Inverting reduce: instead of running one function on a list of values, run a list of functions on one value.
from functools import reduce
def pipeline(steps, initial=None):
def apply(result, step):
yield from step(result)
yield from reduce(apply, steps, initial)
if __name__ == '__main__':
# BEFORE

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

# Response to:
# http://blog.honeybadger.io/how-openstruct-and-hashes-can-kill-performance/
#
# It's not faire to use `Hash.new.merge(data)` if you can `Hash[data]`.
# `Hash[data]` is way faster! Lets compare!
#
# Read more: http://ruby-doc.org/core-2.2.0/Hash.html#method-c-5B-5D
#
# [UPDATE]
#