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 python | |
import cv2 | |
import os.path | |
import sys | |
import tqdm | |
def frames(reader, indices=None, desc=None): | |
frame_count = int(reader.get(cv2.cv.CV_CAP_PROP_FRAME_COUNT)) | |
if indices is None: | |
indices = xrange(0, frame_count) |
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
require 'set' | |
libs = Set.new | |
Gem::Specification.reject { |spec| spec.extensions.empty? }.each do |spec| | |
spec.extensions.each do |ext_path| | |
extconf_rb_path = Pathname.new(spec.gem_dir).join(ext_path) | |
makefile_path = extconf_rb_path.dirname.join('Makefile') | |
if makefile_path.readable? | |
last_was_lib_flag = false | |
makefile_path.readlines.map(&:strip).each do |line| |
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 | |
require 'optparse' | |
module CLI | |
extend self | |
PATHS_TO_CHECK = %w(app bin config engines lib script) | |
EXTENSIONS_TO_CHECK_FOR_DEFINITIONS = %w(.rb .rake) | |
EXTENSIONS_TO_CHECK_FOR_USAGE = EXTENSIONS_TO_CHECK_FOR_DEFINITIONS + %w(.yml .yaml .erb) |
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
class V1::WelcomeController < V1::ApplicationController | |
def index | |
respond_to do |format| | |
format.welcome { render plain: "testing v1" } | |
end | |
end | |
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
// Foo has outputs "bar" and "baz" | |
module "foo" { | |
source = "..." | |
arg1 = "spam" | |
arg2 = "eggs" | |
} | |
// If you want `terraform output` or your remote state to show the outputs of | |
// `module.foo` you need to "forward" them along here: | |
output "bar" { value = "${module.foo.bar}" } |
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
resource "aws_security_group_rule" "allow_all" { | |
count = "${length(split(",", var.security_group_ids))}" | |
type = "ingress" | |
from_port = 0 | |
to_port = 65535 | |
protocol = "tcp" | |
cidr_blocks = ["0.0.0.0/0"] | |
security_group_id = "${element(split(",", var.security_group_ids), count.index)}" |
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
// Directory layout | |
stacks/ | |
|__ us-east-1 | |
|__ test | |
|__ vpc | |
|__ services | |
|__ apps | |
|__ foo | |
|__ bar |
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
resource "terraform_remote_state" "region" { | |
backend = "s3" | |
config { | |
bucket = "foo" | |
key = "bar" | |
region = "us-east-1" | |
} | |
} | |
module "sub1_zone" { |
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
variable "instances" {} | |
variable "flavor" {} | |
variable "ami" {} | |
variable "ami_list" {} | |
resource "aws_instance" "default" { | |
count = "${var.instances}" | |
ami = "${var.ami}" | |
instance_type = "${var.flavor}" | |
} |
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
#include <array> | |
#include <chrono> | |
#include <iostream> | |
// Width of each dimension | |
constexpr size_t N = 200; | |
// Number of iterations for the test | |
constexpr size_t NUM_ITERATIONS = 100; |