###this is a gist test
- with
- a
- list
- that
- works
// | |
// toplevel.js | |
// | |
// TopLevel enables you to template your HTML, CSS, and Javascript at the Top Level | |
// (c) 2014 chris mckenzie. see LICENSE for more details. | |
// https://github.com/kristopolous/TopLevel for the latest version. | |
// | |
// Parts of this code use Jeremy Ashkenas' underscore library, available at | |
// https://github.com/jashkenas/underscore and protected by the license specified | |
// therein. |
/* | |
* Simple Pub/Sub Implementation for jQuery | |
* | |
* Inspired by work from Peter Higgins (https://github.com/phiggins42/bloody-jquery-plugins/blob/master/pubsub.js) | |
* | |
* This is about the simplest way to write a pubsub JavaScript implementation for use with jQuery. | |
*/ | |
(function( $ ) { | |
// Cache of all topics |
arr = Array:: | |
arrSlice = arr.slice | |
curry = -> | |
args = arrSlice.call arguments | |
-> | |
args2 = arrSlice.call arguments | |
args[0].apply @, args.slice(1).concat(args2) | |
sum = -> |
Copyright (c) 2015 - Xavier Cambar <@ xcambar_gmail.com> | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in |
// I am trying to put a validation constraint on an input field for inputting a username that it be unique - | |
//if the name is already present in the database I want the validation to fail. | |
//Is there an obvious way to go about this? Any hint in the right direction would be appreciated. | |
/* | |
Here's an example from one of my projects. This is from a registration | |
form, to check if the email is already used. | |
First, I make "app" a required option of my form type: |
<?php | |
// src/Foobar/Controller/FooController.php | |
namespace Foobar\Controller; | |
class FooController | |
{ | |
public function helloAction($request) | |
{ |
// model | |
function Model () { | |
this._state = {} | |
return this | |
} | |
Model.prototype.get = function (key) { | |
return this._state[key] | |
} |
This tutorial demonstrates this: https://angular.io/docs/ts/latest/tutorial/toh-pt1.html you don't get syntax coloring, or any benefits you'd get from a good html/templating tool.
(( flashbacks to inline html strings in C++ ))
from an angular.io example:
Forget AMD and that's straight from the source. Sorry for the long build-up on the history, but if I'm to convince you to forget this non-technology, I think it's best you know where it came from. For those in a hurry, the executive summary is in the subject line. ;)
In Spring of 2009, I rewrote the Dojo loader during a requested renovation of that project. The primary pattern used to make it more practical was:
dojo.provide('foo', ['bar1', 'bar2'], function() { [module code] });