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.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 / 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 / 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 / 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 / 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
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 / SassMeister-input-HTML.html
Created July 28, 2015 15:32
Generated by SassMeister.com.
<div class="grid-50">
<div id="book-design" class="image-right-after">
<h1>Testing</h1>
<p>testing the text testing the text testing the text testing the text testing the text testing the text testing the text testing the text testing the text testing the text </p>
<p><a href="#">button</a></p>
</div>
</div>
<div class="grid-50">
<div id="book-design-2" class="image-left-after">
@justinhough
justinhough / upstream.sh
Created July 7, 2015 16:10
Update Forked Repository with Bash
#!/bin/bash
git fetch upstream
git checkout master
git merge upstream/master
git merge upstream/master
# If your upstream branch is already setup using
# https://help.github.com/articles/configuring-a-remote-for-a-fork/
# then you can run this simple shell script to update your fork quickly and easily.
# RUN: $ bash upstream.sh
@justinhough
justinhough / blur-backgrounds.css
Created July 4, 2015 05:01
Simple JavaScript Blur Effect on for Backgrounds
html, body {
height: 100%;
margin: 0;
padding: 0;
width: 100%;
}
.wrapper {
overflow-x: hidden;
height: 100%;
}
@justinhough
justinhough / parallax-backgrounds.js
Last active August 29, 2015 14:23
Simple parallax effect for backgrounds
<div class="section-parallax background-one">
<div class="block">
<h2>Section Title</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer placerat ante in magna venenatis, non tempus nunc pharetra. Etiam interdum gravida urna, quis eleifend urna ornare eget. Aenean vehicula mi sit amet lectus gravida vehicula. Ut et lacinia neque.</p>
</div>
</div>
<div class="section-parallax background-two">
<div class="block">
<h2>Section Title</h2>