Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeph Johnson jephjohnson

View GitHub Profile
@jephjohnson
jephjohnson / px-rem-cheat-sheet.css
Created Jan 9, 2018 — forked from glueckpress/px-rem-cheat-sheet.css
Cheat sheet for rem-calculations based upon 14px and 16px.
View px-rem-cheat-sheet.css
/*! = $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
View owl-carousel
View posts.json
{
"data": [
{
"id": "1",
"type": "posts",
"attributes": {
"title": "First post"
},
"relationships": {
"comments": {
@jephjohnson
jephjohnson / Function for creating ordered list on the fly
Created Jun 4, 2012
Get the words from a string in multiple divs using a for loop with jQuery or regular expression
View Function for creating ordered list on the fly
$(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>');
};
});
});