Skip to content

Instantly share code, notes, and snippets.

View martypdx's full-sized avatar

Marty Nelson martypdx

  • martypdx, llc
  • Portland, OR
View GitHub Profile

control flow

  • if, else, while, for, do

functions

closures

```js
var a = 'foo';
function b(){

return a;

control flow

  • if, else, while, for, do

functions

closures

```js
var a = 'foo';
function b(){

return a;

control flow

  • if, else, while, for, do

functions

closures

```js
var a = 'foo';
function b(){

return a;

control flow

  • if, else, while, for, do

functions

closures

```js
var a = 'foo';
function b(){

return a;

control flow

  • if, else, while, for, do

functions

closures

```js
var a = 'foo';
function b(){

return a;

🚀 npm i ractive --debug --verbose
npm info it worked if it ends with ok
npm verb cli [ '/usr/local/bin/node',
npm verb cli '/usr/local/bin/npm',
npm verb cli 'i',
npm verb cli 'ractive',
npm verb cli '--debug',
npm verb cli '--verbose' ]
npm info using npm@3.10.3
npm info using node@v6.3.1
import { Component, $, when, State } from 'diamond-alpha';
import request from 'superagent';
export class Todos extends Component {
static template({ Todo, TextInput }) {
return todos => $`
<ul>
${todos.map( (todo, i) => $`
<li>
@martypdx
martypdx / index.html
Created February 3, 2016 17:17
picky.js perf issues
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>picky.json | Dump JSON. Click something. Get selector.</title>
<meta name="description" content="Manually parsing JSON to get the selector you want is human error prone and just not much fun. picky.json lets you input raw JSON (or a URL that returns JSON) and then click on anything to get the selector you need quickly and easily!">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
@martypdx
martypdx / gobblefile.js
Last active October 23, 2015 18:36
Building ractive components
var gobble = require( 'gobble' ),
makeComponent = require( './gobble/make-component' ),
sass = require( './gobble/sass-file' ),
join = require( 'path' ).join,
bundleModules = require( './gobble/bundle-modules' );
console.log( 'gobble_env', gobble.env() );
var isProduction = gobble.env() === 'production';
<textarea id='input'>this is my sentence</textarea>
<script>
// letter count
// word count
var textarea = document.getElementById('input');
var sentence = textarea.value;
var length = sentence.length;