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
{ | |
"printWidth": 80, | |
"tabWidth": 2, | |
"singleQuote": false, | |
"trailingComma": "all", | |
"bracketSpacing": true, | |
"jsxBracketSameLine": false, | |
"parser": "babylon", | |
"semi": true, | |
"useTabs": false, |
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
{ | |
"Version":"2012-10-17", | |
"Statement":[ | |
{ | |
"Sid":"AddPerm", | |
"Effect":"Allow", | |
"Principal": "*", | |
"Action":["s3:GetObject"], | |
"Resource":["arn:aws:s3:::examplebucket/*"] | |
} |
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
<!DOCTYPE html> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
{% if entry is defined %} | |
<title>{{ entry.metaTitle ? entry.metaTitle : entry.title }} | {{ siteName }}</title> | |
{% else %} |
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
./ngrok http -host-header=mycoolhost.dev 80 | |
# https://ngrok.com/faq#virtual-hosts |
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
class Stub extends React.Component { | |
static childContextTypes = { | |
router: React.PropTypes.object.isRequired | |
}; | |
getChildContext() { | |
return { | |
router: { | |
makePath(pathname, query) { }, | |
makeHref(pathname, query) { }, |
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
find . -iname '._*' -exec rm -rf {} \; |
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
<snippet> | |
<content><![CDATA[ | |
// ${1:1.0} - ${2:Element} | |
////////////////////////////////////////////// | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>_//</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<scope>source.scss</scope> | |
</snippet> |
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
{# Get the category from the slug. This will return one CategoryModel #} | |
{% set topCat = craft.categories.slug('someSlug').first() %} | |
{# Get the first subcategory under the top level category using the getChildren() method on the category model. #} | |
{% set firstSubCat = topCat.getChildren().first() %} | |
{# Grab the first entry under that category using the relatedTo function and appending the .first() method to return only one item. #} | |
{% set firstEntry = craft.entries.relatedTo( firstSubCat ).first() %} | |
{# Set your image from your asset field #} |
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
{# | |
I'm using this to build out a calendar. Not every month/day on the calendar has an event and I don't want a user to go into May 2034 and see nothing. | |
I needed a way to go from the current day and count out to the last event in the database and show everything in between. This is what I ended up doing. | |
This method assumes you have a channel of events. | |
Every event is assigned to an 'event' category with sub categories below it. | |
Every entry has an 'eventTime' date field within it. | |
I'm not worrying about recurring events. It's unneeded for this application. | |
#} |
NewerOlder