Skip to content

Instantly share code, notes, and snippets.


Clark Nelson clarknelson

View GitHub Profile

Keybase proof

I hereby claim:

  • I am clarknelson on github.
  • I am clarknelson ( on keybase.
  • I have a public key ASCeg0Tl_J_UPDmaMJWfb4A4yU0hsyDXLhzmNvBR3U7y4Ao

To claim this, I am signing this object:

View gist:67b08e99e858580477ba8da0ae304d99
Some notes here~
{% if relatedArticlesSelect | length == 3 %}
{% set relatedArticles = entry.relatedArticlesSelect.limit(3).all() %}
is the same as
{% set relatedArticlesSelect = entry.relatedArticlesSelect.all() %}
if you know there are only going to be three elements. dot all will fetch all of the elements attached
View example.js
var one = ['a', 'b', 'c'];
var two = ['x', 'y'];
var three = [];
var answer = ['ax', 'ay', 'bx', 'by', 'cx', 'cy'];
clarknelson / reorder-on-resize.js
Created Dec 1, 2017
Reorder elements after a certain breakpoint
View reorder-on-resize.js
cmap.footer = {};
cmap.footer.checkForLayoutChange = function(){
var $footer = $('#footer'), $row = $footer.find('.row');
var $jump = $footer.find('.footer-jump-to-top');
var $pages = $footer.find('.footer-page-links');
var $social = $footer.find('.footer-social-links');
function clean(){
View a.js
var $foo = $(this);
View example.js
// store the element for later
// element === '<div>$9.99 USD/month</div>'
var $el = $(element);
var newText = $el.text().replace('/\/month/', '<span>/month</span>');
// set the element to use the next text
View arduino.cpp
#include <Adafruit_NeoPixel.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_LSM9DS0.h>
const float Pi = 3.14159;
Adafruit_LSM9DS0 lsm = Adafruit_LSM9DS0(1000);
#define BUTTON_PIN 10

Everything, all the way up to html is pushed down to here:

Overflow is located in a <g> element with clip-path:!

Here is what it looks like in Illustrator, it's clipped using a rectangle. You can check the generated svg in the previous img:

Shifts even position: fixed elements down, like my nav:

clarknelson / create.js
Created Mar 9, 2017
svg header alignment
View create.js
var $text = this.figure.children().first();
var fontSize = Math.round(Number.parseInt($text.css('font-size')));
var text = this.canvas.text(0, 0, $text.text());
this._elements = [text];;
View assign4.lex
*--- ---*
*--- assign4.lex ---*
*--- ---*
*--- This file defines the LEX-style tokenizer for the language ---*
*--- at the bottom of page 173 of Fischer, Cytron, LeBlanc "Crafting ---*
*--- a Compiler" Addison-Wesley, 2010. ---*
*--- ---*