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 zlib = require('zlib'); | |
var tar = require('tar'); | |
var dir = __dirname + '/someSEOJob'; | |
request(url) | |
.pipe(zlib.createGunzip()) | |
.pipe(tar.Extract({ path: dir })) | |
.on("error", function (err) { | |
console.error(err) |
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
$('body, header, header h1, .page-element').css({ | |
'background-color' : '#111', | |
'color' : '#E5E5E5' | |
}); | |
$('.live-config').css('color', '#333'); | |
$('.configOpen').css('color', '#E5E5E5'); |
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
def post(self): | |
newgroceries = Grocery_Item( | |
item_name=self.request.POST['new_name'], | |
item_location=self.request.POS['new_location'], | |
item_stock=self.request.POST['new_stock'] | |
) | |
newgroceries.put() | |
self.redirect('/') |
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
// Method one, return statement after callback. | |
// Most clear, but extra line of code. | |
function asyncBiznis (callback) { | |
moreAsyncBiznis(function (err, result) { | |
if (err) { | |
callback( new Error("Hope is lost.") ); | |
return; | |
} | |
// More logic... |
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
show: function(){ | |
this.style.display = this.oldblock ? this.oldblock : ""; | |
if ( jQuery.css(this,"display") == "none" ) | |
this.style.display = "block"; | |
} |
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
{ | |
"groups": [ | |
"bv-summit" | |
], | |
"permalink": "http://www.facebook.com/permalink.php?story_fbid=211762785594594&id=149540541118", | |
"praises": 0, | |
"links": [ | |
{ | |
"url": "http://www.austin360.com/a-list/your-a-list/", | |
"short_url": "http://www.austin360.com/a-list/your-a-list/", |
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
@resetInputsForForm: (form_html, taskNumber, taskType) -> | |
form = $(form_html) | |
form.find('input').each (index, element) -> | |
taskNamePrefix = "#{taskType}_task" | |
currentName = $(element).attr('name') | |
multipleParamNamePrefix = "inputs_for_task['#{taskNumber}']" | |
newName = currentName.replace(taskNamePrefix, multipleParamNamePrefix) | |
$(element).attr('name', newName) | |
form |
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
// Determine the position of an element within | |
// the matched set of elements | |
index: function( elem ) { | |
// No argument, return index in parent | |
if ( !elem ) { | |
return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1; | |
} | |
// index in selector |
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
diff --git a/app/main.js b/app/main.js | |
index 766b9ec..baf67b8 100644 | |
--- a/app/main.js | |
+++ b/app/main.js | |
@@ -65,7 +68,7 @@ function(namespace, jQuery, Backbone, Example) { | |
var protocol = this.protocol + "//"; | |
// Ensure the protocol is not part of URL, meaning its relative. | |
- if (href && href.slice(0, protocol.length) !== protocol) { | |
+ if (href && href.slice(0, protocol.length) !== protocol && href.indexOf("javascript:") !== 0) { |
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
{ | |
removeClass: function (name) { | |
for (var i = 0; i < this.length; i++) { | |
if (name === undefined) { this[i].className = ''; return this; } | |
var classList = this[i].className; | |
name.split(/\s+/g).forEach(function (cname) { | |
classList = classList.replace(classRE(cname), ""); | |
}); | |
if (classList.length > 0) | |
this[i].className = classList.trim(); |