Skip to content

Instantly share code, notes, and snippets.

💭
🛠

Patrick Van Stee vanstee

💭
🛠
Block or report user

Report or block vanstee

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 coding_exercise.md

We expect this exercise to take about 1 hour to complete. You may choose any programming language, and you may use online references/documentation/etc just as you would in your normal programming. Assume that you are writing production-level code and be sure to include test cases.

Write a program to connect to a TCP server, running at palindromer-bd7e0fc867d57915.elb.us-east-1.amazonaws.com, TCP port 7777. The server uses a raw, line-oriented text protocol: this is not an HTTP server.

For each list of words that the server sends, your program should send back only the words that are palindromes (words whose letters are the same in reverse order).

For example, if the server sends:

zittmttiz xfiyisggdt rzainiazr moqwyke
@vanstee
vanstee / better.ex
Last active Aug 29, 2015
Chaining Ecto queries using a default query param
View better.ex
defmodule UserQueries do
def in_organization(query \\ User, organization) do
from u in query,
where: u.organization_id == ^organization.id
end
def in_patricks_family(query \\ User) do
from u in query,
where: u.last_name == ^"Van Stee"
end
@vanstee
vanstee / Makefile
Created May 28, 2015
Building frontend stuff with make
View Makefile
# Base dirs
SRC_DIR = src
TMP_DIR = tmp
DEV_DIR = dev
SRC_PUBLIC_DIR := $(SRC_DIR)/public
SRC_STYLES_DIR := $(SRC_DIR)/styles
SRC_SCRIPTS_DIR := $(SRC_DIR)/scripts
TMP_SCRIPTS_DIR := $(TMP_DIR)/scripts
DEV_PUBLIC_DIR := $(DEV_DIR)/public
DEV_STYLES_DIR := $(DEV_DIR)/styles
@vanstee
vanstee / gist:82d6514e63010c7a2956
Last active Aug 29, 2015
ugly-param-transform-ugh.rb
View gist:82d6514e63010c7a2956
class ApplicationController < ActionController::Base
def params
Parameters.new(super.deep_transform_keys(&:underscore))
end
end
View r_o_a_d_m_a_p.md

Roadmap

UGtastic is a service that connects user-group organizers with sponsorship opportunities. We seek to faciliate reliable and respectful communications and access for companies looking to connect with user-group communities.

We need to at a minimum provide a way for potential supporters to register and select sponsorship opportunities that can distribute those funds across user-group Builders

Terms

  • Builder: User-Group organizer, community manager.
  • Supporter: Paid sponsor for User-Groups communities. Could be a recruiter, marketing person, or hiring manager.
View example.md

Example singular request

curl -H "application/json" https://example.com/users/174835f6-cb96-4806-854e-c0eb6ae72d23

{
  "user": {
    "name": "Patrick Van Stee",
    "email": "patrick@vanstee.me"
  }
View retro.md

Known as the "Sticky Shotgun" approach. The tactical steps are:

  1. Give everyone a pad of stickies and marker.
  2. Take 5 minutes to write down whatever comes to mind from the release.
  3. Stick each sticky in correct "zone" on whiteboard. (Keep Doing. Less Of. More Of. Stop Doing. Start Doing.)
  4. Give a very quick explanation while adding it.
  5. Group the stickies in each zone into into affinity groups.
  6. Discuss each affinity group and try to identify what needs to be done to solve the issues; or what was done that makes them worth keeping.
  7. Vote on 2-3 most important issues so the team can prioritize/know what needs to be addressed first.
@vanstee
vanstee / import_confy.rb
Last active Aug 29, 2015
Import heroku env vars into confy
View import_confy.rb
require 'confyio'
CONFY_URL_REGEX = /https?:\/\/(?<org>.*):(?<password>.*)@api.confy.io\/orgs\/(?<org>.*)\/projects\/(?<project>.*)\/envs\/(?<env>.*)\/config/
confy_url = %x[heroku config | grep CONFY_URL].chomp.split(' ', 2).last
if confy_url.empty?
puts "Your CONFY_URL hasn't been set yet. Run `heroku addons:add confy` and try again."
exit 1
end
View sitemap.md
          +--------+
          |Homepage|
          +--------+
              +
              |
              v
          +-------+      +------+
          |Sign up|      |Log in| * Pick first account
          +-------+      +------+
View gist:7955209
Booking.where('LOWER(duration) > ?', 10.weeks.ago).
group("DATE_TRUNC('week', LOWER(duration))").
pluck("DATE_TRUNC('week', LOWER(duration)) AS week, COUNT(DISTINCT(bookings.*))")
You can’t perform that action at this time.