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
#!/bin/sh | |
# @author Pranav Prakash <pranny@gmail.com> | |
# | |
# this script is for easy use of OpenMVG | |
# | |
# usage : ./OpenMVG.sh image_dir output_dir | |
# | |
# image_dir is the input directory where images are located | |
# output_dir is where the project must be saved | |
# |
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
bool findConcaveHull(pcl::PointCloud <pcl::PointXYZRGB>::Ptr cloud, pcl::PointCloud <pcl::PointXYZRGB>::Ptr &hull) | |
{ | |
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud_projected (new pcl::PointCloud<pcl::PointXYZRGB>); | |
pcl::ModelCoefficients::Ptr coefficients (new pcl::ModelCoefficients); | |
pcl::PointIndices::Ptr inliers (new pcl::PointIndices); | |
// Create the segmentation object | |
pcl::SACSegmentation<pcl::PointXYZRGB> seg; | |
// Optional |
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
# Get all products in Spree | |
Spree::Product.all | |
# Get all variants of a single product | |
prod = Spree::Product.first | |
prod.variants | |
# Get the weight of a variant | |
v = prod.variants.first | |
v.weight |
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
# The ansible hosts file parser class | |
class AnsibleHostsFileParser | |
HOST_NAME_REGEX = /^\[(.*)\]$/ | |
IP_ADDR_REGEX = /^((?:[0-9]){1,3}\.){1,3}[0-9]{1,3}$/ | |
def self.load_hosts(hostsfile) | |
f = File.open(hostsfile) | |
t = f.read | |
f.close |
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 workaround (hackish) way to perform migrations using ORM style models | |
# and massive_record. Ideally, you shouldn't be using this because | |
# in massive_record ORM, tables are created (with column families) | |
# whenever you perform an action toward the database. However if you are unlucky | |
# and get stuck with issues like | |
# https://github.com/CompanyBook/massive_record/issues/95#issuecomment-246317908 | |
# this script provides a useful way to deal with it. | |
require 'activerecord' |