Skip to content

Instantly share code, notes, and snippets.

@davertron
davertron / editor.html
Last active March 9, 2016 05:09 — forked from minikomi/editor.html
Javascript editor in your browser
data:text/html,
<style type="text/css">
#e {
position:absolute;
top:0;
right:0;
bottom:0;
left:0;
font-size:16px;
}
@davertron
davertron / webapp.rb
Created November 17, 2010 00:28 — forked from igrigorik/webapp.rb
require 'rubygems'
require 'rack'
class Object
def webapp
class << self
define_method :call do |env|
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?)
[200, {}, send(func, *attrs)]
end
var myApp = angular.module('myApp', []);
myApp.provider('helloWorld', function() {
// In the provider function, you cannot inject any
// service or factory. This can only be done at the
// "$get" method.
this.name = 'Default';
this.$get = function() {