This is a simple shell script that is designed to provision both nginx and node on your machine. I primarily wrote it for use with Vagrant and an example Vagrantfile
is included in the Gist as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Responsive Design Testing</title> | |
<style> | |
body { margin: 20px; font-family: sans-serif; overflow-x: scroll; } | |
.wrapper { width: 6000px; } | |
.frame { float: left; } | |
h2 { margin: 0 0 5px 0; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "compass"; | |
.mega-header h1 { | |
font-size: $h3-size; | |
margin-bottom: $half-spacing-unit; | |
@include media-query(500px) { | |
font-size:$bigger; | |
} | |
@include media-query(700px) { | |
font-size:$h2-size; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Border meetings with border-box */ | |
.border-box { | |
box-sizing: border-box; | |
width: 200px; | |
height: 200px; | |
background-color: #ccc; | |
border-right: 5px solid black; | |
border-bottom: 10px solid green; | |
margin-bottom:10px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="article-meta"> | |
<ul> | |
<li><time>{{ page.date | date: "%m/%d/%Y" }}</time></li> | |
<li><a href="http://twitter.com/share?url=http://{{site.url}}{{page.url}}&text={{page.title}} via @markmichon">Tweet<a/></li> | |
<li><a href="http://www.facebook.com/sharer.php?u=http://{{site.url}}{{ page.url }}&t={{page.title}}">Share on Facebook</a></li> | |
<!-- <li>Reading time: {{ content | count_minutes }}</li> | |
</ul> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="logo"> | |
<div class="pencil"></div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
type: 'POST', | |
url: 'http://kyleschaeffer.com/feed/', | |
data: { postVar1: 'theValue1', postVar2: 'theValue2' }, | |
beforeSend:function(){ | |
// this is where we append a loading image | |
$('#ajax-panel').html('<div class="loading"><img src="/images/loading.gif" alt="Loading..." /></div>'); | |
}, | |
success:function(data){ | |
// successful request; do something with the data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"USD": { | |
"symbol": "$", | |
"name": "US Dollar", | |
"symbol_native": "$", | |
"decimal_digits": 2, | |
"rounding": 0, | |
"code": "USD", | |
"name_plural": "US dollars" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gulp = require('gulp') | |
const sass = require('gulp-sass') | |
const browserSync = require('browser-sync').create() | |
const reload = browserSync.reload | |
gulp.task('sass', ()=> { | |
return gulp.src('scss/main.scss') | |
.pipe(sass().on('error', sass.logError)) | |
.pipe(gulp.dest('css')) | |
.pipe(reload({stream: true})) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function applyToKeys(obj, modify) { | |
let newObj = {} | |
for (let [key, value] of Object.entries(obj)) { | |
if (typeof value === 'object') { | |
newObj[key] = applyToKeys(obj[key], modify) | |
} else { | |
newObj[key] = modify(value) | |
} | |
} | |
return newObj |