This file contains 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
// npm install --save-dev grunt grunt-sass grunt-autoprefixer grunt-contrib-watch load-grunt-tasks | |
module.exports = function(grunt){ | |
require('load-grunt-tasks')(grunt); // npm install --save-dev load-grunt-tasks | |
grunt.initConfig({ | |
sass: { |
This file contains 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
#!/usr/bin/env python | |
# Git clone all my gists | |
import json | |
import urllib | |
from urllib import urlopen | |
from subprocess import call | |
import os |
This file contains 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($) { | |
var o = $({}); | |
$.subscribe = function() { | |
o.on.apply(o, arguments); | |
}; | |
$.unsubscribe = function() { | |
o.off.apply(o, arguments); |
This file contains 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
""" | |
Django settings for <project> project. | |
With Grappelli. | |
https://docs.djangoproject.com/en/1.7/topics/settings/ | |
https://docs.djangoproject.com/en/1.7/ref/settings/ | |
""" | |
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
This file contains 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
* | |
box-sizing: border-box | |
h1 | |
font-size: 2em | |
margin: .67em 0 | |
article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary | |
display: block | |
audio, canvas, video |
This file contains 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
=breakpoint($point) | |
@if #{$point} == "huge" | |
@media (min-width: 1200px) | |
@content | |
@else if #{$point} == "large" | |
@media (min-width: 800px) | |
@content | |
@else if #{$point} == "medium" |
This file contains 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() { | |
$('a[href*=#]:not([href=#])').click(function() { | |
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { | |
var target = $(this.hash); | |
target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); | |
if (target.length) { | |
$('html,body').animate({ | |
scrollTop: target.offset().top | |
}, 1000); | |
return false; |
This file contains 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
<?php | |
add_action('wp_ajax_myajaxfunctionname', 'ajax_myajaxfunctionname'); | |
add_action('wp_ajax_nopriv_myajaxfunctionname', 'ajax_myajaxfunctionname'); | |
function ajax_myajaxfunctionname(){ | |
$var = $_POST['var']; | |
if( ! isset($var) ) die(1); | |
This file contains 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
<?php | |
$imageID = get_field('image_field_name'); // set this field to return Image ID | |
$size = 'full'; // thumbnail, medium, large, full | |
$img = wp_get_attachment_image_src( $imageID, $size ); | |
if( !empty($image) ): | |
$url = $img[0]; | |
$width = $img[1]; |
This file contains 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
/* have to use intrinsic ratio: http://alistapart.com/article/creating-intrinsic-ratios-for-video */ | |
.svg-container { | |
width: 100%; | |
display: block; | |
height: auto; | |
position: relative; | |
padding-top: 100%; // ratio: w/h*100 | |
} |
OlderNewer