Skip to content

Instantly share code, notes, and snippets.

View dleatherman's full-sized avatar
💭
🤘🏼

Dan Leatherman dleatherman

💭
🤘🏼
View GitHub Profile
@dleatherman
dleatherman / media:dark.code-snippets
Last active March 23, 2023 13:49
VSCode Snippet for Dark Mode Media Query
{
"Media Query Dark Mode": {
"prefix": "@media:dark",
"body": [
"@media (prefers-color-scheme: dark) {",
"\t$0",
"}"
],
"description": "Media Query Dark Mode"
}
@dleatherman
dleatherman / no-widows.liquid
Created November 1, 2021 17:04
This replaces last space with a non-breaking to prevent widows in text.
{% if content %}{% assign no_widows = content | split: '' | reverse | join: '' | replace_first: ' ', ';psbn&' | split: '' | reverse | join: '' %}{{ no_widows }}{% endif %}
/*
Example code showing how to add an item to
the cart in Shopify using the Fetch API.
The important line is where we add the
X-Requested-With header. Without that the
fetch call will fail with a bad request error.
*/
(function () {
// Set up all the buttons and forms we'll need to manipulate
const form = document.querySelector('form'),
dataWrapper = document.querySelector('.data-response');
// Make the API call, e is the form submit object
const getData = event => {
// this if statement allows us to call the action without submitting the form
@dleatherman
dleatherman / user_settings.json
Last active September 4, 2018 15:34
User Settings Visual Studio Code
{
"workbench.statusBar.feedback.visible": false,
"explorer.confirmDragAndDrop": false,
"workbench.colorTheme": "One Dark Pro",
"editor.fontFamily": "Fira Code, Source Code Pro, Menlo, monospace",
"editor.tabSize": 3,
"editor.renderWhitespace": "all",
"editor.wordWrap": "wordWrapColumn",
"editor.fontLigatures": true,
"editor.fontSize": 16,
@dleatherman
dleatherman / readme.md
Created July 27, 2017 15:18
Getting set up with a development Wordpress environment all from the command line
@dleatherman
dleatherman / gulpfile.js
Created July 14, 2017 18:04
Starter Wordpress Theme Gulpfile
var gulp = require('gulp');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var sourcemaps = require('gulp-sourcemaps');
var autoprefixer = require('gulp-autoprefixer');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var connect = require('gulp-connect-php');
var browserSync = require('browser-sync').create();

Tiny Content Framework

About the project

This is a tiny content strategy framework focused on goals, messages, and branding. This is not a checklist. Use what you need and scrap the rest. Rewrite it or add to it. These topics should help you get to the bottom of things with clients and other people you work with.

Contribute

There’s more to come, and I’d love to hear what you think. Give me feedback on Twitter (@nicoleslaw) or by email (nicole@nicolefenton.com). We all benefit from sharing our ideas and creating standards. Onward.

<figure class="op-tracker">
<iframe>
<script>
(function(i,s,o,g,r,a,m){i["GoogleAnalyticsObject"]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,"script","//www.google-analytics.com/analytics.js","ga");
ga("create", "UA-XXXXXXX-X", "auto");
ga("require", "displayfeatures");
$scope.syncSignups = function() {
var deferred = $q.defer();
// Use service to get all attendees for an event and prepare it for import into local API
var queries = [];
var results = EventbriteEvents.getEventAttendees({id: $scope.event.eventbrite_id, token: API_Token, status: 'attending'}).$promise.then(function(data) {
var totalPages = data.pagination.page_count;
var pageNumber = data.pagination.page_number;