Skip to content

Instantly share code, notes, and snippets.

View NeuTrix's full-sized avatar

michael j. Walker NeuTrix

  • BrandGeneering.com
  • San Franciscos, LA, Las Vegas
View GitHub Profile
const factorial = (num) => {
return num === 0 ? 1 : num * factorial(num-1)
}
// Place your settings in the file "Packages/User/Preferences.sublime-settings",
// which overrides the settings in here.
//
// Settings may also be placed in syntax-specific setting files, for
// example, in Packages/User/Python.sublime-settings for python files.
{
// Sets the colors used within the text area
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
// Note that the font_face and font_size are overridden in the platform
@NeuTrix
NeuTrix / gist:62feae3bdc30dccf96856a01baa91e81
Created October 10, 2017 20:55
sublime Default prefernces
// Place your settings in the file "Packages/User/Preferences.sublime-settings",
// which overrides the settings in here.
//
// Settings may also be placed in syntax-specific setting files, for
// example, in Packages/User/Python.sublime-settings for python files.
{
// Sets the colors used within the text area
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
// Note that the font_face and font_size are overridden in the platform
@NeuTrix
NeuTrix / gist:b3b0a570efbb4793ca489482a2bf2965
Created October 10, 2017 20:54
sublime User preferences
{
"color_scheme": "Packages/Color Scheme - Default/iPlastic.tmTheme",
"font_size": 16,
"ignored_packages":
[
"Vintage"
],
"rulers":
[
70
@NeuTrix
NeuTrix / Grid maker
Last active August 1, 2017 18:19
Generates grid data for a d3 chart. takes an args object as its argument
// creates the data object for the grid table to view
// takes a single args object with width, height, rowCount and colCount properties
function gridData(args) {
var data = new Array();
var xpos = 1; //starting xpos and ypos at 1 so the stroke will show when we make the grid below
var ypos = 1;
var width = args.width;
var height = args.height;
var rowCount = args.rowCount;
@NeuTrix
NeuTrix / calendarFilter.js
Last active June 27, 2017 05:04
Using Array.Filter method (for Calendar dates)
var myarr = [
{wk:1, mos:"Jan", day:"Mon",date:10,year:2017},
{wk:1, mos:"Jan", date:9, year:2017},
{wk:52, mos:"Jan", date:5, year:2018},
{wk:1, mos:"Jan", date:7, year:2017},
{wk:1, mos:"Mar", year:2017},
{wk:2, mos:"Jan", year:2018},
{wk:3, mos:"Feb",date:22, year:2017},
{wk:2,mos:"Feb",date:17, year:2017},
{wk:1, mos:"Feb", date:28, year:2017}
var React = require('react');
var Runner = React.createClass({
propTypes: {
message: React.PropTypes.string.isRequired,
style: React.PropTypes.object.isRequired,
isMetric: React.PropTypes.bool.isRequired,
miles: React.PropTypes.number.isRequired,
milesToKM: React.PropTypes.func.isRequired,
races: React.PropTypes.array.isRequired
@NeuTrix
NeuTrix / React Form component
Created May 28, 2017 07:44
React.js Example of a form component
var React = require('react');
var ReactDOM = require('react-dom');
var Input = React.createClass({
getInitialState: function() {
return {
userInput:""
};
},
@NeuTrix
NeuTrix / extensibility.js
Created April 30, 2017 17:01
running a mini address book to see how changing extensibility for objects works in js
"use strict()";
// make a phoneBook object
var phoneBook = {};
// add some people objects
phoneBook.bob= {name:"Bob",age:35};
phoneBook.greg= {name:"Greg",age:27};
phoneBook.nancy= {name:"Nancy", age:65};
@NeuTrix
NeuTrix / js-for-in-loop.js
Last active May 1, 2017 02:28
JavaScript. Iterating through an Object with a for...in loop : mini phone book
"use strict()";
// make a phoneBook object
var phoneBook = {};
// add some people objects
phoneBook.bob= {name:"Bob",age:35};
phoneBook.greg= {name:"Greg",age:27};
phoneBook.nancy= {name:"Nancy", age:65};