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
@martypdx
martypdx / just a test
Created February 17, 2014 16:33
Test Gist
var a = 123
b = 'xyz'
for(var i=0;i<a;i++){
b+=b
}
<!-- {{>box}}-->
<div class='box'
style="top: {{ pos.top }}px;
height: 200px;
width: 300px;">
</div>
<!-- {{/box}} -->
{{#box1}}
@martypdx
martypdx / animal-race.html
Last active August 29, 2015 14:16
animal race
<script>
function run(){
var adjustedSpeed = this.speed * Math.max( .5, Math.random() );
this.position += Math.floor( adjustedSpeed );
}
function fullName(){
return this.name + ' the ' + this.type;
}
@martypdx
martypdx / cards.js
Last active August 29, 2015 14:17
model a deck of cards
function Card( suit, rank ) {
this.suit = suit;
this.rank = rank;
this.toHtml = function() {
return '<li>' + this.rank + ' of ' + this.suit + '</li>';
}
}
function Deck( suits, ranks ) {
this.cards = [];
@martypdx
martypdx / step0.html
Last active August 29, 2015 14:17
codefellows F1 jQuery Lab Reference Implementations
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Basic jQuery Pattern</title>
<!-- <link rel="stylesheet" href="css/main.css"> -->
<style>
body {
font-family: sans-serif;
@martypdx
martypdx / donut-shops.html
Last active August 29, 2015 14:17
Codefellows Donut Shop reference implementation
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="main.css">
</head>
<body>
<header>
<h1>Super! Donut Shops</h1>
</header>

gh-pages

Make sure you have a file called index.html. Create a branch:

$>git checkout -b gh-pages
$>git branch
master
*gh-pages
@martypdx
martypdx / dynamic-component.html
Last active August 29, 2015 14:18
super simple router
<header> some page header </header>
{{#if page}}
<page/>
{{/if}}
<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;
@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';