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
(ignite)Tim-rMBP:ignite tim$ django-admin.py migrate | |
Running migrations for longerusernameandemail: | |
- Migrating forwards to 0001_initial. | |
> longerusernameandemail:0001_initial | |
- Loading initial data for longerusernameandemail. | |
Installed 0 object(s) from 0 fixture(s) | |
Running migrations for conf: | |
- Migrating forwards to 0004_ssl_account_settings_rename. | |
> conf:0001_initial | |
> conf:0002_auto__add_field_setting_site |
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
# --- Redirect http://respiratoryexam.com and http://www.respiratoryexam.com to https --- | |
server { | |
listen 80; | |
server_name respiratoryexam.com | |
www.respiratoryexam.com; | |
return 301 https://respiratoryexam.com$request_uri; | |
} | |
# --- Redirect https://www.respiratoryexam.com to http://respiratoryexam.com --- |
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
nylas.drafts.build({ | |
subject: this.email.subject, | |
body: this.email.html, | |
to: this.email.to | |
}).send() | |
.then(Meteor.bindEnvironment(successCallback)) | |
.catch(Meteor.bindEnvironment(errorCallback)); |
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.showLeadListColumns() ? ( | |
<th className="in-campaign">Campaigns</th> | |
) : ([ | |
<th className="score">Score</th>, | |
<th className="page-views">Page Views</th>, | |
<th className="last-active-at">Last Active</th> | |
])} |
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
Tim-rMBP:linkmetrics tim$ meteor update | |
Changes to your project's package version selections from updating the release: | |
accounts-base upgraded from 1.1.3 to 1.2.0 | |
accounts-google upgraded from 1.0.3 to 1.0.4 | |
accounts-oauth upgraded from 1.1.3 to 1.1.4 | |
accounts-password upgraded from 1.0.6 to 1.1.0 | |
accounts-ui upgraded from 1.1.4 to 1.1.5 | |
accounts-ui-unstyled upgraded from 1.1.6 to 1.1.7 |
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 works when used in a later query. | |
user_account_maps = models.UserAccountMap.objects.filter(user_extension__user=user) | |
account_ids = [uam.account_id for uam in user_account_maps] | |
# This doesn't | |
account_ids = models.UserAccountMap.objects.filter(user_extension__user=user).values_list('id', flat=True) | |
WHAT'S THE DIFFERENCE? | |
Warning at /dashboard/ |
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
# views.py | |
context = { | |
contacts: Contacts.objects.some_custom_method.values('id', 'name') # Only allow access to id and name | |
} | |
# Pass context to view rendering code | |
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
# From http://vanderwijk.info/blog/adding-css-classes-formfields-in-django-templates/#comment-1193609278 | |
from django import template | |
register = template.Library() | |
@register.filter(name='add_attributes') | |
def add_attributes(field, css): | |
attrs = {} | |
definition = css.split(',') |
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
curl -H 'Content-Type: application/json' \ | |
-H 'Accept: application/json' \ | |
-X POST http://localhost:3000/users \ | |
-d '{"user":{"email":"[email protected]", "password": "123456", "name": "Example User"}}' |
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
require 'yql_finance' | |
query = YQLFinance::StockQuery.new | |
response = query.find_by_symbol('P') | |
results = JSON.parse(response.body) | |
# To see a nice representation of the hash | |
pp(results) | |
# To get LastTradePriceOnly |