Skip to content

Instantly share code, notes, and snippets.

@craigmdennis
craigmdennis / policy.json
Created April 5, 2016 01:13
Whitelist IPs for S3
{
"Version": "2008-10-17",
"Id": "S3PolicyId1",
"Statement": [
{
"Sid": "IPAllow",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
@craigmdennis
craigmdennis / config.json
Last active April 4, 2016 12:28
Gulp Starter config file for using with Middleman as an external pipeline
{
"root": {
"src": "./source",
"dest": "./.tmp"
},
"tasks": {
"browserSync": {
"proxy": "http://localhost:4567",
"reloadDelay" : 2000
@craigmdennis
craigmdennis / public.json
Created April 1, 2016 21:41
Public AWS S3 bucket policy for static sites
{
"Version":"2008-10-17",
"Statement":[{
"Sid":"AllowPublicRead",
"Effect":"Allow",
"Principal": {
"AWS": "*"
},
"Action":["s3:GetObject"],
"Resource":["arn:aws:s3:::your-bucket-name/*"
@craigmdennis
craigmdennis / SassMeister-input.scss
Created November 4, 2015 13:02
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$tablet: 'min-width 48em';
$upto-desktop: max-width 61.9375em;
.some-class {
length: length( $tablet );
length: length( $upto-desktop );
@craigmdennis
craigmdennis / SassMeister-input.scss
Last active October 30, 2015 17:44
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$tablet: 'min-width: 48em';
$desktop: 'min-width: 62em';
$upto-desktop: 'max-width: 61.9375em';
@mixin media( $breakpoint ) {
@media screen and ( #{$breakpoint} ) {
@craigmdennis
craigmdennis / buttons.scss
Created May 11, 2015 06:04
Generate buttons from a map and two mixins
$btndarken: 5%;
// ("classname",
// background-color, color, border,
// :hover background-color, :hover color, :hover border)
// Each classname will be .btn.#{classsname}
$buttons: (
("-default",
$white, $cape-cod, $alto),
@craigmdennis
craigmdennis / _mixin_loop.jade
Created April 21, 2015 21:03
Simple looping mixin for JADE
mixin loop( count )
- var n = 0
while n < count
block
- n++
// Usage
+loop(4)
p Hello world!
@craigmdennis
craigmdennis / SassMeister-input.scss
Last active August 29, 2015 14:19
Roll your own grid
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
$bp: (
snoop: 320px,
eminem: 30em,
diddy: 37.5rem,
dre: 768px,
@craigmdennis
craigmdennis / no-touch.scss
Created April 5, 2015 23:14
Add hover events just for devices without touch capabilities
// .no-touch should be applied to the `html` or `body` elements with Modernizr or other script.
@mixin hover {
.no-touch & {
&:hover {
@content;
}
}
}
@craigmdennis
craigmdennis / SassMeister-input.scss
Last active August 29, 2015 14:17
Generated by SassMeister.com.
// Round $n to the nearest $m
@function roundUp($n, $m) {
@return round(($n/$m))*$m;
}
// Get unitless values
@function parseInt($n) {
@return $n / ($n * 0 + 1);
}