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
# A test controller that holds a request for the given time, then returns. | |
# Useful for testing requests that time out in Capybara. | |
# | |
# Usage: | |
# mock_posts_controller = HoldingController.new | |
# PostsController.stubs(:new).returns(mock_posts_controller) | |
# mock_posts_controller.holding_actions do | |
# # do something that should time out | |
# assert_text "The request timed out" | |
# end |
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
# Match the JSON body of the request, ignoring some specified keys. | |
# | |
# Usage: | |
# VCR.use_cassette( | |
# 'my_request', | |
# match_requests_on: [:host, :path, body_as_json_excluding(:timestamp)] | |
# ) | |
# | |
# See also: body_as_json | |
def body_as_json_excluding(*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
# By default, ActiveRecord logs SQL statements during tests – including when | |
# creating fixtures. | |
# | |
# When a Rails app has many fixtures, those logs can clobber test logs with | |
# a lot of logged SQL statements. | |
# | |
# We could disable ActiveRecord SQL logs entirely during tests, but having | |
# SQL queries displayed during tests is useful. Instead this snippet disables | |
# the ActiveRecord SQL logs just when loading fixtures. | |
# |
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
#!/usr/bin/env ruby | |
# | |
# Given a source file, scan the unresolved data raw addresses, | |
# and emit an SYM file with additional data labels for those addresses. | |
# | |
# This SYM-file can then be fed into mgbdis to generate a new disassembly | |
# that includes the proper data blocks. | |
# | |
# For best results: | |
# - Document symbols in the original source file the best you can. |
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
<?php | |
/** | |
* Plugin Name: ColibriWP Fix Options | |
* | |
* How to use: | |
* | |
* 1. Put this file inside the wp-content/plugins/ directory; | |
* 2. In the Wordpress Dashboard, navigate to the Extensions page; | |
* 3. Enable the "ColibriWP Fix Options" extension; |
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
validates_associated :champs, :champs_private | |
# -> Rails displays: "Champs is invalid" | |
validates_associated :champs, :champs_private, message: -> (object, _data) { | |
(object.champs + object.champs_private) | |
.reject(&:valid?) | |
.flat_map do |champ| | |
champ.errors.full_messages.map do |message| | |
"#{champ.libelle} : #{message}" | |
end |
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
flashvars="dashmpd=http%3A%2F%2Fmanifest.googlevideo.com%2Fapi%2Fmanifest%2Fdash%2Fplayback_host%2Fr6---sn-25ge7nez.googlevideo.com%2Ffexp%2F938647%252C945808%252C916612%252C932990%252C936103%252C913434%252C939940%252C936923%252C945044%2Fmws%2Fyes%2Fipbits%2F0%2Fkey%2Fyt5%2Fsignature%2FD449517F9688BB4C453C7B18D50DEAACDC324923.5669E0CE0EA5325147384F04EBD81985EFA35237%2Fid%2Fo-AL6KbE-hh8iY798b-T_Ftn5Ae5kgJU7AYI-xUMdzStzy%2Fas%2Ffmp4_audio_clear%252Cwebm_audio_clear%252Cfmp4_sd_hd_clear%252Cwebm_sd_hd_clear%2Fmv%2Fm%2Fms%2Fau%2Fsource%2Fyoutube%2Fmt%2F1399971692%2Fitag%2F0%2Fsparams%2Fas%252Ccmbypass%252Cid%252Cip%252Cipbits%252Citag%252Cplayback_host%252Csource%252Cexpire%2Fexpire%2F1399995998%2Fupn%2FsloiJFh6ezQ%2Fip%2F80.12.87.84%2Fsver%2F3%2Fcmbypass%2Fyes&logwatch=1&watch_ajax_token=QUFFLUhqbG9oSmF1dkVTLTV6YVg5Y2RhaUowMDQ3Wndxd3xBQ3Jtc0trVXlvYjZUVFI5TWlnbWE5SlZ4RU1FdmNWY1dZTWx1TVpfSnBhRk13QWdCcmc2SUFHY1JuQTZfTC1IQTUtanhxek1ReXlmQzZTQzFGdUpuLWxfWk9MY1VBaVYtRWtHTXZ1Z1lKQlZlMU8tUGN2Zl85aw%3D%3D&tk= |
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
#ifndef NS_DESIGNATED_INITIALIZER | |
#if __has_attribute(objc_designated_initializer) | |
#define NS_DESIGNATED_INITIALIZER __attribute((objc_designated_initializer)) | |
#else | |
#define NS_DESIGNATED_INITIALIZER | |
#endif | |
#endif |
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
--- | |
:verbose: true | |
:update_sources: true | |
gem: --no-rdoc --no-ri | |
:backtrace: false | |
:bulk_threshold: 1000 | |
:benchmark: false |