Skip to content

Instantly share code, notes, and snippets.

@jdcauley
jdcauley / Post Grid
Created January 22, 2014 17:06
edit lib/content.php
<div class="col-md-3 post-grid">
<article <?php post_class(); ?>>
<header>
<a href="<?php the_permalink(); ?>">
<?php if (has_post_thumbnail()): ?>
<?php the_post_thumbnail('', array('class' => 'center img-responsive')); ?>
<?php else : ?>
<img class="center img-responsive" src="<?php echo get_template_directory_uri(); ?>/assets/img/placeholder.jpg">
<?php endif; ?>
</a>
@jdcauley
jdcauley / img.js
Created January 22, 2014 20:34
Random Image Load using jQuery
$(function() {
var images =['1.jpg', '2.jpg', '3.jpg', '4.jpg'];
$('#ai-bg').css({'background-image': 'url(assets/images/bg/' + images[Math.floor(Math.random() * images.length)] + ')'});
});
@jdcauley
jdcauley / gist:8689338
Created January 29, 2014 14:41
gulp-file
var gulp = require('gulp'),
sass = require('gulp-less');
gulp.task('less', function() {
gulp.src('assets-v2/less/app.less')
.pipe(gulp.dest('assets-v2/css/'));
});
gulp.task('default', function() {
gulp.run('less');
@jdcauley
jdcauley / Ref Errof
Created January 31, 2014 17:03
Error
ReferenceError: HTTPStatus is not defined
at ClientRequest.<anonymous> (/Users/jordancauley/projects/posted/api/controllers/FileController.js:55:34)
at ClientRequest.EventEmitter.emit (events.js:117:20)
at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1669:21)
at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:120:23)
at CleartextStream.socketOnData [as ondata] (http.js:1564:20)
at CleartextStream.read [as _read] (tls.js:502:12)
at CleartextStream.Readable.read (_stream_readable.js:320:10)
at EncryptedStream.write [as _write] (tls.js:366:25)
at doWrite (_stream_writable.js:219:10)
@jdcauley
jdcauley / gist:8984009
Created February 13, 2014 21:16
HomeController
module.exports = {
index: function (req,res) {
File.find( function foundFiles(err, files) {
if (err) return next(err);
// pass the array down to the /views/index.ejs page
res.view({
files: files
});
@jdcauley
jdcauley / app.css
Created February 17, 2014 15:49
Static lead area with 1 large and 2 small areas.
.featured-post{
color: @white;
position: relative;
height: auto;
float: right;
min-height: 225px;
max-height: 225px;
width: 50%;
background-size: cover;
background-position: center center;
@jdcauley
jdcauley / gist:9498154
Created March 12, 2014 00:28
Sails.js user of Populate
index: function(req, res){
User.findOne(req.user).populate('files').exec(function( err, fileuser){
console.log(err);
console.log(fileuser);
res.view({
user : fileuser
});
@jdcauley
jdcauley / responsive videos
Created March 13, 2014 19:42
responsive videos
.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px;
height: 0;
overflow: hidden;
}
.video-container iframe,
.video-container object,
@jdcauley
jdcauley / UserController.js
Created March 18, 2014 17:59
Update Controller
update: function(req, res){
},