Skip to content

Instantly share code, notes, and snippets.

View dfreedm's full-sized avatar

Daniel Freedman dfreedm

View GitHub Profile
@dfreedm
dfreedm / nested-content.html
Created September 17, 2013 17:31
Expose bug in ShadowDOM related to nested `<content>` element
<!DOCTYPE html>
<script src="polymer/ShadowDOM/shadowdom.js"></script>
<div id="host">
<p>Content</p>
</div>
<template id="t">
<div>
<div>
[<content></content>]
@dfreedm
dfreedm / rename.sh
Last active December 17, 2015 07:29
Rename toolkit -> polymer
#!/bin/bash
REPOS=(
CustomElements
HTMLImports
MutationObservers
PointerEvents
PointerGestures
ShadowDOM
aux-elements
labs
@dfreedm
dfreedm / example.html
Created April 22, 2013 22:34
Input cursor jumps on bound value
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Text Cursor Movement</title>
<script src="../../../MDV/mdv.js"></script>
</head>
<body>
<template id="template" bind="{{}}">
<input value="{{value}}">
@dfreedm
dfreedm / hidden.js
Created December 15, 2012 06:28
Shim for hidden property and attribute
(function() {
if (document.body.hidden === undefined) {
Object.defineProperty(Element.prototype, 'hidden', {
configurable: false,
enumerable: true,
get: function() {
this.hasAttribute('hidden');
},
set: function(v) {
var sr = Boolean(v) ? 'set' : 'remove';
@dfreedm
dfreedm / element_from_point.html
Created July 18, 2012 00:30
Element From Point test
<!DOCTYPE html>
<html>
<head>
<!--<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0">-->
<title>ElementFromPoint test</title>
<style>
/* make rows an easy, visible height */
div {
height: 50px;
width: 100%;
@dfreedm
dfreedm / minify.sh
Created April 18, 2012 00:24
Enyo Minification
#!/bin/sh
../path/to/enyo/tools/minify.sh -no-alias -output ../build/app package.js
@dfreedm
dfreedm / LICENSE.txt
Created September 21, 2011 06:39 — forked from 140bytes/LICENSE.txt
Facebook Profile Finder in 139 bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@dfreedm
dfreedm / thinkbat.pl
Created January 4, 2011 05:00
Perl script to check battery information on Thinkpads, requires tp-smapi kernel module
#!/usr/bin/env perl
# Perl script to check battery levels on Thinkpads
# Requires the tp-smapi linux kernel module
# Daniel Freedman 2010
use strict;
use warnings;
use autodie;
use Getopt::Std;
# Setup getopts configuration
@dfreedm
dfreedm / hide-twitter-sidebar-crap.user.js
Created August 18, 2010 04:59
Hides twitter sidebar crap
// ==UserScript==
// @name Hide Twitter Sidebar Crap
// @namespace http://sketchyplace.biz
// @description Hides the stupid twitter sidebar stuff
// @include http://twitter.com/
// @include https://twitter.com/
// @include http://www.twitter.com/
// @include https://www.twitter.com/
// ==/UserScript==
Some: class <T> {
content:T
init:func <T> (=content){}
get:func -> T {return content;}
}
// None is a builitin type
main: func {
a := Some<String> new("77777")