Skip to content

Instantly share code, notes, and snippets.

View erikpukinskis's full-sized avatar

Erik Pukinskis erikpukinskis

View GitHub Profile
def translate(english)
english.gsub(/[A-Za-z]+/) do |word|
translate_word(word)
end
end
def translate_word(english)
first = english[0]
remainder = english[1, english.length]
pig = remainder + first.downcase + 'ay'
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<style>
.slides {
overflow: hidden;
white-space: nowrap;
}
App = Ember.Application.create();
App.Router.map(function() {
this.route('producer', {path: '/producer'});
});
App.ProducerTileView = Ember.View.extend({
classNameBindings: ['selected'],
click: function() {

Narrator

Forward

The ambition of software development is to create a story that can be easily understood by both a person and a computer. Why not go all in and just write documents that can be read by both beast and machine? Donald Knuth calls this "Literate Programming".

I'm going to try to figure out how Literate Programming might work for web apps by making a web app for writing narrative web apps called Narrator. Here we go!

function scrollToReveal(selector) {
MINIMUM = 50
function scrollTowards(edge) {
var distance = distanceTo(edge, selector)
if (distance > MINIMUM) { return }
var offset = distance - MINIMUM
var direction = directionTowards(edge)
var newPosition = $('body').scrollTop() - direction * offset
require 'stripe'
Stripe.api_key = "yr key heer"
# This will cancel all of the subscriptions in your Stripe account. Money corrupts.
$start_at
$found_one = true
while $found_one
puts 'Batch after ' + ($start_at ? $start_at : 'no one')
@erikpukinskis
erikpukinskis / teacup_component_demo.coffee
Last active August 29, 2015 14:17
Teacup Component Demo
{render, component, div, button, label, span, text} = require 'teacup'
{prettyPrint} = require 'html'
html = render ->
# You can do this. Whether you should do this is up to you.
var request = {
values: new HashTable, // https://github.com/BorisKozo/jsHash
cache: function(func) {
if (value = values.get(func)) {
return value
}
var args = Array.prototype.slice(arguments, 1)
var value = func.apply(null, args)
values.set(func, value)
return value
// Component
// Most people when they want to make something happen with software, need to
// pull together a couple different kinds of things. Maybe you want a button on
// your thing that when people hit it they can sign up for some text messages
// that are going to get sent to them according to some pattern. That's a couple
// different kinds of things: a widget people can interact with, some sort of
// off-line activity that springs to life and sends messages at particular
// times. A thing that remembers the phone numbers, etc.
element = require "nrtv-element"
component = require "nrtv-component"
BridgeTie = require "nrtv-bridge-tie"
ServerTie = require "nrtv-server-tie"
ElementTie = require "nrtv-element-tie"
GimmePizza = component(BridgeTie, ServerTie, ElementTie)
server = GimmePizza.server()