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
Legal pages go into components/Legal/Foo | |
process from updating from google doc / word: | |
* save google docs as docx | |
* open in word, save as html, webpage, filtered | |
* copy + paste html into html formatter to cleanup (like * https://webformatter.com/html, use 2 spaces) | |
* copy html into <template> | |
* move <style> in head into: | |
<style lang="css" scoped> |
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
# https://stackoverflow.com/questions/47480803/construct-nested-openstruct-object | |
require 'json' | |
private def deep_openstruct(hash) | |
JSON.parse(hash.to_json, object_class: OpenStruct) | |
end |
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
>> $LOAD_PATH << "." | |
=> ["/Users/smtlaissezfaire/.rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/did_you_mean-1.3.0/lib", "/Users/smtlaissezfaire/.rvm/rubies/ruby-2.6.6/lib/ruby/site_ruby/2.6.0", "/Users/smtlaissezfaire/.rvm/rubies/ruby-2.6.6/lib/ruby/site_ruby/2.6.0/x86_64-darwin20", "/Users/smtlaissezfaire/.rvm/rubies/ruby-2.6.6/lib/ruby/site_ruby", "/Users/smtlaissezfaire/.rvm/rubies/ruby-2.6.6/lib/ruby/vendor_ruby/2.6.0", "/Users/smtlaissezfaire/.rvm/rubies/ruby-2.6.6/lib/ruby/vendor_ruby/2.6.0/x86_64-darwin20", "/Users/smtlaissezfaire/.rvm/rubies/ruby-2.6.6/lib/ruby/vendor_ruby", "/Users/smtlaissezfaire/.rvm/rubies/ruby-2.6.6/lib/ruby/2.6.0", "/Users/smtlaissezfaire/.rvm/rubies/ruby-2.6.6/lib/ruby/2.6.0/x86_64-darwin20", "."] | |
>> require 'fakefs' | |
=> true | |
>> File.touch("foo") | |
Traceback (most recent call last): | |
4: from /Users/smtlaissezfaire/.rvm/rubies/ruby-2.6.6/bin/irb:23:in `<main>' | |
3: from /Users/smtlaissezfaire/.rvm/rubies/ruby-2.6.6/bin/irb:23:in `load' | |
2: from /Users/smtlaiss |
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
$ irb -r './hash_shorthand.rb' | |
>> x = 10 | |
>> y = 20 | |
>> | |
>> puts hash_shorthand(binding, :x, :y) | |
{:x=>10, :y=>20} |
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
/Users/smtlaissezfaire/.atom (master)$ apm install find-and-replace@0.218 | |
The find-and-replace package is bundled with Atom and should not be explicitly installed. | |
You can run `apm uninstall find-and-replace` to uninstall it and then the version bundled | |
with Atom will be used. | |
/Users/smtlaissezfaire/.atom (master)$ apm uninstall find-and-replace | |
Uninstalling find-and-replace ✗ | |
Failed to delete find-and-replace: No package.json found at /Users/smtlaissezfaire/.atom/packages/find-and-replace/package.json |
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
#!/usr/bin/env ruby | |
name = ARGV[0] | |
verbose = ARGV[1] == "--verbose" | |
if name.nil? || name.empty? | |
puts "" | |
puts "\tUsage: migration_before <migration_name> [--verbose]" | |
puts "" | |
puts "\tLookup migration by file name, then get the version number (rails). " |
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
# partially taken from https://dalibornasevic.com/posts/68-processing-large-csv-files-with-ruby | |
# thanks! | |
require 'csv' | |
require 'benchmark' | |
require 'tempfile' | |
def print_memory_usage | |
memory_before = `ps -o rss= -p #{Process.pid}`.to_i | |
yield |
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
Notes from FI/RE Meetup - Jan 20, 2019 | |
Lively - HSA - https://livelyme.com/ | |
ADU = Accessory Dwelling Units | |
Vicki Robin - https://vickirobin.com/ | |
William Burnstein - https://www.amazon.com/Personal-Finance-William-J-Bernstein/s?ie=UTF8&page=1&rh=n%3A2717%2Cp_lbr_one_browse-bin%3AWilliam%20J.%20Bernstein ? |
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
# monkey patch to get uncompleted tasks from asana | |
# call with: | |
# options = { | |
# params: { completed_since: 'now' } | |
# } | |
# Asana::Resources::Task.find_by_project(client, projectId: project.id, options: options).each do |task| | |
# ... | |
# end | |
Asana::Resources::Task.module_eval do |
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
/Users/smtlaissezfaire/src/git/onpoint/ui-on-rails (master)$ irb | |
clas>> class A | |
>> def foo | |
>> 1 | |
>> end | |
>> alias_method :bar, :foo | |
>> end | |
=> A | |
>> class B < A | |
>> def foo |
NewerOlder