Skip to content

Instantly share code, notes, and snippets.

@d2m
d2m / designer.html
Created June 24, 2014 07:16
designer
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<polymer-element name="my-element">
<template>
@d2m
d2m / designer.html
Created May 18, 2014 09:14
designer
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="line-chart" attributes="m">
<template>
<style>
#x_design_host {
position: absolute;
width: 100%;
height: 100%;
@d2m
d2m / gist:5998923
Last active December 19, 2015 18:29
polymer.dart : passing values into a component does not work
<!DOCTYPE html>
<html>
<head>
<title>attributes</title>
</head>
<body>
<element name="x-attributes" attributes="model">
<template>
model: {{ model }}
</template>
@d2m
d2m / gist:3838726
Created October 5, 2012 08:20
You are probably misusing DOM text methods
/*
* dart version of http://benv.ca/2012/10/4/you-are-probably-misusing-DOM-text-methods/
*/
import 'dart:html';
import 'package:unittest/unittest.dart';
import 'package:unittest/html_enhanced_config.dart';
String escapeHtml(String str) {
var div = new Element.tag('div');
@d2m
d2m / gist:1935339
Created February 28, 2012 21:42
dart document.cookie lib
/*
* dart document.cookie lib
*
* ported from
* http://www.quirksmode.org/js/cookies.html
*
*/
void createCookie(String name, String value, int days) {
String expires;
@d2m
d2m / gist:1696850
Created January 29, 2012 02:36
Read/write files server-side under frogsh/minfrog
/**
* location: dart/frog/file_system_node.dart
* library: file_system_node
* class: NodeFileSystem
* File system implementation using nodejs api's (for self-hosted compiler).
*/
#import('../../frog/file_system_node.dart');
NodeFileSystem _fs = new NodeFileSystem();
@d2m
d2m / gist:1554220
Created January 3, 2012 09:17
install and run the dart command line REPL
#!/bin/sh
# move to the dart/frog folder in your checkout
cd ~/workspace/dartlang/dev/dart/frog
# build the VM
../tools/build.py -m release
# build frogsh
./frog.py --out=frogsh --compile-only --enable_type_checks frog.dart
@d2m
d2m / gist:1546778
Created January 1, 2012 08:54
update dart bleeding edge
#!/bin/sh
export PATH=$PATH:`pwd`//depot_tools
svn up depot_tools
gclient config http://dart.googlecode.com/svn/branches/bleeding_edge/deps/all.deps
gclient sync
cd dart/
./tools/build.py --arch=ia32