Skip to content

Instantly share code, notes, and snippets.

@cowboy
cowboy / Gruntfile.js
Last active December 9, 2015 22:38
grunt 0.4 file.expandMapping and templates
module.exports = function(grunt) {
grunt.initConfig({
stuff: {
dest: 'foo/',
ext: '.bar',
},
log_files: {
my_target: {
files: grunt.file.expandMapping('**/*.js', '<%= stuff.dest %>', {
{ npm_config_save_dev: '',
npm_config_viewer: 'man',
npm_config_browser: '',
npm_config_rollback: 'true',
TERM_PROGRAM: 'iTerm.app',
npm_config_usage: '',
npm_config_globalignorefile: '/Users/cowboy/.nave/installed/0.8.11/etc/npmignore',
TERM: 'xterm-256color',
SHELL: '/bin/bash',
npm_config_shell: '/bin/bash',
@cowboy
cowboy / Cowboy-Enchantrix-to-Auctionator.lua
Created November 29, 2012 20:41
WoW: "Import" Enchantrix DE values into Auctionator
-- "Import" Enchantrix DE values into Auctionator - v0.1.0 - 2012-11-29
-- by "Cowboy" Ben Alman
--
-- Requires Auctionator and Enchantrix to be installed
-- (after generation you may uninstall Enchantrix)
--
-- Run this script in something like _DevPad and add the generated code
-- to the very end of AuctionatorHints.lua
local baseDisenchantTable = Enchantrix.Constants.baseDisenchantTable
@cowboy
cowboy / Cowboy - Presentation.tmTheme
Created November 29, 2012 19:55
Sublime / TM theme I use for presentations.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Jacob Rus</string>
<key>comment</key>
<string>Created by Jacob Rus. Based on ‘Slate’ by Wilson Miner</string>
<key>name</key>
<string>Cowboy - Presentation</string>
@cowboy
cowboy / log.js
Created November 15, 2012 20:06
JavaScript: log= (insanity?)
/*
* log= (insanity?)
* http://benalman.com/
*
* Copyright (c) 2012 "Cowboy" Ben Alman
* Licensed under the MIT license.
*/
Object.defineProperty(global, 'log', {
set: function(args) {
@cowboy
cowboy / add-test.js
Created November 6, 2012 14:56
(for a class)
var prop = 11;
var obj = {
prop: 1,
add: function(a, b) {
return this.prop + a + b;
}
};
@cowboy
cowboy / gruntfile-part.js
Created October 16, 2012 13:47
something for jquery stuffs
// eg. "grunt server qunit:data"
// Build the qunit task config dynamically
var qunit = {};
grunt.file.expand('src/*.js').forEach(function(filepath) {
var base = path.basename(filepath, '.js');
qunit[base] = 'http://localhost:8000/test/index.html?module=' + base;
});
@cowboy
cowboy / README.md
Created October 10, 2012 20:26
Getting ready for a Bocoup JavaScript training

Getting ready for Bocoup training

Install the latest version of Node.js

Node.js is a platform built on Chrome's V8 JavaScript engine that can be run via the command line.

Install v0.8.11 or newer using a package manager or by downloading an installer from nodejs.org.

You can test to see that Node installed correctly by running both node --version and npm --version via the command line. The npm (Node package manager) version will be different than node's version.

Also note that running node by itself will enter into an interactive mode where you can type JavaScript to be executed. Pressing Ctrl-C twice will exit. Running node file.js will execute the code in file.js.

@cowboy
cowboy / init-gh-irc-hooks.js
Created October 3, 2012 12:42
grunt: Initialize GitHub IRC hooks
// Modify as-needed.
$.each({
server: 'irc.freenode.net',
port: '6667',
room: '#grunt',
nick: 'gruntly',
message_without_join: true,
}, function(id, val) {
var elem = $('#irc_' + id);
if (typeof val === 'boolean') {
@cowboy
cowboy / grunt-subgrunt.js
Created October 2, 2012 13:31
Grunt 0.4.0a (devel) Run a subproject's grunt tasks.
/*
* grunt-subgrunt
* http://gruntjs.com/
*
* Copyright (c) 2012 "Cowboy" Ben Alman
* Licensed under the MIT license.
* https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT
*/
'use strict';