Skip to content

Instantly share code, notes, and snippets.

View jephjohnson's full-sized avatar

Jeph Johnson jephjohnson

View GitHub Profile
@jephjohnson
jephjohnson / Function for creating ordered list on the fly
Created June 4, 2012 22:28
Get the words from a string in multiple divs using a for loop with jQuery or regular expression
$(function() {
$("#d0, #d1, #d2").each(function() {
var text = $(this).text();
var textArr = text.split("*");
$(this).html("<ul></ul>");
for(var i = 0; i < textArr.length; i++) {
$(this).find("ul").append('<li><a>' + textArr[i] + '</a></li>');
};
});
});
{
"data": [
{
"id": "1",
"type": "posts",
"attributes": {
"title": "First post"
},
"relationships": {
"comments": {
@jephjohnson
jephjohnson / px-rem-cheat-sheet.css
Created January 9, 2018 16:06 — forked from glueckpress/px-rem-cheat-sheet.css
Cheat sheet for rem-calculations based upon 14px and 16px.
/*! = $rembase: 14px
--------------------------------------------------------------
* hmtl { font-size: 87.5%; }
* body { font-size: 14px; font-size: 1rem; line-height: 1; }
* 4px 0.28571429rem
* 8px 0.571428571rem
* 12px 0.857142857rem
* 13px 0.928571429rem
* 14px 1rem
* 16px 1.142857143rem