Skip to content

Instantly share code, notes, and snippets.

View pifantastic's full-sized avatar

Aaron Forsander pifantastic

  • Stripe
  • Austin, TX
View GitHub Profile
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)
$('body, header, header h1, .page-element').css({
'background-color' : '#111',
'color' : '#E5E5E5'
});
$('.live-config').css('color', '#333');
$('.configOpen').css('color', '#E5E5E5');
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('/')
// 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...
show: function(){
this.style.display = this.oldblock ? this.oldblock : "";
if ( jQuery.css(this,"display") == "none" )
this.style.display = "block";
}
{
"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/",
@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
// 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
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) {
{
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();