Skip to content

Instantly share code, notes, and snippets.

View markmichon's full-sized avatar

Mark Michon markmichon

View GitHub Profile
<!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; }
@markmichon
markmichon / style.scss
Created March 9, 2013 07:31
A CodePen by Mark Michon.
@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;
}
@markmichon
markmichon / dabblet.css
Created March 31, 2013 22:41
Border meetings with border-box
/* 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;
@markmichon
markmichon / metadata.html
Created May 20, 2013 15:15
Metadata element for jekyll blog
<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}}&amp;text={{page.title}} via @markmichon">Tweet<a/></li>
<li><a href="http://www.facebook.com/sharer.php?u=http://{{site.url}}{{ page.url }}&amp;t={{page.title}}">Share on Facebook</a></li>
<!-- <li>Reading time: {{ content | count_minutes }}</li>
</ul>
</div>
@markmichon
markmichon / index.html
Created May 28, 2013 19:07
A CodePen by Mark Michon. Rotated Squares
<div class="logo">
<div class="pencil"></div>
</div>
$.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
@markmichon
markmichon / README.md
Created March 13, 2016 14:38 — forked from DamonOehlman/README.md
Provisioning of node + nginx designed for use with vagrant shell provisioner. No need for chef, puppet.

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.

@markmichon
markmichon / Common-Currency.json
Created January 1, 2018 22:33 — forked from ksafranski/Common-Currency.json
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@markmichon
markmichon / gulpfile.js
Created July 3, 2018 16:54
Example gulpfile with browsersync and gulp-sass
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}))
@markmichon
markmichon / applyToKeys.js
Last active August 20, 2019 15:48
Modify values in an object recursively
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