This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Copyright (c) 2016, Shane Carr (ISC License) | |
-- | |
-- Permission to use, copy, modify, and/or distribute this software for any | |
-- purpose with or without fee is hereby granted, provided that the above | |
-- copyright notice and this permission notice appear in all copies. | |
-- | |
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Expanded | |
var flexboxSupported = (function(){ | |
var prop = "flex-basis:1px"; | |
var el = document.createElement("div"); | |
var prefixes = ["", "-webkit-", "-moz-", "-o-", "-ms-"]; | |
for(var i=0; i<prefixes.length; i++){ | |
el.style.cssText += prefixes[i]+prop; | |
if(!!el.style.length) return true; | |
} | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or | |
distribute this software, either in source code form or as a compiled | |
binary, for any purpose, commercial or non-commercial, and by any | |
means. | |
In jurisdictions that recognize copyright laws, the author or authors | |
of this software dedicate any and all copyright interest in the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// the name of your table | |
$table = "foobar"; | |
// an array of your field names with default values | |
$fields = array( | |
"foo" => 5, | |
"bar" => "(date(now))" | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Send data to the server as POST parameters. Refer to the documentation for {@link Ext.data.writer.Json} | |
for more details on proxy writers. Use "urlencode" as the writer type. For example, your store might | |
look something like this: | |
Ext.define('App.store.ExampleStore', { | |
extend: 'Ext.data.Store', | |
requires: [ | |
'App.model.ExampleModel' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Do the following when you make your slider: | |
myUpdatingSlider.down("#UpdatingSliderField").setValue(startValue); | |
myUpdatingSlider.down("#UpdatingSliderLabel").setHtml(startValue); | |
Sample CSS: | |
.slider-label{ | |
font-size: 2em; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Backbone.Model.prototype.forward = function (attribute, subModel, options) { | |
var self = this; // parent model | |
var property = (options && options.property) ? | |
options.property : attribute; | |
self[property] = subModel; // save the subModel in the specified property | |
subModel.set(self.get(attribute)); // add any existing data to the subModel | |
self.on("change:" + attribute, function(model, value, options){ | |
subModel.set(value, options); | |
}); |