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
| initialize: function () { | |
| this.$slider = this.$('.slider'); | |
| this.attachPopup(); | |
| this.attachSlider(); | |
| }, | |
| attachPopup: function () { | |
| var self = this; | |
| $('.press-photo-anchor').magnificPopup({ |
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
| initBaron: function () { | |
| if (this.scroller !== undefined) { | |
| this.scroller.dispose(); | |
| this.scroller = undefined; | |
| } | |
| var $wrapper = $('.wrapper'); | |
| $wrapper.css('height', 'auto'); | |
| var textHeight = 0; |
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
| attachResizeListener: function () { | |
| $(window).on('resize', this.resizer.bind(this)); | |
| }, | |
| resizer: function () { | |
| if (this.scroller !== undefined) { | |
| this.scroller.dispose(); | |
| this.scroller = undefined; | |
| } | |
| var $wrapper = $('.wrapper'); |
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
| -- Change password for user to specific database | |
| -- Create database | |
| create database mydb; | |
| -- Select database | |
| use mydb; | |
| -- Create user | |
| CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypassword'; |
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
| # create directory to hold translation message files | |
| mkdir locale/en/LC_MESSAGES/ | |
| # create messages | |
| python manage.py makemessages -l en | |
| # compile messages | |
| python manage.py compilemessages |
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
| from os import listdir | |
| from os.path import isfile, join | |
| mypath = '.' | |
| prepend = '<a href=""><img src="' | |
| append = '"></a>' | |
| onlyfiles = [ f for f in listdir(mypath) if isfile(join(mypath,f)) ] | |
| html_tags = [prepend + f + append for f in onlyfiles] |
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
| # change commit message after commit | |
| hg commit --amend | |
| # undo add before commit | |
| hg revert [file_name|directory_name] | |
| # create new branch | |
| hg branch new-branch-name | |
| # push new branch to remote |
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
| python manage.py dumpdata --indent 2 content.PageType content.ColumnType content.BlockType > initial_data.json |
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
| location ~ \.(eot|svg|ttf|woff|otf)$ { | |
| valid_referers blocked mysite.com *.mysite.com; | |
| if ($invalid_referer) { | |
| return 403; | |
| } | |
| } |
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
| find . -name "*.jpg" -print |sed 's/\(.*\)-big\(.*\)/mv & \1\2/' | sh |