Skip to content

Instantly share code, notes, and snippets.

View jojo89's full-sized avatar

Joseph Burtoft jojo89

View GitHub Profile
@jojo89
jojo89 / zoo.js
Created September 26, 2013 15:12 — forked from dbc-challenges/zoo.js
//------------------------------------------------------------------------------------------------------------------
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here.
//------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------
// DRIVER CODE: Do **NOT** change anything below this point. Your task is to implement code above to make this work.
//------------------------------------------------------------------------------------------------------------------
@jojo89
jojo89 / index.html
Created September 26, 2013 16:23 — forked from dbc-challenges/index.html
DBC Phase 2 Practice Assessment Part 3
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css">
</head>
$(".item").draggable({
helper: "clone",
});
$("#grocery_list").droppable({
drop: function(event, the_new_item){
$(this).append(the_new_item.draggable.clone())
var Board = function( selector ) {
// Your board related code goes here
// Use $elem to access the DOM element for this board
var $elem = $( selector );
$elem.droppable({
drop: function(event, the_new_item){
$(this).append(the_new_item.draggable.clone())
$(the_new_item).remove();

Instructions:

  1. Download this application skeleton.
  2. Convert the app to use AJAX.
  3. Add any files you changed to your gist and submit your code.
dict = ["a",
"abdominal","a", "ace", "acre", "arc", "are", "area", "c", "car", "care", "ceca", "e", "ear", "era", "err", "r", "race", "racer", "rare", "re", "rear", "rec"
]
def jumble(source,dict) # =>O(2n^2d + 2nd + n + nlogn + 1) => O(n^2d)
matches = [] # => O(1)
source_array = source.split("")
dict.each do |w| # => O(2n^2 + n + n) * O(d) => O(2n^2d + 2nd)
w_hash = {}
dict = ["a",
"abdominal","a", "ace", "acre", "arc", "are", "area", "c", "car", "care", "ceca", "e", "ear", "era", "err", "r", "race", "racer", "rare", "re", "rear", "rec"
]
def jumble(source,dict)
matches = [] # => O(1)
source_hash = source.chars.inject(Hash.new(0)) { |h,v| h[v] += 1; h }
dict.each do |w|
#to
def normalized_content_from_content
if client
options = {
blacklisted_elements: client.article_blacklisted_elements,
whitelisted_tags: client.article_whitelisted_tags,
}
ContentNormalization.new(content, options).normalized_content
else
<div class="easyrecipe">
<div class="ERSName">
Strawberry Lemon Delight
</div>
<div class="ERSClear">
&nbsp;
</div>
<div class="ERSTopRight">
require 'nokogiri'
file = open('http://www.workingmomsagainstguilt.com/2014/05/confidence-picking-dessert-picking-job/')
body = file.read
doc = Nokogiri::HTML(body)
doc.css('div.entry-content').inner_text