Instantly share code, notes, and snippets.
Nate Eagle neagle
I'm a front-end developer, go player, and father.
-
greymatter.io
- Washington, DC
- 21:43
- https://nateeagle.com
- @neagle
neagle
/ visualizer.js
Last active
| #!/usr/bin/env node |
| var convert = require('color-convert'); |
| var OPC = new require('../fadecandy/examples/node/opc') |
| var client = new OPC('localhost', 7890); |
| // This is set in the CAVA config file |
| const bars = 100; |
| const frame = []; |
neagle
/ cava_ascii_output_parser.js
Created
This is just a quick example of how to use the raw ASCII output from CAVA in an application
| // A minimal set of NodeJS code for parsing incoming ASCII data from CAVA and turning it into useful data. |
| // This code would need to have cava's output piped to it: |
| // Ex: $ cava -p ~/.config/cava/raw | node cava_ascii_output_parser.js |
| process.stdin.setEncoding('utf8'); |
| let str = ''; |
| process.stdin.on('readable', () => { |
| let chunk; |
| // 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 |
| " _ |
| " ___ __ _ __ _| | ___ |
| " / _ \/ _` |/ _` | |/ _ \ |
| "| __/ (_| | (_| | | __/ |
| " \___|\__,_|\__, |_|\___| |
| " |___/ |
| """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
| " => General |
| """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
| /** |
| * 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 |
| // Totally intolerable |
| var express = require('express') |
| , routes = require('./routes') |
| , http = require('http'); |
| // Better |
| var express = require('express'), |
| routes = require('./routes'), |
| http = require('http'); |
neagle
/ gist:9210964
Created
| ================================================================================ |
| 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] |
neagle
/ gist:9210747
Created
| ================================================================================ |
| Error executing action `upgrade` on resource 'yum_package[php-mysql]' |
| ================================================================================ |
| Chef::Exceptions::Exec |
| ---------------------- |
| returned 1, expected 0 |
| <h2><a class="title" href="{{ post.url }}"> |
| {% assign titleWords = post.title | split: %} |
| {% for word in titleWords %}{% if forloop.last %} {% else %} {% endif %}{{ word }}{% endfor %} |
| </a></h2> |
neagle
/ gist:2789974
Created
| define([], function () { |
| var Wiser = window.Wiser || {}; |
| if (typeof Wiser === 'object') { |
| Wiser.utils = Wiser.utils || {}; |
| if (typeof Wiser.utils === 'object') { |
| /* WiserTogether Utility Functions |
| * |
| */ |
NewerOlder
