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 record = { | |
id: idgen(20) , | |
data: { | |
ip: parts[0], | |
agent: parts[1], | |
url: parts[2], | |
referrer: parts[3], | |
mobile: mobile | |
} | |
}; |
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
<--- Pseudocode ---> | |
db.keyStream.on('data', function(key) { | |
if (searchTerm is in key)) { | |
< add key to list of keys found> | |
} | |
}); | |
Problems: | |
Every record must be searched. |
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
<!----- Current Implementation ----> | |
Key | Value | |
------------------|---------------- | |
keyword|uuid | uuid | |
------------------------------------ | |
uuid | object{} | |
| ip, | |
| agent, | |
| url, | |
| referrer, |
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
$("#dropTarget") | |
.bind("dragover", false) | |
.bind("dragenter", function(e) { | |
// add the "activeDrag" class when dragenter is detected | |
$(this).addClass('activeDrag'); | |
}) | |
.bind("drop", function(e) { | |
e.preventDefault(); | |
// grab the text data from the dropped item | |
var dragData = e.originalEvent.dataTransfer.getData("text") || |
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
// grabs the values from your html that represent the array for ansMap | |
((?<=ansMap\[\d] = ')|(?<=ansMap\[\d\d] = '))\w+ |
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 links = ["http://i.imgur.com/i2fB61Z.jpg", ""http://i.imgur.com/TJOigM8.jpg"]; | |
links.forEach(function(link) { | |
var match = null; | |
match = image.link.match(/http:\/\/i\.imgur\.com\//); | |
console.log(match); | |
}); | |
/*** output | |
http://i.imgur.com/ |
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
//spin through each image object | |
json.data.forEach(function(image,index,array) { | |
//we don't want gifs | |
if (!image.link.match(/\.gif$/)) { | |
//get the image extension | |
var ext = image.link.match(/\.\w+$/); | |
//change the link to give us the (l)arge version so we don't kill ourselves on bandwidth | |
//also remove the http://i.imgur.com/ text from the link | |
var match = image.link.match(/http:\/\/i\.imgur\.com\//); |
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
NSError *error = NULL; | |
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"(<[^>]+?>|{{[^}]+?}})" options:0 error:&error]; | |
NSString *result = [regex stringByReplacingMatchesInString:contents options:0 range:NSMakeRange(0, [contents length]) withTemplate:@""]; | |
NSLog(@"%@",result); |
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
function (doc, meta) { | |
var mostRecentVersion = doc.versions[doc.versions.length -1]; | |
emit(meta.id, { | |
"title": doc.title, | |
"byline": doc.byline, | |
"author": doc.author, | |
"tags": doc.tags, | |
"latest": mostRecentVersion | |
}); | |
} |
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
extends layout | |
block content | |
h2= post.value.title | |
h3= post.value.byline | |
p | |
:markdown | |
#{post.value.body} |
OlderNewer