Skip to content

Instantly share code, notes, and snippets.

Avatar
🐜
🧘‍♂️

hemanth.hm hemanth

🐜
🧘‍♂️
View GitHub Profile
@hemanth
hemanth / main.html
Last active May 10, 2019
Portal W3C test
View main.html
<html>
<body>
<h1>Main</h1>
<button>Load portal</button>
</body>
<script>
document.querySelector('button').addEventListener('click', () => {
const portal = document.createElement('portal');
portal.src = 'http://localhost:3001';
document.body.appendChild(portal);
@hemanth
hemanth / index.js
Last active Jun 22, 2016
requirebin sketch
View index.js
const choo = require('choo')
const app = choo()
app.model({
state: { title: 'Set the title' },
reducers: {
update: (action, state) => ({ title: action.value })
}
})
@hemanth
hemanth / index.js
Created Mar 6, 2015
requirebin sketch
View index.js
"use strict";
var animate = require('fd-animate');
var logo = document.createElement('img')
logo.src = 'https://raw.githubusercontent.com/fp-dom/logo/master/fp-dom.png';
document.body.appendChild(logo)
@hemanth
hemanth / index.js
Last active Aug 29, 2015
requirebin sketch
View index.js
var cnvsGrad = require('canvas-gradaint');
//canvas setup
var canvas = document.createElement('canvas');
canvas.width = '500';
canvas.height = '300';
canvas.style.outline = "1px solid black";
document.body.appendChild(canvas);
// Get the context.
@hemanth
hemanth / index.js
Created Feb 24, 2015
requirebin sketch
View index.js
clear = require('clear-canvas');
//canvas setup
var canvas = document.createElement('canvas');
canvas.width = '500';
canvas.height = '300';
canvas.style.outline = "1px solid black";
document.body.appendChild(canvas);
// Get the context.
@hemanth
hemanth / audio-sprite.js
Last active Aug 29, 2015
Google IO audio sprint snippet.
View audio-sprite.js
function(t) {
t.exports = {
resources: ["https://events.google.com/io2015/experiment/cataudiosprite.mp3"],
spritemap: {
"arp_synth_A-sharp": {
start: 0,
end: 1.0971428571428572,
loop: !1
},
"arp_synth_A-sharp2": {
@hemanth
hemanth / index.js
Created Jan 20, 2015
requirebin sketch
View index.js
var center = require('center')
var el = document.createElement('img');
el.src=''
document.body.appendChild(center(el))
@hemanth
hemanth / es6-dom-extend.js
Last active Apr 2, 2020
Extend DOM elements ES6
View es6-dom-extend.js
class SmartButton extends HTMLButtonElement {
constructor() {}
}
let sb = new SmartButton();
document.body.appendChild(sb);
/*
I get the below error:
TypeError: Failed to execute 'appendChild'
You can’t perform that action at this time.