Skip to content

Instantly share code, notes, and snippets.

View localnerve's full-sized avatar

Alex Grant localnerve

View GitHub Profile
@localnerve
localnerve / tfscheckout
Last active May 12, 2016 20:28
Example of using TFS with Grunt (not that you would want to do this, but it can work). Employs the grunt-shell task so that TFS targets play well with other tasks that spawn (like grunt-contrib-compass).
//
// Example showing how to use TFS with grunt.
// Plays well with grunt-contrib-compass and other tasks that spawn processes.
// This example only shows tf checkout, but you could reuse this pattern to add more tf commands.
//
// Gist by https://github.com/localnerve, http://www.localnerve.com
//
var path = require("path");
module.exports = function(grunt) {
@localnerve
localnerve / gist:9718776
Last active August 29, 2015 13:57
jitsu deployment error 2014-03-23
info: Welcome to Nodejitsu localnerve
info: jitsu v0.13.15, node v0.10.26
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in node app.js
warn: Local package version appears to be old
warn: The package.json version will be incremented automatically
warn: About to write /home/agrant/var/www/content/wpspa/dist/release/package.json
data:
data: {
@localnerve
localnerve / gist:9722582
Created March 23, 2014 12:44
jitsu deployment package.json
{
"name": "WPSPA",
"version": "0.1.0-1",
"author": "Alex Grant <alex@localnerve.com>",
"description": "A Single Page Application using Wordpress",
"contributors": [
{
"name": "Alex Grant",
"email": "alex@localnerve.com"
}
@localnerve
localnerve / gist:9774237
Created March 26, 2014 00:08
Nodejitsu Does Not Support Phantomjs Because Phantomjs doesn't have binary for SunOS
> phantomjs@1.9.7-1 install /root/tmp/tmp-273669ta2t68/build/package/node_modules/html-snapshots/node_modules/phantomjs
> node install.js
Unexpected platform or architecture: sunos x64
npm http 200 https://registry.nodejitsu.com/pause/0.0.1
npm http 200 https://registry.nodejitsu.com/uid2/0.0.2
npm http 200 https://registry.nodejitsu.com/bytes/0.2.0
npm http GET https://registry.nodejitsu.com/uid2/-/uid2-0.0.2.tgz
npm http 200 https://registry.nodejitsu.com/formidable/1.0.14
npm http 200 https://registry.nodejitsu.com/qs/0.6.5
@localnerve
localnerve / react-starter-error
Last active August 29, 2015 14:06
webpack/react-starter error --display-error-details
agrant@bitbuckler:~/var/www/content/react-test$ npm run build
> react-starter@0.0.0 build /home/agrant/var/www/content/react-test
> webpack --config webpack-production.config.js --progress --profile --colors --display-error-details
61878ms build modules
2ms optimize
2ms hashingg
13ms create chunk assets
1ms additional chunk assets
@localnerve
localnerve / gist:16a6154dccad6a0e631f
Last active August 29, 2015 14:16
Mac Yosemite WebDev Setup

Setup Steps

  1. Get Homebrew package manager. These instructions are reasonable to get homebrew setup.

  2. Github for mac (if you plan on using GH, BB, or other Git service without having to cmdline everything).

  3. Shell and Command Line Stuff

@localnerve
localnerve / gist:31b77ad56da309fa9d97
Last active August 29, 2015 14:16
jsDom React Testing - getMarkupWrap - Markup wrapping node not initialized. A friendly module-monkey-patch and module-state reminder courtesy of React.
/*
While debugging using jsdom with react tests, I reminded myself of "when" module code executes.
In doing so, I also reminded myself how to monkey patch loaded modules.
Happy remembering!
*/
beforeEach(function() {
// setup jsdom
testDom();
// tell react DOM is usable
@localnerve
localnerve / gist:c7081a619878ef5b6f50
Last active August 29, 2015 14:26 — forked from giosakti/gist:3027026
[Git] Fetch & merge upstream/downstream repo
git remote add <upstream>/<repo> ssh://git@bitbucket.org/<upstream>/<repo>.git
git fetch <upstream>/<repo>
git checkout master
git merge remotes/<upstream>/<repo>/master
@localnerve
localnerve / flux-react-example-main-size-snapshot-20151118.md
Created November 18, 2015 20:18
flux-react-example main bundle contributors 20151118 (77k compressed), settings bundle contained (#35)
  • react: 624.7 kB (58.7%)
  • lodash: 74.46 kB (7.00%)
  • fluxible: 52.71 kB (4.95%)
    • dispatchr: 24.11 kB (45.7%)
      • eventemitter3: 7 kB (29.0%)
    • setimmediate: 6.29 kB (11.9%)
    • is-promise: 165 B (0.306%)
  • fluxible-router: 52.11 kB (4.90%)
    • routr: 18.22 kB (35.0%)
  • path-to-regexp: 9.25 kB (50.7%)
@localnerve
localnerve / renderHtmlIntoDocument.md
Created December 22, 2015 18:47
React 0.14.x HTML Element, Replacement for ReactTestUtils.renderIntoDocument, React / jsDom / Unit Testing

React 0.14.x TestUtils.renderIntoDocument replacement for html elements

  /**
   * renderIntoDocument for html element.
   * Replaces testUtils.renderIntoDocument.
   *
   * testUtils.renderIntoDocument no longer supports React html components as it wraps
   * everything in a div:
   * https://github.com/facebook/react/issues/5128