Skip to content

Instantly share code, notes, and snippets.

View antonholmquist's full-sized avatar

Anton Holmquist antonholmquist

View GitHub Profile
Temp/
Library/
obj/
*.svd
!Library/*.asset
!Library/AssetImportState
!Library/AssetVersioning.db
!Library/BuildPlayer.prefs
!Library/ScriptMapper
No local-settings, importing local_template
No db-settings, importing template_db
No local-settings, importing local_template
No db-settings, importing template_db
Validating models...
Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x1045ecad0>>
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/django/core/management/commands/runserver.py", line 93, in inner_run
self.validate(display_num_errors=True)
# Core
Django == 1.5.5
MySQL-python
Pillow
South
django-apptemplates
django-debug-toolbar==0.11.0
django-extensions
django-imagekit
django-jenkins
<% if (typeof page !== 'undefined' && page === 'brand') { %>
<script type="text/javascript" src="js/jquery.onepage-scroll.js"></script>
<% } %>
@antonholmquist
antonholmquist / gist:7ce6bd619358dac499c7
Last active August 29, 2015 14:11
Go Postgres IN-example
// 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 {
@antonholmquist
antonholmquist / gist:d009312bc1b6cab6c5b7
Created January 16, 2015 09:06
Heroku separate repo deploy
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"',
// Write to context
self.writerManagedObjectContext.performBlockAndWait { () -> Void in
// Do what you want here in self.writerManagedObjectContext
// Save
try? self.writerManagedObjectContext.save()
}
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
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() {
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)