Skip to content

Instantly share code, notes, and snippets.

View dav's full-sized avatar

Dav Yaginuma dav

View GitHub Profile

Keybase proof

I hereby claim:

  • I am dav on github.
  • I am dav (https://keybase.io/dav) on keybase.
  • I have a public key whose fingerprint is 4C0B E5F1 E72A 2D93 0CB1 7DCA E6CA 6E5B 5202 4147

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am dav on github.
  • I am dav (https://keybase.io/dav) on keybase.
  • I have a public key whose fingerprint is 4C0B E5F1 E72A 2D93 0CB1 7DCA E6CA 6E5B 5202 4147

To claim this, I am signing this object:

describe(@"cardinalityPhraseWithNumber:singularPhrase:pluralPhrase:", ^{
it(@"should pluralize 0", ^{
NSString *phrase = [NSString cardinalityPhraseWithInteger:0 singularPhrase:@"bug" pluralPhrase:@"bugs"];
[[phrase should] equal:@"0 bugs"];
});
it(@"should singularize 1", ^{
NSString *phrase = [NSString cardinalityPhraseWithInteger:1 singularPhrase:@"bug" pluralPhrase:@"bugs"];
[[phrase should] equal:@"1 bug"];
});
@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___
//
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.
Verifying my Blockstack ID is secured with the address 19HZAtt3k2ydZVtqXjn5uGvXQZUYDjjwu6 https://explorer.blockstack.org/address/19HZAtt3k2ydZVtqXjn5uGvXQZUYDjjwu6
@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
<?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 / 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
# 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