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 'csv' | |
| require 'fileutils' | |
| require 'optparse' | |
| # example usage: ruby csv_splitter.rb ~/Downloads/accountant_sales_readiness_and_gusto_pro_jan28.csv | |
| # with options | |
| # ruby csv_splitter.rb -c 50000 -o output_folder <filename.csv> | |
| def split_csv(input_file:, output_dir:, chunk_size: 100_000, keep_headers: true) |
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
| Works with other engineers and Product to formulate project goals and feature specifications. | |
| Strong user knowledge of infrastructure tooling (CI, deployment, monitoring). | |
| Asks for help at appropriate points when stuck. | |
| Active participation in PR reviews. | |
| Create well-written, comprehensive tests. | |
| Domain expert with respect to applications / systems owned. | |
| Play key role in developing product roadmaps. | |
| Has deep understanding of customer & business needs. | |
| Make considered decisions when and how to integrate third party libraries and systems. | |
| Proactively communicates with stakeholders about issues affecting personal delivery of project. |
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 "faraday" | |
| require "byebug" | |
| require "json" | |
| require "nokogiri" | |
| require "open-uri" | |
| class ImagePopulator | |
| # class to wrap the API for Match Reverse Image Search | |
| # https://github.com/cleargraphinc/match |
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
| { | |
| "mainFilters" => [ | |
| { | |
| "label" => "dropdown", | |
| "value" => "custom_field_54d0020d67e6e25bab00000d", | |
| "showAdvanced" => true, | |
| "availableOptions" => ["54d0020d67e6e25bab00000a", "54d0020d67e6e25bab00000b"] | |
| }, { | |
| "label" => "Industry", | |
| "value" => "custom_field_558ad76667e6e23ca4000001", |
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
| { | |
| "mainFilters" => [ | |
| { | |
| "label" => "dropdown", | |
| "value" => "custom_field_54d0020d67e6e25bab00000d", | |
| "showAdvanced" => true, | |
| "availableOptions" => [ | |
| {"value" => "1", "label" => "Aaa"}, | |
| {"value" => "2", "label" => "2"} | |
| ] |
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
| # mongoid query to get post counts by body type | |
| def body_types | |
| @body_types = PostType.all.distinct(:body_type).sort | |
| end | |
| def body_type_count(body_type) | |
| post_type_ids = PostType.where(body_type: body_type).distinct(:id) | |
| Post.where(:post_type_id.in => post_type_ids, :synced_to_gallery_date.ne => nil).count | |
| 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 "faker" | |
| require "csv" | |
| def contact_row | |
| [ | |
| first_name, | |
| last_name, | |
| email, | |
| title, | |
| birthday |
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 "restforce" # Salesforce::SignedRequest needs restforce | |
| signed_request_string = "" # get a signed request string for this | |
| signed_request = Salesforce::SignedRequest.new(raw_request: signed_request_string) | |
| parsed_client = signed_request.parsed_request["client"] | |
| client = Restforce.new( | |
| oauth_token: parsed_client["oauthToken"], |
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
| # bundle exec rake wikiseed:star_wars SUBDOMAIN=jammies COUNT=1 | |
| require 'open-uri' | |
| require 'nokogiri' | |
| namespace :wikiseed do | |
| TYPE_MAPPINGS = { | |
| wikipedia: { | |
| category: 'Wikipedia', | |
| url: 'https://en.wikipedia.org/wiki/Special:Random', |
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
| class Crypto | |
| attr_reader :key, :length, :output | |
| AZ_INT_MAPPINGS = {"a"=>1, "b"=>2, "c"=>3, "d"=>4, "e"=>5, "f"=>6, "g"=>7, "h"=>8, "i"=>9, "j"=>10, "k"=>11, "l"=>12, "m"=>13, "n"=>14, "o"=>15, "p"=>16, "q"=>17, "r"=>18, "s"=>19, "t"=>20, "u"=>21, "v"=>22, "w"=>23, "x"=>24, "y"=>25, "z"=>26} | |
| def initialize(count) | |
| @length = count | |
| @key = generate_key | |
| end |
NewerOlder