Skip to content

Instantly share code, notes, and snippets.

Seth Warburton nternetinspired

Block or report user

Report or block nternetinspired

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Twig truncate macro
{% macro truncate(text, limit, append) %}
{# settings #}
{% set suffix = append|default('...') %}
{% set punctuation = ['.',',','-',':',';'] %}
{# logic #}
{% set array = text|split(' ') %}
{% set arrayTruncated = array|slice(0, limit) %}
{% set string = arrayTruncated|join(' ') %}
{% if limit and array|length > limit %}
{% for mark in punctuation %}
View editor-styles.css
.type.storage,.type.storage.declaration, .storage.class.modifier {
font-family: 'Gloria Hallelujah';
font-size: 1.7em;
}
.type.storage.arrow.function {
font-family: 'Fira Code'
}
.decorator.name, .decorator.punctuation:not(.block), .import.keyword {
@nternetinspired
nternetinspired / GDPR.md
Created Jun 8, 2018 — forked from malarkey/GDPR.md
(Data) Protection Racket
View GDPR.md
View bullet-bullshit.css
ul > li {
list-style-type: none; // Hide the real bullets
position: relative;
}
// Replace the hidden bullets with inserted bullets. Because CSS.
ul > li::before {
color: #bada55;
content: '';
display: inline-block;
@nternetinspired
nternetinspired / _lazyFocusImager.twig
Last active Sep 20, 2017 — forked from hendrikeng/_lazyFocusImager.twig
Twig/Craft macro for lazy responsive images/bgimages with Imager and Focuspoint
View _lazyFocusImager.twig
{#
// lazyLoaded Image/bgImages, optimized with Imager and Focuspoint
---------------------------------------------------------------------------
https://github.com/aelvan/Imager-Craft
https://github.com/smcyr/Craft-FocusPoint
for the bgImage intrinsic ratio classname creation check:
https://github.com/inuitcss/inuitcss/blob/develop/objects/_objects.ratio.scss (modified in this revision to use a utility class prefix, , e.g; .u_ratio. @nternetinspired)
https://github.com/constancecchen/object-fit-polyfill
View How To Disable Strict SQL Mode in MySQL 5.7.MD

How To Disable Strict SQL Mode in MySQL 5.7

I wrote a quick script for those that provision servers often enough.

To get this to work take the following steps

  1. Log into your server as root
  2. Get script wget https://gist.githubusercontent.com/nfourtythree/90fb8ef5eeafdf478f522720314c60bd/raw/disable-strict-mode.sh
  3. Make is executable chmod +x disable-strict-mode.sh
  4. Run the script ./disable-strict-mode.sh
@nternetinspired
nternetinspired / output-articles-by-collection.liquid
Last active Jun 10, 2019
Loop through Jekyll collections and output their content as sections and articles
View output-articles-by-collection.liquid
{% comment %}
Loops though every collection you defined in _config.yml and grabs the pages they contain; outputting title and full text with good basic html semantics.
Use page.excerpt instead of page.content to grab the first paragraph, blog list style. Markdownify is optional, depends how you authored content in your collections; I typically use Markdown.
{% endcomment % }
{% for collection in site.collections %}
{% assign name = collection.label %}
<section>
@nternetinspired
nternetinspired / responsive-roots.scss
Created Oct 1, 2015
Setting the root font-size in % ensures device-specific sizing is not overruled.
View responsive-roots.scss
html {
font-size: 100%;
@include mq($min, $sm) {
font-size: 106.3%; // 17px if the root was 16px
}
@include mq($min, $md) {
font-size: 112.5%; // 18px if the root was 16px
View high-dpi-media.css
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
View SassMeister-input-HTML.html
<div class="background">
<img class="center background-image" src="http://placehold.it/600x400">
</div>
You can’t perform that action at this time.