Skip to content

Instantly share code, notes, and snippets.

John Cipriano johncip

Block or report user

Report or block johncip

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@niranjv
niranjv / change_lambda_logger_format.py
Last active Jul 13, 2019
Change Python logger format in AWS Lambda
View change_lambda_logger_format.py
# 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)
@insin
insin / 1.js
Created May 7, 2014
This is the sort of stuff JSX saves you from having to manage
View 1.js
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']
@keithtom
keithtom / no_animations.rb
Last active Sep 22, 2019
Rack Middleware to disable Disable CSS3/jQuery Animations for Capybara
View no_animations.rb
# 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
View capybara cheat sheet
=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')
@maxim
maxim / git.rake
Created Sep 12, 2009
Rake tasks for managing git plugins with submodules.
View git.rake
# 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:
#
You can’t perform that action at this time.