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
# Python logger in AWS Lambda has a preset format. To change the format of the logging statement, | |
# remove the logging handler & add a new handler with the required format | |
import logging | |
import sys | |
def setup_logging(): | |
logger = logging.getLogger() | |
for h in logger.handlers: | |
logger.removeHandler(h) |
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.$el.append(domBuilder([ | |
['div.arrow'] | |
, ['div.popup-header' | |
, ['button.close', {type: 'button'}, '\u00D7'] | |
, ['h3', 'Add menu item'] | |
] | |
, ['div.popup-body' | |
, ['form.form-horizontal' | |
, ['div.control-group' | |
, ['label.control-label', {'for': 'menuItemType'}, 'Type'] |
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
# Copyright (C) [2014] by Keith Tom <keith dot tom at gmail> | |
# Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. | |
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE | |
module Rack | |
# disable CSS3 and jQuery animations in test mode for speed, consistency and avoiding timing issues. | |
# Usage for Rails: | |
# in config/environments/test.rb | |
# config.middleware.use Rack::NoAnimations | |
class NoAnimations |
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
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
# Rake tasks for managing git plugins with submodules. | |
# | |
# These tasks aim to make life simpler by automating all the boring work. | |
# What you get: | |
# - complete git integration (all you need to know is install, uninstall and update) | |
# - complete github integration (only use author name + plugin name) | |
# - rails plugin hooks (install.rb/uninstall.rb) are taken care of | |
# | |
# Available commands: | |
# |