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
suite('diff', () => { | |
suite('transformRange', () => { | |
test('add one line at beginning', () => { | |
const diff = new Diff(`diff --git a/comments.txt b/comments.txt | |
index 63ef680..47010db 100644 | |
--- a/comments.txt | |
+++ b/comments.txt | |
@@ -1,3 +1,4 @@ | |
+added line | |
this is line 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
/// A simple hello world view that uses Auto Layout. | |
public class HelloWorldAutoLayout: UIView { | |
private lazy var imageView: UIImageView = { | |
let imageView = UIImageView() | |
imageView.translatesAutoresizingMaskIntoConstraints = false | |
imageView.setContentHuggingPriority(UILayoutPriorityRequired, forAxis: .Vertical) | |
imageView.setContentHuggingPriority(UILayoutPriorityRequired, forAxis: .Horizontal) | |
imageView.setContentCompressionResistancePriority(UILayoutPriorityRequired, forAxis: .Vertical) | |
imageView.setContentCompressionResistancePriority(UILayoutPriorityRequired, forAxis: .Horizontal) |
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 LayoutKit | |
/// A simple hello world layout using LayoutKit. | |
public class HelloWorldLayout: InsetLayout { | |
public init() { | |
super.init( | |
insets: UIEdgeInsets(top: 4, left: 4, bottom: 4, right: 8), | |
sublayout: StackLayout( | |
axis: .horizontal, |
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
// This should be in a color/ directory (but gists don't allow subdirectories) | |
package color | |
var ( | |
Red = Color{"red"} | |
Blue = Color{"blue"} | |
) | |
type Color struct { | |
name 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
// Created by Nick Snyder on 11/13/12. | |
// https://gist.github.com/nicksnyder/4075682 | |
// http://stackoverflow.com/questions/12927027/uicollectionview-flowlayout-not-wrapping-cells-correctly-ios | |
// NDCollectionViewFlowLayout.h | |
@interface NDCollectionViewFlowLayout : UICollectionViewFlowLayout | |
@end |