This file contains hidden or 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
extension String | |
{ | |
var length: Int { | |
get { | |
return self.characters.count | |
} | |
} | |
func contains(s: String) -> Bool { | |
return self.rangeOfString(s) != nil ? true : false |
This file contains hidden or 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
URL="https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash" | |
PROFILE="$HOME/.profile" | |
echo "Downloading git-completion..." | |
if ! curl "$URL" --silent --output "$HOME/.git-completion.bash"; then | |
echo "ERROR: Couldn't download completion script. Make sure you have a working internet connection." && exit 1 | |
fi |
This file contains hidden or 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
[alias] | |
s = status | |
cm = commit -am | |
lll = !git log --graph --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(white)- %an, %ar%Creset' | |
ll = !git log --stat --abbrev-commit | |
l = !git log --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(white)- %an, %ar%Creset' | |
[color] | |
diff = auto | |
status = auto |
This file contains hidden or 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 gem install activesupport -v 4.2.6 | |
sudo gem install cocoapods |
This file contains hidden or 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
*Don’t animate opening applications from the Dock* | |
`defaults write com.apple.dock launchanim -bool false` | |
*Speed up Mission Control animations* | |
`defaults write com.apple.dock expose-animation-duration -float 0.1` | |
*Remove the auto-hiding Dock delay* | |
`defaults write com.apple.dock autohide-delay -float 0` | |
*Remove the animation when hiding/showing the Dock* |
This file contains hidden or 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
require 'open-uri' | |
require 'digest' | |
SAVE_TO = './gravatars/' | |
threads = Array.new | |
Dir.foreach('./emails') do |item| | |
next if item == '.' or item == '..' | |
This file contains hidden or 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
// | |
// UIView+CMExtras.h | |
// | |
// Created by Chris Miles on 9/06/11. | |
// Copyright 2011 Chris Miles. | |
// | |
// 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 |
This file contains hidden or 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
echo "875.28.6.33/556-54" | tr -cd [:digit:] |
This file contains hidden or 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
<html> | |
<head> | |
<base href="http://dropbox.com/"></base> | |
</head> | |
<?php | |
//set POST variables | |
$url = 'https://www.dropbox.com/login'; | |
$headers = array( |
This file contains hidden or 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
@interface NSString (Repeat) | |
- (NSString *)repeatTimes:(NSUInteger)times; | |
@end | |
@implementation NSString (Repeat) | |
- (NSString *)repeatTimes:(NSUInteger)times { | |
return [@"" stringByPaddingToLength:times * [self length] withString:self startingAtIndex:0]; |