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
/** | |
* @description Ajax Form object. Depend on the jQuery and jquery.form.js | |
* @param | |
*/ | |
function AjaxForm(settings) { | |
this.settings = settings; | |
this.action = {}; | |
this.__load(settings.url, settings.form_id); | |
}; |
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
node index.js | |
node.js:116 | |
throw e; // process.nextTick error, or 'error' event on first tick | |
^ | |
TypeError: object is not a function | |
at Object.CALL_NON_FUNCTION_AS_CONSTRUCTOR (native) | |
at Object.<anonymous> (/home/jackey/workspace/bones/servers/Route.bones:13:13) | |
at Module._compile (module.js:380:26) | |
at Object..bones (/home/jackey/workspace/bones/server/plugin.js:32:12) |
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
$array = array( | |
'field_item_1' => array( | |
'field_sub_item_11' => array('field' => TRUE, 'title' => 'sub field item 1'), | |
'field_sub_item_12' => array('field' => FALSE, 'title' => 'sub field item 2'), | |
), | |
'field_item_2' => array( | |
'field_sub_item_21' => array('field' => TRUE, 'title' => 'sub field item 21'), | |
), | |
); |
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
var MyConstructor = function() { | |
... | |
process.nextTick(function() { | |
self._continue(); | |
}); | |
}; | |
MyConstructor.prototype.__proto__ = EventEmitter.prototype; | |
MyConstructor.prototype._continue = function() { |
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
router: | |
App.bones | |
```javascript | |
router = Backbone.Router.extend({ | |
routes: { | |
'front': 'front' | |
}, | |
front: function () { | |
this.send(views.Front); |
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
//File class.js | |
class = module.exports = function () { | |
} | |
class.prototype.add = function () {console.log('hello')}; | |
//File index.js | |
var class = new require('./class')(); |
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
var _ = Bones._; | |
var sync = Document.prototype.sync; | |
Document.prototype.sync = function (method, model, options) { | |
var self = this; | |
var properties = this.getSchema().getProperty('properties'); | |
var names = properties.getPropertyNames(); | |
_.each(names, function(name, index) { | |
var property = properties.getProperty(name); | |
// Maybe I should use function instead of directly access value; |
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
<HTML><HEAD><style type="text/css"> | |
<!-- | |
a:link { | |
color: #000000; | |
text-decoration: none; | |
} | |
a:visited { | |
color: #000000; | |
text-decoration: none; | |
} |
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
//来自 phpcms: | |
/** | |
* 字符截取 支持UTF8/GBK | |
* @param $string | |
* @param $length | |
* @param $dot | |
*/ | |
function str_cut($string, $length, $dot = '...') { | |
$strlen = strlen($string); |
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
CREATE TABLE `table_name` ( | |
`id` INT AUTO_INCREMENT, | |
`center` POINT, | |
`radius` INT | |
) | |
SELECT (GLength(LineStringFromWKB(LineString(pt,GeomFromText(center))))) AS rradius | |
FROM `table_name` t |
OlderNewer