Skip to content

Instantly share code, notes, and snippets.

@ryanjduffy
ryanjduffy / fiddle
Last active December 14, 2015 00:09
Enyo CLI fiddle
/*
* jssha256 version 0.1 - Copyright 2006 B. Poettering
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@ryanjduffy
ryanjduffy / inherited.sublime-snippet
Created January 19, 2013 20:38
If you're using Sublime Text 2 for EnyoJS, you need this snippet!
<snippet>
<content><![CDATA[
this.inherited(arguments);
]]></content>
<tabTrigger>inh</tabTrigger>
<scope>source.js</scope>
<description>this.inherited(arguments);</description>
</snippet>
enyo.kind({
name: "LoaderTest",
kind: enyo.TestSuite,
testSingleLoad: function() {
enyo.load("tests/loader1.js", enyo.bind(this,
function() {
if (window.LOADER_TEST === "loader1") {
this.finish();
}
else {
enyo.kind({
name:"ex.RemoteEcho",
kind:"cli.Command",
command:"recho",
commandHandler:function(source, command) {
this.doCommandResponse({response:[{content:"You said, \"" + command.argList.join(" ") + "\""}]});
}
});
enyo.kind({
@ryanjduffy
ryanjduffy / app.css
Created November 29, 2012 14:20
Enyo Tutorial - To Do Application
.todo-list {
width:50%;
background:#fff;
}
.todo-list .task-row {
height:40px;
background:#ccf;
border-bottom:1px solid #eef;
}
@ryanjduffy
ryanjduffy / App.js
Created February 23, 2012 17:33
Enyo wrapper for cubiq's iScroll 4
enyo.kind({
name:"ex.App",
kind:"Control",
components:[
{kind:"cubiq.iScroll", components:[
{kind:"VirtualRepeater", onSetupRow:"setupRow", components:[
{name:"row", onclick:"rowClicked"},
{kind:"Button", onclick:"buttonClicked"},
{kind:"Slider", min:0, max:20}
]},
@ryanjduffy
ryanjduffy / gist:1199671
Created September 7, 2011 03:21
Reset kind to published properties
var _Example = {
name:"com.technisode.example.App",
kind:"Control",
published:{
a:1,
b:2,
c:3
},
components:[
{kind:"IntegerPicker", name:"aPicker", label:"A"},
@ryanjduffy
ryanjduffy / dev.palm.com.17701
Created August 25, 2011 14:01
toaster example
var _Example = {
name:"com.technisode.example.App",
kind:"Control",
components:[
{kind:"Button", caption:"click me", onclick:"clicked"},
{kind:"toaster.addtsk", name:"addtsk"}
],
clicked:function() {
this.$.addtsk.openAtCenter();
}
@ryanjduffy
ryanjduffy / README.md
Last active August 29, 2015 14:27
Console jsperf

Usage Example

// Setup code before all tests are ran
jsperf.before(function () {
   testStr = '-1/2';
});

// Teardown code after all tests are ran
jsperf.after(function () {