Skip to content

Instantly share code, notes, and snippets.

View justinhough's full-sized avatar
📙
Writing, drinking coffee and debugging code that I probably wrote.

Justin Hough justinhough

📙
Writing, drinking coffee and debugging code that I probably wrote.
View GitHub Profile
@justinhough
justinhough / SassMeister-input-HTML.html
Last active August 29, 2015 14:27
Generated by SassMeister.com.
<div id="chocolate" class="page-section pad-section">
<div class="page-content">
<h1>Heading to Section</h1>
<h2>Subheading of Section</h2>
</div>
</div>
<div id="hotpink" class="page-section angled-section">
<div class="page-content">
<h1>Heading to Section</h1>
<h2>Subheading of Section</h2>
@justinhough
justinhough / increment.css
Created October 11, 2015 06:13
Counter Increment
//A way to number sections and sub-sections with "Section 1", "1.1", "1.2", etc.:
body {
counter-reset:section;
}
h1 {
counter-reset:subsection;
}
h1:before {
@justinhough
justinhough / SassMeister-input-HTML.html
Created October 11, 2015 06:19
Generated by SassMeister.com.
<ul>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
</ul>
<ol>
<li>item</li>
@justinhough
justinhough / directory-listing.php
Created October 11, 2015 06:21
PHP Directory Listing
<?php
foreach (glob("*.txt") as $filename) {
echo "$filename size " . filesize($filename) . "\n";
}
preg_grep('#\.zip$#', glob('/dir/somewhere/*'), PREG_GREP_INVERT)
// http://cowburn.info/2010/04/30/glob-patterns/
if (fnmatch("*gr[ae]y", $color)) {
@justinhough
justinhough / BEM_example_1.html
Created December 21, 2015 20:48
BEM Example
<div class="card">
<div class="card__header">
<h2 class="card__title">Title text here</h2>
</div>
<div class="card__body">
<img class="card__img" src="some-img.png">
@justinhough
justinhough / SassMeister-input.scss
Last active May 17, 2016 02:58
Generated by SassMeister.com.
// ----
// libsass (v3.3.6)
// ----
$colors: (
lightblue: lightblue,
blue: blue,
black: #000000,
white: #ffffff
);
@justinhough
justinhough / base.html
Created July 18, 2016 21:01
Clean and Optimized HTML page
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Page Title</title>
<!-- Description of the page (limit to 150 characters) -->
@justinhough
justinhough / shopify-tags.js
Created May 11, 2017 05:17
Shopify tags rewritten from groups in the tags
const tags = {};
// const initialTags = "color_brown color_black type_dress-shoes type_shoes";
{% if collection.all_tags.size > 0 %}
const initialTags = {{ collection.all_tags | split: ' ' }};
{% endif %}
// console.log(array);
const splitTags = initialTags.split(" ");
@justinhough
justinhough / classes.txt
Last active October 27, 2017 22:54
Add classes to markdown images
![Alt text](path_to_image.png "Title text"){: .class-name }
@justinhough
justinhough / gist:4e58fdd928b47373db35a0fe906f1b72
Created October 29, 2017 04:21
Fix issue with valet constantly asking for password in CLI
sudo chown -R $(whoami) ~/.valet