Skip to content

Instantly share code, notes, and snippets.

@jasonaden
jasonaden / Base.cfc
Created July 30, 2012 13:48
Complete code for toSerializable()
<cfscript>
component accessors="true" {
serializePath = [];
javaSys = createObject("java", "java.lang.System");
public any function includePath(required string path) {
@jasonaden
jasonaden / Site.cfc
Created August 8, 2012 22:41
Testing of toSerializable method
<cfscript>
component accessors="true" extends="Base" {
property string name;
property State state;
}
</cfscript>
angular.module('app').config(function ($provide) {
$provide.provider('myService', function () {
var config;
return {
setConfig: function (_config) {
config = _config;
},
$get: function (otherService) {
// use config in here
angular.module('mc.inputs').constant 'FormData',
name: 'TestForm'
prompt: 'Test Form'
description: 'Test Form Description'
render: 'one-column'
items: [
type: 'group'
render: 'group'
items: [
{
@jasonaden
jasonaden / gist:087959e16215c1049840
Created October 14, 2014 18:58
View & Edit Mode for Angular Forms
(function (angular) {
var mod = angular.module('ng.forms', []);
['form', 'ngForm'].forEach(function(name) {
return mod.directive(name, function($parse) {
return {
restrict: 'EA',
require: 'form',
link: function(scope, element, attrs, ngForm) {
var startMode = $parse(attrs.startMode)(scope) || 'edit'
(function () {
var table = [];
var add = function (name, cmd) {
table.push({'Description': name, 'Command/Shortcut': cmd});
};
add("Search Sources Filename", "Cmd+o");
add("Find in File", "Cmd+f");
add("Search Across All Files", "Cmd+Opt+f");
add("Filter for Function/Selector", "Cmd+Shift+O");
searchTimeout = $interval(->
# Build more explicit query string to return better lucene results
# As of 2014-10-20 wildcard searches seem broken. i.e., `q=brendon+b*`
# returns a result as if it was `q=b*`, skipping all characters before
# the escaped space [ms]
formattedQuery = "#{queryString}*" unless hasSpace = / /.test queryString
if hasSpace
if css.isPhone(origQueryString)
formattedQuery = "phone:#{queryString}*"
else
var directive = ['$parse', function ($parse) {
var directive = {
restrict: 'A',
require: ['ngModel'],
link: link
};
return directive;
function link(scope, element, attr, ctrls) {
var ngModelController = ctrls[0];
@jasonaden
jasonaden / integration.spec.ts
Created July 13, 2017 21:25
Test lazy named children
it('should allow lazy loaded module in named outlet',
fakeAsync(inject([Router, NgModuleFactoryLoader], (router: Router, loader: SpyNgModuleFactoryLoader) => {
@Component({selector: 'lazy', template: 'lazy-loaded'})
class LazyComponent {}
@NgModule({
declarations: [LazyComponent],
imports: [RouterModule.forChild([{path: 'lazy', component: LazyComponent}])]
})