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
`rails new (Application Name) -d postgresql -T
@NeuTrix
NeuTrix / How to start a new GitHub repo
Last active September 14, 2016 06:25
Start a New Git Repo
http://kbroman.org/github_tutorial/pages/init.html
git/github guide
**Start a new git repository**
Your first instinct, when you start to do something new, should be git init. You’re starting to write a new paper, you’re writing a bit of code to do a computer simulation, you’re mucking around with some new data … anything: think git init.
A new repo from scratch
Say you’ve just got some data from a collaborator and are about to start exploring it.
Create a directory to contain the project.
Go into the new directory.
@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};
@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 / 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:""
};
},
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 / 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}
@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 / 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 / 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