Skip to content

Instantly share code, notes, and snippets.

🏄
workinnn

Nick Weiland weilandia

🏄
workinnn
Block or report user

Report or block weilandia

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View roo_test_case.rb
# frozen_string_literal: true
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
View to_options_5-1.rb
# frozen_string_literal: true
require "pry"
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Activate the gem you are reporting the issue against.
View to_options_5-2.rb
# frozen_string_literal: true
require "pry"
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Activate the gem you are reporting the issue against.
View laptop.local
#!/bin/sh
brew bundle --file=- <<EOF
cask "slack"
cask "google-chrome"
cask "google-chrome-canary"
cask "atom"
cask "firefox"
cask "mongodb-compass"
cask "ngrok"
View headless_chrome_config.rb
Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(app, browser: :chrome)
end
Capybara.register_driver :headless_chrome do |app|
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
chromeOptions: { args: %w(headless disable-gpu) }
)
Capybara::Selenium::Driver.new(app, browser: :chrome, desired_capabilities: capabilities)
View sendgrid-mixpanel-package.json
{
"name": "sendgrid-webhook-to-mixpanel-lambda",
"version": "1.0.0",
"description": "A lambda function for tracking SendGrid events in Mixpanel",
"main": "index.js",
"license": "MIT",
"dependencies": {
"mixpanel": "^0.7.0",
"serverless-http": "^1.5.2"
},
View sendgrid-mixpanel-serverless.yml
service: sendgrid-webhook-to-mixpanel-lambda
provider:
name: aws
runtime: nodejs6.10
stage: ${opt:stage}
region: us-east-1
profile: your-profile
environment:
MIXPANEL_TOKEN: ${file(./serverless.env.yml):${self:provider.stage}.MIXPANEL_TOKEN}
View mpTrackSendGrid.js
const serverless = require('serverless-http');
const Mixpanel = require('mixpanel');
const mixpanel = Mixpanel.init(process.env.MIXPANEL_TOKEN);
function handler(event, context, callback) {
let body = JSON.parse(event.body);
let eventsTracked = 0;
body.forEach((sendGridEvent) => {
mixpanel.track('SendGrid: ' + sendGridEvent.event, sendGridEvent);
View ruby_sendgrid_tracked.rb
class Api::SendgridEventsController < Api::ApiController
def create
events = Integrations::SendgridEventsParser.new.track_events(params["_json"])
render json: events.to_json
end
end
class Integrations::SendgridEventsParser
def track_events(events)
events.each { |e|
View mod-4-exercism-comparisons.md

##Gigasecond My code: here

  • Alt Solution #1 (here) - This solution makes some interesting decisions that I'm not sure I agree with. They define Gigasecond, then use.prototype.date to return the solution. These could be merged into one function/constructor.

  • Alt Solution #2 (here) - This solution is pretty similar to mine, except it doesn't use exponents to decreate the gigasecond and it uses an extra line to define a variable called birthday.

  • Alt Solution #3 (here) - This solution is very similar to Alt Solution #1. I like about they used 10e11 instead of pow to define the gigasecond.

  • Alt Solution #4 (here) - This solution is interesting for a few reasons. First, they use

You can’t perform that action at this time.