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
# | |
# This is using gem called simple_form by Jose Valim, but it can work with normal Rails calendar_select form inputs | |
# | |
<form....> | |
<%= f.input :target_date, :input_html => {:rel => '{"changeYear":true, "changeMonth":true, "minDate":"+1D", "maxDate":"+12M"}'} %> | |
</form> |
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
#!/bin/env python | |
# keys is a list of key | |
def filter_keys(keys, object): | |
return dict((x,y) for (x, y) in object.iteritems() if x in keys) | |
# or with keys being one or more keys | |
def filter_keys2(object, *keys): | |
return dict((x,y) for (x, y) in object.iteritems() if x in keys) |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |