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 ( $, window, undefined ) { | |
var pluginName = 'countable', | |
document = window.document, | |
defaults = { | |
step: 1, | |
min: 1, | |
max: 0, | |
value: 1, | |
increase: ".increase", | |
decrease: ".decrease", |
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
http://blogs.plexibus.com/2009/01/15/rest-esting-with-curl/ | |
http://stackoverflow.com/questions/298745/how-do-i-send-a-cross-domain-post-request-via-javascript | |
POSTS CURL | |
curl -i -H "Accept: application/json" -X GET http://localhost:3000/posts.json | |
curl -i -H "Accept: application/json" -X GET http://localhost:3000/posts/2.json | |
curl -i -H "Accept: application/json" -X POST -d "post[title]=meu titulo&post[content]=meu conteudo" http://localhost:3000/posts.json | |
curl -i -H "Accept: application/json" -X PUT -d "post[title]=meu titulo2" http://localhost:3000/posts/1.json | |
curl -i -H "Accept: application/json" -X DELETE http://localhost:3000/posts/1.json |
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
# USAGE: | |
# random_date() # => random date within 20 days past | |
# random_date(30) # => random date within 30 days past | |
# random_date(:unity => :second) => random date within 20 seconds past | |
# random_date(:future => true) => random date within 20 days future and past | |
# random_date(:past => false) => random date within 20 days future | |
# random_date(4.years, :unity => :second, :past => false) => random date withim 4 years future. Random year til second | |
# random_date(4, :unity => :years, :past => false) => random date withim 4 years future. Actual date with random year only | |
def random_date(*arguments) | |
options = { |