Skip to content

Instantly share code, notes, and snippets.

View jackmcpickle's full-sized avatar

Jack McNicol jackmcpickle

View GitHub Profile
@jackmcpickle
jackmcpickle / input.scss
Created January 4, 2021 22:41
Generated by SassMeister.com.
@import "include-media";
@mixin screen-media($query) {
@include media('screen', $query) {
@content
}
}
@include screen-media('>desktop') {
@jackmcpickle
jackmcpickle / input.scss
Last active December 19, 2020 22:47
Playing with orientation in include-media - Generated by SassMeister.com.
@import "include-media";
.thing {
@include media( '>phone', 'landscape') {
padding: 0 1.5em;
}
@include media( '>phone', 'portrait' ) {
padding: 2em 3em 1em 3em;
}
}
@jackmcpickle
jackmcpickle / .inputrc
Created March 16, 2020 23:03
My inputrc config
# Make Tab autocomplete regardless of filename case
set completion-ignore-case on
# List all matches in case multiple possible completions are possible
set show-all-if-ambiguous on
# Immediately add a trailing slash when autocompleting symlinks to directories
set mark-symlinked-directories on
# Use the text that has already been typed as the prefix for searching through

Keybase proof

I hereby claim:

  • I am jackmcpickle on github.
  • I am jackmcpickle (https://keybase.io/jackmcpickle) on keybase.
  • I have a public key ASA6l_H5wRrcj_wNXT9I9lGKy80urTP9usBAcZMIFCXjLwo

To claim this, I am signing this object:

{
init: function(elevators, floors) {
this.elevator = elevators[0]; // Let's use the first elevator
this.setupListeners(floors)
},
update: function(dt, elevators, floors) {
this.checkIndicators()
@jackmcpickle
jackmcpickle / attach_to_post.php
Created March 18, 2018 06:02
attach media that was uploaded in post as thumbnails
<?php
add_action('init', 'update_business_thumbnails');
function update_business_thumbnails()
{
if (!isset($_GET['update_thumbnails'])) return ;
$args = [
'post_type' => 'attachment',
@jackmcpickle
jackmcpickle / scrollSpy.ts
Created October 17, 2017 23:36
an working but buggy attempt at using IntersectionObserver to scrollSpy
import throttle from 'lodash/throttle';
import map from 'lodash/map';
class ScrollSpy
{
$targets: Element[];
$navItems: JQuery<HTMLElement>;
observer: IntersectionObserver;
threshold: number;
activeClass: string;
@jackmcpickle
jackmcpickle / .sass-lint.yml
Created May 17, 2016 02:19
My Sass Lint config
files:
include: '**/*.scss'
options:
formatter: stylish
merge-default-rules: falserailing-semicolon
rules:
bem-depth:
- 0
- max-depth: 1
border-zero:
@jackmcpickle
jackmcpickle / email-validation.js
Created April 27, 2016 05:32
Ajax Email validation
var $contactForm = $('#contactForm'),
$submitButton = $('#submitForm'),
$message = $('.js-error-messages'),
$honeypot = $('.js-honey'),
$emailField = $('.js-email-field');
var resetButton = function(timeout) {
setTimeout(function() {
$submitButton.text('Send').prop('disabled', false);
}, timeout);
@jackmcpickle
jackmcpickle / Dockerfile
Last active July 24, 2019 19:22
Our Craft CMS docker-compose dev setup
FROM sealink/craftdocker:2.6.2791
# install plugins
COPY composer.json /app/
COPY composer-post-install /app/
COPY vendor /app/vendor
RUN composer install
# node packages
COPY package.json /app/