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
// From: http://stackoverflow.com/questions/3596583/javascript-detect-an-ajax-event | |
var s_ajaxListener = new Object(); | |
s_ajaxListener.tempOpen = XMLHttpRequest.prototype.open; | |
s_ajaxListener.tempSend = XMLHttpRequest.prototype.send; | |
s_ajaxListener.callback = function () { | |
// this.method :the ajax method used | |
// this.url :the url of the requested script (including query string, if any) (urlencoded) | |
// this.data :the data sent, if any ex: foo=bar&a=b (urlencoded) | |
console.log(this.method); |
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
# Using the `@property` decorator allows the MongoEngine Document object to have | |
# properties that reference Models, and be got/set like normal foreign keys. | |
# This same pattern can work the other way and allow Models interface with | |
# Documents. | |
class Foo(mongoengine.Document): | |
# The `id` of the property is stored in the Document. | |
user_id = mongoengine.IntField() | |
# Setters and getters to interface with the SQL DB and set Users to 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
<div class="Content"> <p id="b1" class="TextBlock"> Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nullam id dolor id nibh ultricies vehicula ut id elit. Nullam id dolor id nibh ultricies vehicula ut id elit. Vestibulum id ligula porta felis euismod semper. Aenean lacinia bibendum nulla sed consectetur. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. </p> <p id="b2" class="TextBlock"> Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nullam id dolor id nibh ultricies vehicula ut id elit. Donec sed odio dui. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Nullam id dolor id nibh ultricies vehicula ut id elit. Nullam id dolor id nibh ultricies vehicula ut id elit. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. <span class="Spacer"></span> </p> <div id="b3" class="ImageBlock"> <img src="http://sample.marquee-cdn.net/images/34-51 |
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
// ---- | |
// Sass (v3.3.0.rc.1) | |
// Compass (v0.13.alpha.10) | |
// ---- | |
=extend-variants($module_name, $variants...) | |
@each $variant in $variants | |
@if type_of($variant) == "list" | |
$variant: #{nth($variant, 1)}--#{nth($variant, 2)} | |
@extend %#{$module_name}%-#{$variant} |
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
someFn | |
"#{ key }": val | |
foo: val2 |
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
<div class="IssueContents"> | |
<div class="Theme"> | |
<h2 class="ThemeTitle">Theme Title</h2> | |
<p class="ThemeContent">Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vestibulum id ligula porta felis euismod semper.</p> | |
</div> | |
<div class="Story -featured"> | |
<h2 class="StoryTitle">Title</h2> | |
<p class="StoryPreview">Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vestibulum id ligula porta felis euismod semper.</p> | |
</div> | |
<div class="Story"> |
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
// ---- | |
// Sass (v3.3.0.rc.1) | |
// Compass (v0.13.alpha.10) | |
// ---- | |
=item($extend: item) | |
@if $extend | |
@extend %#{ $extend } | |
@else | |
color: red |
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
<div class="IssueContents"> | |
<div class="Theme"> | |
<h2 class="ThemeTitle">Theme Title</h2> | |
<p class="ThemeContent">Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vestibulum id ligula porta felis euismod semper.</p> | |
</div> | |
<div class="Story -featured"> | |
<h2 class="StoryTitle">Title</h2> | |
<p class="StoryPreview">Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vestibulum id ligula porta felis euismod semper.</p> | |
</div> | |
<div class="Story"> |
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
# Extend the Components as a way to provide defaults or add extra capability. | |
class TitleField extends StringField | |
placeholder : 'Title' | |
label : 'Title' | |
char_limit : 70 | |
getValue: -> | |
value = super() | |
# do something with the value | |
return value |
NewerOlder