This file contains hidden or 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/bash | |
for file in *.MP4; do | |
ffmpeg -i "$file" -an -c:v copy "${file%.MP4}_noaudio.MP4" | |
rm "$file" | |
done | |
for file in *.mp4; do | |
ffmpeg -i "$file" -an -c:v copy "${file%.mp4}_noaudio.MP4" | |
rm "$file" | |
done |
This file contains hidden or 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
def main | |
files = Dir.entries(".").sort | |
files.each do |file| | |
array = convert_file_to_sanitized_array(file) | |
array_for_file(file, array) unless array.empty? | |
end | |
end | |
def convert_file_to_sanitized_array(file) | |
array = [] |
This file contains hidden or 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
def main | |
files = Dir.entries(".").sort | |
files.each do |file| | |
array = convert_file_to_sanitized_array(file) | |
array_for_file(file, array) unless array.empty? | |
end | |
end | |
def convert_file_to_sanitized_array(file) | |
array = [] |
This file contains hidden or 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 'mysql2' | |
require 'securerandom' | |
require 'date' | |
@mysql_username = 'root' | |
@mysql_password = 'root' | |
@mysql_port = 3306 | |
@mysql_host = '1.1.1.1' | |
@database_name = 'foo_database' |
This file contains hidden or 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 'mysql2' | |
require 'securerandom' | |
require 'date' | |
@mysql_username = 'foo_username' | |
@mysql_password = 'foo_password' | |
@mysql_port = 3306 | |
@database_name = 'foo_database' | |
@number_of_transactions = 100 |
This file contains hidden or 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 'yaml' | |
def hash_ypath(ypath, hash, value=nil) | |
paths = ypath.split('.', 2) | |
actual_path = paths[0] | |
return if hash[actual_path].nil? | |
if paths.size == 1 | |
hash[actual_path] = value if value | |
return hash[actual_path] | |
end |
This file contains hidden or 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 'yaml' | |
def compare_yaml_hash(cf1, cf2, context = []) | |
cf1.each do |key, value| | |
if cf2.key?(key) | |
puts "Contains key : #{key} in path #{context.join(".")}" | |
end | |
value2 = cf2[key] | |
next unless value2 |