Skip to content

Instantly share code, notes, and snippets.

Nate Eagle neagle

Block or report user

Report or block neagle

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@neagle
neagle / index.js
Last active Feb 8, 2016
requirebin sketch
View index.js
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var mongoose = require('mongoose');
var _ = require('lodash');
// Set up a Schema with some required elements, and a field with an array
var ThingSchema = new mongoose.Schema({
name: {
type: String,
required: true
View .vimrc
" _
" ___ __ _ __ _| | ___
" / _ \/ _` |/ _` | |/ _ \
"| __/ (_| | (_| | | __/
" \___|\__,_|\__, |_|\___|
" |___/
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => General
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@neagle
neagle / build.js
Last active Jan 12, 2016
A simple custom Grunt task to build a group of targets for a task based on a prefix. This allows for easy grouping, based on namespace.
View build.js
/**
* Build a group of targets based on a prefix
*
* Ex: grunt build:less:debug
*
* This would run all less targets that begin with "debug_":
* debug_web
* debug_sidebar
* debug_self_help
* debug_self_help_theme
View gist:7bf2ecffe0a223ac2c4b
// Totally intolerable
var express = require('express')
, routes = require('./routes')
, http = require('http');
// Better
var express = require('express'),
routes = require('./routes'),
http = require('http');
View gist:9210964
================================================================================
Error executing action `start` on resource 'service[postfix]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of /sbin/service postfix start ----
STDOUT: Starting postfix: [FAILED]
View gist:9210747
================================================================================
Error executing action `upgrade` on resource 'yum_package[php-mysql]'
================================================================================
Chef::Exceptions::Exec
----------------------
returned 1, expected 0
@neagle
neagle / prevent-orphans
Created Nov 15, 2012
Prevent Orphans in Text with Jekyll (Liquid)
View prevent-orphans
<h2><a class="title" href="{{ post.url }}">
{% assign titleWords = post.title | split:&nbsp; %}
{% for word in titleWords %}{% if forloop.last %}&nbsp;{% else %} {% endif %}{{ word }}{% endfor %}
</a></h2>
View gist:2789974
define([], function () {
var Wiser = window.Wiser || {};
if (typeof Wiser === 'object') {
Wiser.utils = Wiser.utils || {};
if (typeof Wiser.utils === 'object') {
/* WiserTogether Utility Functions
*
*/
@neagle
neagle / Array.prototype.indexOf()
Created Feb 27, 2012
Shim for Array.prototype.indexOf()
View Array.prototype.indexOf()
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function(obj, start) {
    for (var i = (start || 0), j = this.length; i < j; i++) {
        if (this[i] === obj) { return i; }
      }
      return -1;
}
}
You can’t perform that action at this time.