Skip to content

Instantly share code, notes, and snippets.

adamjohnson / liquid_comment.sublime-snippet
Last active Jan 29, 2021
A collection of Liquid Snippets for CleanSlate CMS + Sublime Text 3.
View liquid_comment.sublime-snippet
<!-- Snippet to insert a Liquid comment for CleanSlate. -->
{% comment %}
{% endcomment %}
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<description>Liquid Comment</description>
adamjohnson / google-apps-script-google-sheets-json-api.js
Created Jan 6, 2021
The code to get Google Apps Script to create a JSON API from a Google Spreadsheet (code from video: + comments).
View google-apps-script-google-sheets-json-api.js
// Script from:
function doGet (request) {
var query = request.parameter.q; // If you want to search for specific data, append ?q=my-string-to-search-for
var parameters = 2; // The number of columns in your spreadsheet.
var sheetname = 'Sheet1'; // TODO: Change this to the name of the sheet you want to target.
var doc = SpreadsheetApp.openById(PropertiesService.getScriptProperties().getProperty('key')); // NOTE: 'key' must be the same up here as it is down below in setup();
var sheet = doc.getSheetByName(sheetname);
var lastrow = sheet.getLastRow();
var rows = []; // The array we're going to push our data to.
adamjohnson / dot-join-with-newline-as-argument.js
Created Nov 30, 2020
Using the newline character with the .join() method in JavaScript to combine a string.
View dot-join-with-newline-as-argument.js
let myString = [
'<div class="container">',
'<h2>This is inserted via JS:</h2>',
'The .join() method can accept newline as an argument.',
'Much better than +!',
].join('\n'); // <-- 🎉
adamjohnson / profile_index.json
Created May 18, 2020
Use CleanSlateCMS to output JSON for a profile index template.
View profile_index.json
[<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 / google-calendar.html
Last active Mar 4, 2021
Pull events from a public Google Calendar using the Google Calendar API. Based off of:
View google-calendar.html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>Google Calendar API</title>
<div id="js-gcal-event">
<!-- SVG loader By Sam Herbert (@sherb). -->
adamjohnson /
Last active May 12, 2020
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 /
Last active Apr 7, 2021
A list of "You might not need jQuery" / helpful native API's & methods.

A well designed vanilla JS resource:

☝️ Can search via method name or the task you want to accomplish.

A great list of commonly used native JS methods and API's:

adamjohnson / rcomment.sublime-snippet
Created Sep 6, 2018
Sublime Text snippet to insert a Radius comment for CleanSlate.
View rcomment.sublime-snippet
<!-- Snippet to insert a radius comment for CleanSlate. -->
<!-- ${1: } -->
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<description>Insert an r:comment tag for CleanSlate</description>
adamjohnson / bracket.sublime-snippet
Created Nov 28, 2017
CSS Bracket Expander Sublime Text Snippet
View bracket.sublime-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 -->
<!-- -->
.${1:example} {
${2:Type a class then hit tab!}
} //.${1:example}
adamjohnson /
Last active Dec 11, 2020
My Sublime Text Packages

My Sublime Text 3 Packages

As of 12/11/2020

  • Align Tab
  • All Autocomplete
  • Better CoffeeScript
  • Bootstrap 4x Autocomplete
  • BracketHighlighter
  • Default File Type