git checkout <remote_branch_name>
git checkout -t <remote>/<remote_branch_name>
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
public static class PasswordHelpers | |
{ | |
private static bool GetPasswordInitialized(DependencyObject obj) | |
{ | |
return (bool)obj.GetValue(PasswordInitializedProperty); | |
} | |
private static void SetPasswordInitialized(DependencyObject obj, bool value) | |
{ | |
obj.SetValue(PasswordInitializedProperty, value); | |
} |
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
Scenario | Tracking set up | |
----------------------------------------------------------------------------------|----------------- | |
Clone a (non-emtpy) repo, use the branch which is checked out automatically | Y | |
Push a branch to a remote, that doesn't exist on the remote | N | |
Push a branch to a remote, that doesn't exist on the remote, with push -u | Y | |
Checkout a branch from a remote, without -t (specified or implied) | N | |
Checkout a branch from a remote, with -t (specified or implied) | Y |
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
class MultiLoader | |
def initialize(input) | |
@input = input | |
initial_map | |
end | |
def initial_map | |
@map = {} | |
@input.each do |host, opts| | |
if opts.is_a?(String) |
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
config = IniParser.new('config.ini').load | |
p config['section.key'] | |
p config.get('section.not_a_key', 'my_default') | |
p config['section.two.key3'] | |
config['section.key'] = 'hi' | |
config.set('section.two.key4', 'the_value', 'This is the comment') | |
config.save |
So. One of my housemates pranked me, and I decided to get my revenge. My revenge was 100% inspired by upside-down-ternet, and goes as follows:
- Linux box running the ruby script below, which acts as a transparent proxy
- iptables rules on the linux box route all port 80 requests through the proxy
- arp poisoning routes all of the victim's traffic through the linux box
- Proxy isn't actually transparent. It intercepts requests for images, and does some processing on them, blurring them and writing a rude word in the middle.
Assuming a board in the style
b = [
nil, nil, nil, 3, 9, nil, nil, 1, nil,
5, nil, 1, nil, nil, nil, nil, 4, nil,
9, nil, nil, 7, nil, nil, 5, nil, nil,
6, nil, 2, 5, 3, nil, nil, 7, nil,
nil, nil, nil, nil, 7, nil, nil, nil, 8,
7, nil, nil, 8, nil, nil, 9, nil, 3,
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
The following snippet might help detect evil merges which deleted a file. | |
$ for rev in `git rev-list --merges HEAD`; do del=`( git diff --name-only --diff-filter=D $rev^ $rev; git diff --name-only --diff-filter=D $rev^2 $rev ) | sort | uniq -u | tr '\n' ' '`; [ -n "$del" ] && echo "$rev $del"; done |
OlderNewer