This file contains hidden or 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
$which_document = (array( | |
"_id" => $email_address, | |
'$elemMatch' => array('word_id' => $word) | |
)); | |
$which_fields = array('$set' => array("status" => "complete")); | |
$collection->update($which_document, $which_fields); |
This file contains hidden or 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 search = { | |
getResults : function(){ | |
$.getJSON( | |
'http://query.yahooapis.com/v1/public/yql?format=json&callback=', | |
{ q : getQuery(term) }, | |
function(resp) { | |
if (!resp.query.results.result.length) { return; } | |
search.updateDOM(resp.query.results.result); | |
} |
This file contains hidden or 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
# Copyright 2008 Chris Wanstrath | |
# Taken from defunkt's gist repository: http://github.com/defunkt/gist/tree/master | |
require 'open-uri' | |
require 'net/http' | |
require 'net/https' | |
module Gist | |
extend self |
This file contains hidden or 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
scenario "A user should be able to save an opportunity" do | |
all('input[type="text"]').each{ |input| fill_in( input[:id], :with => "Test Data" ) } | |
all('select').each do |select| | |
option = first("##{select[:id]} option") | |
select( option[:value], :from => select[:id] ) | |
end | |
click_on( "Save" ) | |
end |
This file contains hidden or 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
scenario "A user should be able to save an opportunity" do | |
all('input[type="text"]').each{ |input| fill_in( input[:id], :with => "Test Data" ) } | |
all('select').each do |select| | |
option = first("##{select[:id]} option") | |
select( option[:value], :from => select[:id] ) | |
end | |
click_on( "Save" ) | |
end |
This file contains hidden or 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 top_align_label(form_field) | |
return "top-align" if form_field.is_a?( TextareaFormField ) | |
return "top-align" if form_field.is_a?( FileFormField ) && form_field.reference | |
end |
This file contains hidden or 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
## Semantic | |
<div class="childhood-story"> | |
<label for="story-of-youth">A Story From Your Childhood</label> | |
<textarea name="story-of-youth" id="story-of-youth" cols="30" rows="10"></textarea> | |
</div> | |
<style> | |
div.childhood-story label { | |
vertical-align: top; |
This file contains hidden or 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
$openDocument.click(function(e){ | |
e.preventDefault(); | |
this.showDocument( $(this) ); | |
}.bind(this)); |
This file contains hidden or 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
// self-executing function that will leak _ and its method/props into the global scope | |
(function() { | |
// access to global scope throughout function | |
var root = this; | |
var previousUnderscore = root._; | |
var breaker = {}; |
This file contains hidden or 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 _generateGroupId = function randGen(){ | |
// 2. newid is reset | |
var newId = Math.floor(Math.random() * 10); | |
if( _(myArray).include(newId) ){ | |
// 1. you're sent back to the top of the function | |
randGen.apply( this ); | |
} else { | |
myArray.push( newId ); | |
// 3. a new id is explicitly returned. if you log here, you will get the new value |
OlderNewer