Skip to content

Instantly share code, notes, and snippets.

@adamjohnson
adamjohnson / profile_index.json
Created May 18, 2020 16:44
Use CleanSlateCMS to output JSON for a profile index template.
[<r:children:each limit='{$limit}' labels='{$labels}'>
{
"id": <r:page:id />,
"page_published_at": "<r:date_format format='httpdate' value='{page:published_at}' />",
"page_url": "<r:page:url />",
"page_name": "<r:page:name />",
"page_alternate_name": "<r:page:alternate_name />",
"profile_name": "<r:page:content name='wvu-profile__name' />",
"profile_job_title": "<r:page:content name='wvu-profile__job-title' />",
"profile_email": "<r:escape_xml><r:page:content name='wvu-profile__email' /></r:escape_xml>",
@adamjohnson
adamjohnson / sublime-keyboard-shortcuts.md
Last active May 12, 2020 12:19
Sublime Text keyboard shortcuts I should remember

Sublime Text keyboard shortcuts

These are some Sublime Text keyboard shortcuts that I can't seem to remember. I am writing them down in hopes I will use them and commit them to memory.

  1. Find the matching bracket: CTRL + M. Finds: (), {}, [].
  2. Select entire contents of parentheses, brackets, or braces: CTRL+SHIFT+M.
  3. Jump to specific line number: CTRL + P then :xx eg: :50 to go to line 50.
  4. Copy/Cut & Paste entire lines without highlighting: Same keys, paste inserts line above your cursor.
  5. Add a new line from the middle of some text & place cursor on the new line: CTRL/CMD + ENTER.
@adamjohnson
adamjohnson / preferences.sublime-settings
Last active November 26, 2019 20:06
Exclude folder from search in Sublime Text. Helpful if you want to have the folder show up on the left, but don't want Sublime to search it when doing a "Find in Files" / project-wide search.
{
"binary_file_patterns": ["node_modules/*", "bower_components/*"]
}
@adamjohnson
adamjohnson / rcomment.sublime-snippet
Created September 6, 2018 22:43
Sublime Text snippet to insert a Radius comment for CleanSlate.
<snippet>
<!-- Snippet to insert a radius comment for CleanSlate. -->
<content><![CDATA[
<r:comment>
<!-- ${1: } -->
</r:comment>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>rcomment</tabTrigger>
<description>Insert an r:comment tag for CleanSlate</description>
@adamjohnson
adamjohnson / at-include.sublime-snippet
Last active July 30, 2018 15:53
Create a tab trigger / shortcut for Sublime Text to spit out @include when you type 'in' then hit tab. Go to Tools > New Snippet. Save this in Packages > User.
<snippet>
<content><![CDATA[
@include
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>in</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.scss</scope> -->
</snippet>
@adamjohnson
adamjohnson / bracket.sublime-snippet
Created November 28, 2017 17:02
CSS Bracket Expander Sublime Text Snippet
<snippet>
<!-- Type `bracket` and hit tab to open a bracket with a closing comment. -->
<!-- Type the class for the element you are styling and it is placed at the top and in the comment after the closing bracket -->
<!-- Hit tab a second time to put your cursor into a beautifuly tabbed spot within the bracket -->
<!-- https://webdevstudios.com/2016/08/16/snippets-saved-life-how-sublime-text-3-snippets-changed-everything/ -->
<content><![CDATA[
.${1:example} {
${2:Type a class then hit tab!}
} //.${1:example}
]]></content>
@adamjohnson
adamjohnson / mq.sublime-snippet
Last active November 28, 2017 16:54
Media Query Sublime Text Snippet
<snippet>
<content><![CDATA[
@include mq(\$bp-${1:}) \{
${2:Type then hit tab!}
\} //mq
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>mq</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope> seems to break stuff / not work / disable snippet. ¯\_(ツ)_/¯ -->
@adamjohnson
adamjohnson / skeleton_wide.css
Created February 21, 2012 16:15
1200px Media Query for the Skeleton Grid
/* 1200px Media Query for the Skeleton Grid - http://getskeleton.com
* Adapted from http://www.aliaspooryorik.com/blog/index.cfm/e/posts.details/post/responsive-css-grid-systems-345
* Added .alpha.omega combo classes. Hope to see that fixed in later versions of Skeleton: https://github.com/dhgamache/Skeleton/issues/68
*/
@media only screen and (min-width: 1200px) {
.container { width: 1200px;}
.container .column,
.container .columns { margin-left: 10px; margin-right: 10px; }
@adamjohnson
adamjohnson / index.html
Created October 3, 2012 19:48
Working with Attributes in Concrete5, download this code and paste into a .html document
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Working with Attributes in Concrete5</title>
<style>
pre { border: 1px solid black; padding:10px; }
</style>
</head>
<body>