Skip to content

Instantly share code, notes, and snippets.

View dav's full-sized avatar

Dav Yaginuma dav

View GitHub Profile
@dav
dav / media_mover.rb
Last active August 2, 2022 04:46
Script for copying Insta360 videos from device to a NAS drive, and renaming for Pigasus VR Viewing
require 'fileutils'
require 'digest'
class MediaMover
NAS_MEDIA_DIR = '/media/nas/video'
NAS_RAW_INCOMING_DIR = NAS_MEDIA_DIR + '/Incoming Raw Footage/Insta360'
INSTA360_MOUNT_POINT = '/media/dav/disk'
INSTA360_MEDIA_DIR = INSTA360_MOUNT_POINT + '/DCIM/Camera01'
def run
@dav
dav / coderpad.rb
Created April 7, 2022 17:50
A simple ruby test system (made for coderpad interviews)
# Coderpad with simple test system
# provides a few basic assertions and a test harness so you can at least test drive
# those silly interview puzzles that only ever come up in interviews and almost
# never in real work.
class Code
def sut(param1 = nil, param2 = nil)
return true
end
@dav
dav / gist:f7f469d47dcb745b14e0bd86cc52c8c1
Created November 12, 2020 14:21
heroku config to dotenv
In vim:
%s#\:\s\+#='#
%s/$/'/
gets you most of the way there
# bundle exec ruby scripts/combine-quickbooks-p-n-l.rb report-1.csv report-2.csv
#
# Run and export the two reports in Quickbooks, then feed into this script.
require 'csv'
class CombineQuickbooksPNL
def initialize(unspecified_csv_file, corporate_csv_file)
@unspecified_csv_file = unspecified_csv_file
@corporate_csv_file = corporate_csv_file
@dav
dav / qb_ruby.rb
Last active August 21, 2020 21:20
A test script using the QuickBooks Ruby gem
# frozen_string_literal: true
require 'quickbooks-ruby'
require 'launchy'
require 'yaml'
require 'text-table'
require 'pp'
require 'byebug'
Quickbooks.sandbox_mode = true
<?xml version="1.0" encoding="UTF-8"?>
<!-- Solr managed schema - automatically generated - DO NOT EDIT -->
<schema name="enterpriseSearch" version="1.6">
<uniqueKey>docType-identifier</uniqueKey>
<fieldType name="_bbox_coord" class="solr.TrieDoubleField" stored="false" docValues="true" precisionStep="8"/>
<fieldType name="alphaNumericSort" class="solr.TextField" omitNorms="true" sortMissingLast="false">
<analyzer>
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.TrimFilterFactory"/>
@dav
dav / create_link.rb
Created September 13, 2018 17:19
Ruby script for generating Shopify app install link from local ENV, .env or a heroku deploy
Verifying my Blockstack ID is secured with the address 19HZAtt3k2ydZVtqXjn5uGvXQZUYDjjwu6 https://explorer.blockstack.org/address/19HZAtt3k2ydZVtqXjn5uGvXQZUYDjjwu6
This message is a reminder to help you keep the contact data associated with your domain registration up-to-date.
According to ICANN's WHOIS Data Reminder Policy, as an accredited registrar, Moniker must present - at least annually - to the registrant the current WHOIS information, and remind the registrant that provision of false WHOIS information can be grounds for cancellation of their domain name registration.
Registrants must review their WHOIS data and make any corrections, if necessary.
@dav
dav / Change the Xcode New File Template Comment Blocks
Created January 9, 2016 05:19
A simple ruby script that backs up the original Xcode file templates and then changes the comment block at the top of each new file in Xcode with a different template.
require 'fileutils'
class ModifyXcodeFileTemplateCommentSections
XCODE_TEMPLATE_DIR="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File Templates"
ANNOYING_COMMENT_BLOCK = <<-EOB
//
// ___FILENAME___
// ___PROJECTNAME___
//