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
override viewDidLoad() { | |
super.viewDidLoad() | |
view.addSubview(button) | |
button.addTarget(self, action: #selector(self.increaseTapCount), for: .touchUpInside) | |
} | |
override func viewDidLayoutSubviews() { | |
super.viewDidLayoutSubviews() | |
button.frame = CGRect(15, 15, view.bounds.width - 30, 40) |
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
override viewDidLoad() { | |
super.viewDidLoad() | |
view.addSubview(button) | |
button.addTarget(self, action: #selector(self.increaseTapCount), for: .touchUpInside) | |
button.setTitle("Tap Count: " + tapCount.stringValue, for: .normal) | |
} | |
override func viewDidLayoutSubviews() { | |
super.viewDidLayoutSubviews() |
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
let button = UIButton() | |
override init(frame: CGRect) { | |
super.init(frame: frame) | |
addSubview(button) | |
} | |
override func layoutSubviews() { | |
super.layoutSubviews() | |
button.frame = CGRect(15, 15, bounds.width - 30, 40) |
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
let button = UIButton() | |
var tapCount = 0 | |
override viewDidLoad() { | |
super.viewDidLoad() | |
view.addSubview(button) | |
button.addTarget(self, action: #selector(self.increaseTapCount), for: .touchUpInside) | |
} | |
override func viewDidLayoutSubviews() { |
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
let button = UIButton() // Create the button | |
override viewDidLoad() { | |
super.viewDidLoad() | |
view.addSubview(button) // Add it to the view | |
} | |
override func viewDidLayoutSubviews() { | |
super.viewDidLayoutSubviews() | |
button.frame = CGRect(15, 15, view.bounds.width - 30, 40) // 3. Lay it out |
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
// Write to context | |
self.writerManagedObjectContext.performBlockAndWait { () -> Void in | |
// Do what you want here in self.writerManagedObjectContext | |
// Save | |
try? self.writerManagedObjectContext.save() | |
} |
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
gulp.src('') | |
.pipe(shell([ | |
'rm -rf ' + folder, | |
'cp -r . ' + folder, | |
'rm -rf ' + folder + '/.git', | |
'rm -f ' + folder + '/.gitignore', | |
'rm -rf ' + folder + '/node_modules', | |
'git -C ' + folder + ' init', | |
'git -C ' + folder + ' add -A', | |
'git -C ' + folder + ' commit -m "build commit"', |
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
// Query | |
var query bytes.Buffer | |
query.WriteString(`SELECT * FROM "table" WHERE id IN (`) | |
//Arguments | |
IDs := []int64{1,2,3} | |
args := make([]interface{}, len(IDs)) | |
// Create the query and the args | |
for i, ID := range IDs { |
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
<% if (typeof page !== 'undefined' && page === 'brand') { %> | |
<script type="text/javascript" src="js/jquery.onepage-scroll.js"></script> | |
<% } %> |
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
# Core | |
Django == 1.5.5 | |
MySQL-python | |
Pillow | |
South | |
django-apptemplates | |
django-debug-toolbar==0.11.0 | |
django-extensions | |
django-imagekit | |
django-jenkins |
NewerOlder