Skip to content

Instantly share code, notes, and snippets.

View clarknelson's full-sized avatar
🏅

Clark Nelson clarknelson

🏅
View GitHub Profile
@clarknelson
clarknelson / keybase.md
Created October 12, 2020 15:56
keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

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
var one = ['a', 'b', 'c'];
var two = ['x', 'y'];
var three = [];
var answer = ['ax', 'ay', 'bx', 'by', 'cx', 'cy'];
@clarknelson
clarknelson / reorder-on-resize.js
Created December 1, 2017 03:55
Reorder elements after a certain breakpoint
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(){
$jump.remove();
$('a').each(function(){
var $foo = $(this);
});
// store the element for later
// element === '<div>$9.99 USD/month</div>'
var $el = $(element);
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace
// http://regexr.com/3h2rl
var newText = $el.text().replace('/\/month/', '<span>/month</span>');
// set the element to use the next text
$el.text(newText);
#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: https://clarknelson.com/drop/Screen-Shot-2017-08-08-20-10-35.png

Overflow is located in a <g> element with clip-path: https://clarknelson.com/drop/Screen-Shot-2017-08-08-19-56-57.png!

Here is what it looks like in Illustrator, it's clipped using a rectangle. You can check the generated svg in the previous img: https://clarknelson.com/drop/Screen-Shot-2017-08-08-19-59-12.png

Shifts even position: fixed elements down, like my nav: https://clarknelson.com/drop/Screen-Shot-2017-08-08-20-00-32.png

@clarknelson
clarknelson / create.js
Created March 9, 2017 23:39
svg header alignment
create(){
this.beforeCreate();
var $text = this.figure.children().first();
$text.addClass('hidden');
var fontSize = Math.round(Number.parseInt($text.css('font-size')));
var text = this.canvas.text(0, 0, $text.text());
this._elements = [text];
this.group.add(text);
%{
/*-------------------------------------------------------------------------*
*--- ---*
*--- 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. ---*
*--- ---*