Skip to content

Instantly share code, notes, and snippets.

View gist:8689338
var gulp = require('gulp'),
sass = require('gulp-less');
gulp.task('less', function() {
gulp.task('default', function() {'less');
View Ref Errof
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 [as _read] (tls.js:502:12)
at (_stream_readable.js:320:10)
at EncryptedStream.write [as _write] (tls.js:366:25)
at doWrite (_stream_writable.js:219:10)
View gist:8984009
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
files: files
jdcauley / app.css
Created Feb 17, 2014
Static lead area with 1 large and 2 small areas.
View app.css
color: @white;
position: relative;
height: auto;
float: right;
min-height: 225px;
max-height: 225px;
width: 50%;
background-size: cover;
background-position: center center;
jdcauley / gist:9498154
Created Mar 12, 2014
Sails.js user of Populate
View gist:9498154
index: function(req, res){
User.findOne(req.user).populate('files').exec(function( err, fileuser){
user : fileuser
View responsive videos
.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px;
height: 0;
overflow: hidden;
.video-container iframe,
.video-container object,
View UserController.js
update: function(req, res){
jdcauley / excerpt.php
Last active Aug 29, 2015
Variable WP Excerpt Lengths
View excerpt.php
function excerpt($limit) {
$excerpt = explode(' ', get_the_excerpt(), $limit);
if (count($excerpt)>=$limit) {
$excerpt = implode(" ",$excerpt).'...';
} else {
$excerpt = implode(" ",$excerpt);
$excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt);
return $excerpt;
jdcauley / the_post_thumbnail
Created Mar 26, 2014
WP Post Thumb in one line
View the_post_thumbnail
<?php if (has_post_thumbnail()): the_post_thumbnail('', array('class' => 'img-responsive')); endif; ?>
View untitled
* MailController.js
* @description ::
* @docs ::!documentation/controllers
var async = require('async');
var nodemailer = require('nodemailer');
var smtpTransport = nodemailer.createTransport("SMTP",{
service: "Mandrill",