Skip to content

Instantly share code, notes, and snippets.

View Satyam's full-sized avatar

Daniel Barreiro Satyam

  • Sitges, Barcelona, Spain
View GitHub Profile
@Satyam
Satyam / app.js
Last active August 29, 2015 14:02
example of Mithril app
/* globals Mithril, console, document */
(function (m) {
var app = {
//models
// I keep a static copy of the list in the app
// so it doesn't get reloaded each time the route changes
// and a new app instance gets initialized
list: null,
@Satyam
Satyam / app.js
Created June 13, 2014 16:07
Example of alternate Mithril module
/* globals Mithril, console, document */
(function (m) {
//controller
var app = function () {
// model initialization, if does not already exists
if (!app.list) {
app.list = m.request({
method: 'GET',
@Satyam
Satyam / ytodo.html
Created July 22, 2014 21:02
YUI App todo demo on its way to Mithril with htmlparsing of HTML templates
<!doctype html>
<html>
<head>
<title>Virtual DOM with node references</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mithril/0.1.18/mithril.min.js"></script>
<script src="../../node_modules/htmlparser-jresig/htmlparser-lib/htmlparser.js"></script>
<!-- This is the main container and "shell" for the todo app. -->
<script type="text/x-template" id="todo-app-template">
<div id="todo-app">
@Satyam
Satyam / ytodo.html
Created July 22, 2014 21:04
YUI App todo demo on its way to Mithril with htmlparsing of HTML templates
<!doctype html>
<html>
<head>
<title>YUI todo demo in Mithril</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mithril/0.1.18/mithril.min.js"></script>
<script src="../../node_modules/htmlparser-jresig/htmlparser-lib/htmlparser.js"></script>
<!-- This is the main container and "shell" for the todo app. -->
<script type="text/x-template" id="todo-app-template">
<div id="todo-app">
<!doctype html>
<html>
<head>
<title>Mithirl ES6 test</title>
<meta charset="UTF-8">
<script src="http://cdn.jsdelivr.net/mithril/0.2.0/mithril.min.js"></script>
<script src="node_modules/babel-core/browser.js"></script>
</head>
@Satyam
Satyam / sample.html
Created September 17, 2011 14:11
Processing data using JSON Schema and DataTypes
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>JSON Schema and DataTypes</title>
<style>
td , th , table {
border: thin solid silver;
}
td , th {
@Satyam
Satyam / gist:1498249
Created December 19, 2011 18:18
Patch for WidgetButtons
YUI.add('widget-buttons-patch', function (Y) {
"use strict";
var WB = Y.WidgetButtons,
WBp = WB.prototype,
BUTTON = 'button',
getCN = Y.ClassNameManager.getClassName,
DISABLED = getCN(BUTTON, 'disabled'),
DEFAULT = getCN(BUTTON, 'default');
@Satyam
Satyam / gist:1547708
Created January 1, 2012 16:28
App plugin
/*
App plugins can be loaded over an instance of App by setting a route with a wildcard path
such as:
{
path:'/:app/*',
callback: 'dispatchApp'
}
where the app param is the module name of the plugin,
which should have its entry in the YUI config file (unless loaded by some other means)
*/
@Satyam
Satyam / gist:1605872
Created January 13, 2012 12:28
My Y.Button proposal
<!DOCTYPE html>
<html>
<head>
<!-- Better yet, see: https://gist.github.com/2044488 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Button test</title>
<script type="text/javascript" src="http://yui.yahooapis.com/3.5.0pr1/build/yui/yui.js"></script>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?3.5.0pr1/build/cssreset/reset-min.css&3.5.0pr1/build/cssfonts/fonts-min.css&3.5.0pr1/build/cssbase/base-min.css&3.5.0pr1/build/cssgrids/grids-min.css" />
@Satyam
Satyam / Y.Button
Created March 15, 2012 14:32
My Y.Button plugin proposal, without modifying Attribute
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Button test</title>
<script type="text/javascript" src="http://yui.yahooapis.com/3.5.0pr1/build/yui/yui.js"></script>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?3.5.0pr1/build/cssreset/reset-min.css&3.5.0pr1/build/cssfonts/fonts-min.css&3.5.0pr1/build/cssbase/base-min.css&3.5.0pr1/build/cssgrids/grids-min.css" />
<link rel="stylesheet" type="text/css" href="cssbutton.css" />
</head>