Skip to content

Instantly share code, notes, and snippets.

View vroy's full-sized avatar

Vincent Roy vroy

View GitHub Profile
@vroy
vroy / example with retries
Created March 20, 2019 19:55
Eventual consistency issues in aws_instance
2019-03-20T18:57:29.380Z [DEBUG] plugin.terraform-provider-aws_v1.49.0_x4: Action=RunInstances&...
2019-03-20T18:57:30.434Z [DEBUG] plugin.terraform-provider-aws_v1.49.0_x4: 2019/03/20 18:57:30 [INFO] Instance ID: i-00afe6a31ade489c6
2019-03-20T18:57:30.434Z [DEBUG] plugin.terraform-provider-aws_v1.49.0_x4: 2019/03/20 18:57:30 [DEBUG] Waiting for instance (i-00afe6a31ade489c6) to become running
2019-03-20T18:57:40.434Z [DEBUG] plugin.terraform-provider-aws_v1.49.0_x4: Action=DescribeInstances&InstanceId.1=i-00afe6a31ade489c6&Version=2016-11-15
2019-03-20T18:57:40.607Z [DEBUG] plugin.terraform-provider-aws_v1.49.0_x4: HTTP/1.1 200 OK
2019-03-20T18:57:40.607Z [DEBUG] plugin.terraform-provider-aws_v1.49.0_x4: 2019/03/20 18:57:40 [INFO] Modifying `source_dest_check` on Instance i-00afe6a31ade489c6
@vroy
vroy / example: error on DescribeInstanceCreditSpecifications
Last active March 20, 2019 19:55
Logs: Eventual consistency issues in aws_instance
2019-03-19T14:16:31.863Z [DEBUG] plugin.terraform-provider-aws_v1.49.0_x4: Action=RunInstances&...
2019-03-19T14:16:32.998Z [DEBUG] plugin.terraform-provider-aws_v1.49.0_x4: HTTP/1.1 200 OK
2019-03-19T14:16:32.998Z [DEBUG] plugin.terraform-provider-aws_v1.49.0_x4: 2019/03/19 14:16:32 [INFO] Instance ID: i-0d77afea64d009a21
2019-03-19T14:16:32.998Z [DEBUG] plugin.terraform-provider-aws_v1.49.0_x4: 2019/03/19 14:16:32 [DEBUG] Waiting for instance (i-0d77afea64d009a21) to become running
2019-03-19T14:16:42.998Z [DEBUG] plugin.terraform-provider-aws_v1.49.0_x4: Action=DescribeInstances&InstanceId.1=i-0d77afea64d009a21&Version=2016-11-15
2019-03-19T14:16:43.140Z [DEBUG] plugin.terraform-provider-aws_v1.49.0_x4: HTTP/1.1 200 OK
2019-03-19T14:16:43.141Z [DEBUG] plugin.terraform-provider-aws_v1.49.0_x4: 2019/03/19 14:16:43 [INFO] Modifying `source_dest_check` on Instance i-0d77afea64d009a21
@vroy
vroy / extract.rb
Last active August 29, 2015 14:08
A simple utility to extract patterns out of input streams
#!/usr/bin/env ruby
# A simple utility to extract patterns out of input streams
#
# Heavily inspired by:
# http://jstorimer.com/2011/12/12/writing-ruby-scripts-that-respect-pipelines.html
# https://gist.github.com/jstorimer/1465437
#
# Examples:
#
@vroy
vroy / keybase.md
Last active August 29, 2015 14:03

Keybase proof

I hereby claim:

  • I am vroy on github.
  • I am vroy (https://keybase.io/vroy) on keybase.
  • I have a public key whose fingerprint is 7D82 60F2 2D92 C5F7 84DA D429 D86C 8DBD 307A FE90

To claim this, I am signing this object:

module PublicDraftHelpers
def published(articles)
if development?
articles
else
articles.reject{|a| a.data.public_draft }
end
end
@vroy
vroy / output
Created October 27, 2013 14:33
Feedback for https://twitter.com/mpapis/status/394350450842943489 (after a recent update to mavericks)
$ clang --version; sudo softwareupdate -l
Apple LLVM version 5.0 (clang-500.2.76) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
Password:
Software Update Tool
Copyright 2002-2012 Apple Inc.
Finding available software
No new software available.
@vroy
vroy / stringify-wat.js
Created May 3, 2013 16:31
Keys with an undefined value are not included in JSON.stringify? http://cl.ly/image/3c0U000Z2m20 I know that undefined is not the same as null, but I find it odd nonetheless.
> var x = { foo: undefined }
undefined
> x
Object {foo: undefined}
> JSON.stringify(x)
"{}"
@vroy
vroy / index.html
Created August 21, 2012 01:27
Why is the text-decoration rule of p:after ignored?
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
p {
color: blue;
text-decoration: line-through;
}
p:after {
content:"- Remember this";
@vroy
vroy / Question
Created September 1, 2011 01:56
Jetpack - Change window location from content script.
Using the addon-sdk from github.com/mozilla/addon-sdk with this patch applied: https://bugzilla.mozilla.org/attachment.cgi?id=555753&action=edit
As you can see in the output, the location does seem to change but when I hit facebook.com and the output shows that I should be on google.com, I still see facebook.com. Is it possible to change the location of a page from within the page-mod's content script?
I would also like to point out that window.location.host returns undefined. I thought it would make sense that window.location in the context of a content script should return a standard Location object as described by the MDN docs: https://developer.mozilla.org/En/Window.location#Location_object
I'm guessing the workaround is to send messages to the add-on code and use the tabs API but I would rather avoid that to keep my extension code as much similar to other browser extensions as possible.
@vroy
vroy / Explanation
Created August 25, 2011 01:18
Jetpack - How to stop a contentscript setInterval?
It seems that the content script of a page-mod continues to execute even when a tab is closed/detached.
As you can see in this example output, I opened two tabs. Every second the content script outputs the tab_id received and the current time. I only closed the second tab. I have two problems:
1 - I don't understand why the "Detached a tab" message appeared twice while only one tab was closed. Anybody can explain this behavior or confirm that it's a bug?
2 - The two intervals that were started in the content script continued to run. I expected that the content script would stop executing completely when a tab was closed/detached. How do I make sure that the content script stops executing completely when a tab is closed/detached?