Skip to content

Instantly share code, notes, and snippets.

View scalp42's full-sized avatar
πŸͺ‚

Anthony Scalisi scalp42

πŸͺ‚
View GitHub Profile
I do apps for a living, and lots of the people I do apps for need to make companies. In addition to owning and operating a couple myself, I am often somewhat involved in the creation of others. There are many types of company you can make, and they each have different use cases and tax advantages and audit risks
Type one for small companies that do not expect to carry over losses very often, and do not need foreign ownership or venture capital:
LLC Filed federally as a C-corporation, promoted to a S-Corp shortly after founding for the purposes of taxes: This is what I have. You have to file taxes for it separately, but you largely do not pay tax directly from this for income taxes, but you don't have to do things like hold director meetings with yourself, or maintain minutes. You get the flexibility of a LLC operating agreement, and you can employ yourself easily as well. This form is also rarely audited, and the nature of the tax structure makes book keeping rather easy, taxes rather easy, and keeping your
@scalp42
scalp42 / paginate.rb
Created January 2, 2017 10:06 — forked from soveran/paginate.rb
Pagination helper for Ohm models.
def paginate(collection, options = {})
start = options[:start] || 0
limit = options[:limit] || 0
order = options[:order]
rest = collection.size > (start + limit)
page = collection.sort(order: order, start: start, limit: limit)
[rest, page]
end
@scalp42
scalp42 / signal_catching.rb
Created December 23, 2016 01:42 — forked from sauloperez/signal_catching.rb
How to catch SIGINT and SIGTERM signals in Ruby
# Signal catching
def shut_down
puts "\nShutting down gracefully..."
sleep 1
end
puts "I have PID #{Process.pid}"
# Trap ^C
Signal.trap("INT") {
@scalp42
scalp42 / gemfile_lock2geminabox.rb
Created November 4, 2016 23:43 — forked from flavio/gemfile_lock2geminabox.rb
Parse Gemfile.lock, download all gems from rubygems and then upload them to a local instance of geminabox
#!/usr/bin/env ruby
require 'rubygems'
require 'bundler'
require 'fileutils'
require 'net/http'
require 'net/https'
require 'uri'
TMP_DIR = "/tmp/gems"
@scalp42
scalp42 / gist:a59be769192cfabac109b45364a52010
Created September 22, 2016 00:07 — forked from acwright/gist:1944639
Sinatra / ActionMailer / Sendgrid / Heroku
require 'sinatra'
require 'action_mailer'
class Mailer < ActionMailer::Base
def contact
mail(
:to => "test@example.com",
:from => "test@example.com",
:subject => "Test") do |format|
format.text
@scalp42
scalp42 / autoverifier.js
Created August 11, 2016 22:49 — forked from sebastienvercammen/Code.gs
Nintendo PTC Account Verifier for Gmail (via Google Scripts)
/*
Automatically click all "Verify your email" links in the welcome e-mail from
Nintendo PokΓ©mon Trainer Club's signup e-mails.
All verified e-mails will be moved to trash unless you set "moveToTrash" to false.
How to use:
1. Login to Gmail
2. Go to https://script.google.com/
3. Enter the code, save, run.
@scalp42
scalp42 / README.md
Created March 25, 2016 18:39 — forked from nathanielks/README.md
Simple wrapper around terraform to manage multiple environments

This script will pull down an S3 remote configuration before running any terraform actions. Assumes the following structure:

main.tf
terraform.cfg
env/dev/vars
env/staging/vars
env/whatever/vars
env/whatever/somefile.tf
@scalp42
scalp42 / gist:ef420778d28f8d82adb1
Created March 14, 2016 23:15 — forked from tyler-ball/gist:f7c16e814265f34260e9
Test Kitchen Shared Examples

Create the following folder structure in your cookbook:

test
└── integrationq
    β”œβ”€β”€ helpers
    β”‚Β Β  β”œβ”€β”€ serverspec
    β”‚Β Β  β”‚Β Β  β”œβ”€β”€ shared_serverspec_tests
    β”‚Β Β  β”‚Β Β  β”‚Β Β  └── shared_tests2.rb
    β”‚Β Β  β”‚Β Β  └── spec_helper.rb
@scalp42
scalp42 / spec_helper.rb
Created March 14, 2016 21:28 — forked from hartmantis/spec_helper.rb
ChefSpec stubs for testing a recipe in isolation
require 'chefspec'
module SpecHelper
def global_stubs
# Don't worry about external cookbook dependencies
Chef::Cookbook::Metadata.any_instance.stub(:depends)
# Test each recipe in isolation, regardless of includes
@included_recipes = []
Chef::RunContext.any_instance.stub(:loaded_recipe?).and_return(false)