I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Usage: | |
# Once you started git rebase --interactive master, and you are presented | |
# with the list of commit SHAs and commit messages, from Vim: | |
# - visually select all SHAs via "V}k" | |
# - launch git-rr: !git-rr | |
# - ... | |
# - profit! you now have the same info as before, just with the list of | |
# filenames which changed with each commit, and can now move around |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PayPal blocks copy/paste actions in their "change password" form, | |
citing some irrelevant security issues as the reason. That's a | |
load of crap, and they know it -- disabling copy/paste makes it a | |
lot harder to use a decent password generator and a lot easier to | |
screw up your pwd when retyping, especially if it's a long one | |
(as it should be!). | |
So, here's the quick'n'dirty way to use an externally generated | |
password in your PayPal account: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common | |
sudo apt-get build-dep vim-gnome | |
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev | |
sudo rm -rf /usr/local/share/vim | |
sudo rm /usr/bin/vim | |
The Y Combinator is a classic lambda calculus construct that many people find baffling. Here's my attempt to explain it as clearly as possible (no promises!). Familiarity with Haskell syntax is assumed.
The problem we're trying to solve is how to write an anonymous function (a "lambda") that is recursive. Normally, if you want to write a recursive function, it looks like this:
fac n = if n == 0 then 1
else n * fac (n-1)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef _WIN32 | |
typedef struct _GUID { | |
uint32_t Data1; | |
uint16_t Data2; | |
uint16_t Data3; | |
uint8_t Data4[8]; | |
} GUID; | |
#endif | |
GUID StringToGuid(const std::string& str) |