These rules are adopted from the AngularJS commit conventions.
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
// add rounded corners to an item | |
.border-radius (@radius: 5px) { | |
-webkit-border-radius: @radius; | |
-moz-border-radius: @radius; | |
border-radius: @radius; | |
} | |
// add only specific rounded corners | |
.border-radius-all (@top: 5px, @right: 5px, @bottom: 5px, @left: 5px) { | |
-webkit-border-radius: @arguments; |
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 | |
echo "Recursively removing .svn folders from" | |
pwd | |
rm -rf `find . -type d -name .svn` | |
echo "Folders removed." |
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
function addNoise(canvas) { | |
var ctx = canvas.getContext('2d'); | |
// get canvas pixels | |
var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); | |
var pixels = imageData.data; | |
for (var i = 0, il = pixels.length; i < il; i += 4) { | |
// var color = Math.round(Math.random() * 255); | |
var M = 100; |
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
# checkout only immediate folders for a partial checkout | |
svn co http://subversion/project/trunk my_checkout --depth immediates | |
# change the depth and update | |
svn update --set-depth infinity | |
# another example | |
svn checkout --depth empty http://svnserver/trunk/ proj | |
svn update --set-depth infinity proj/foo |
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 class StoppableViewPager extends ViewPager { | |
private boolean mEnabled; | |
public StoppableViewPager(Context context) { | |
super(context); | |
mEnabled = true; | |
} | |
public StoppableViewPager(Context context, AttributeSet attrs) { |
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
#import "SPAutoLayoutChildViewController.h" | |
@implementation SPAutoLayoutChildViewController | |
- (void)updateViewConstraints { | |
if (self.view.superview) { | |
UIView *thisView = self.view; | |
thisView.translatesAutoresizingMaskIntoConstraints = NO; | |
NSDictionary *views = NSDictionaryOfVariableBindings(thisView); | |
[self.view.superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[thisView]|" options:0 metrics:nil views:views]]; |
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
git submodule foreach '[ "$path" == "submodule-to-exclude" ] || git pull origin master' |
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
git branch --merged | ?{-not ($_ -eq "* develop")} | %{git branch -d $_.trim()} |
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 int getStatusBarHeight() { | |
int result = 0; | |
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); | |
if (resourceId > 0) { | |
result = getResources().getDimensionPixelSize(resourceId); | |
} | |
return result; | |
} |
OlderNewer