Skip to content

Instantly share code, notes, and snippets.

Horace Williams worace

Block or report user

Report or block worace

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
@melvic-ybanez
melvic-ybanez / akka_http_and_cats_validation.md
Last active Aug 3, 2019
Request Validation with Akka-HTTP and Cats
View akka_http_and_cats_validation.md

Request Validation with Akka-HTTP and Cats

Greg Beech wrote an article on Akka HTTP Entity Validation. This post is on the same topic, except we are going to use typeclass instances, as opposed to subtyping, for form validations.

Sample Problem: User Regsitration

To start with, let us suppose that we are working on some sort of user management service using Scala/Akka. However, here we are only going to focus on the registration part, in which the client is expected to send a user data, in JSON format; and the server needs to validate them, and save the user if the validations succeed, or reject the request with all the errors detected. That said, we should keep in mind that our validations may be used through out the entire codebase, not just in the user registration endpoint.

The rules for our validation are as follows:

@chrismccord
chrismccord / phx-1.4-upgrade.md
Last active Sep 20, 2019
Phoenix 1.3.x to 1.4.0 Upgrade Guides
View phx-1.4-upgrade.md

Phoenix 1.4 ships with exciting new features, most notably with HTTP2 support, improved development experience with faster compile times, new error pages, and local SSL certificate generation. Additionally, our channel layer internals receiveced an overhaul, provided better structure and extensibility. We also shipped a new and improved Presence javascript API, as well as Elixir formatter integration for our routing and test DSLs.

This release requires few user-facing changes and should be a fast upgrade for those on Phoenix 1.3.x.

Install the new phx.new project generator

The mix phx.new archive can now be installed via hex, for a simpler, versioned installation experience.

To grab the new archive, simply run:

@chriswhong
chriswhong / RadiusMode.js
Created Mar 1, 2018
RadiusMode, a custom mode for mapbox-gl-draw for drawing a radius
View RadiusMode.js
// custom mapbopx-gl-draw mode that modifies draw_line_string
// shows a center point, radius line, and circle polygon while drawing
// forces draw.create on creation of second vertex
import MapboxDraw from 'mapbox-gl-draw';
import numeral from 'numeral';
import lineDistance from 'npm:@turf/line-distance';
const RadiusMode = MapboxDraw.modes.draw_line_string;
@jpbecotte
jpbecotte / Vue-cli-3-Phoenix-1.3-HOWTO.md
Last active Aug 19, 2019
Vue-cli 3, Phoenix 1.3, a complete how-to
View Vue-cli-3-Phoenix-1.3-HOWTO.md

Introduction

I have been struggling to start a new project with Phoenix 1.3 and the new vue-cli 3 for Vue.js. There are tons of example already but none of them suited my needs, because:

  • I want to use the new Vue-cli to select the features that I want,
  • I do NOT want to setup Webpack (I know, what a shame!). The new Vue-cli includes the new vue-cli-service, which uses an instance of webpack-dev-server, so you don't have to import it manually in your project.
  • I do not want to use Brunch.

Create your Phoenix App

Assuming that you have Elixir and Phoenix 1.3 are both installed, let's build our new App.

View thread-pools.md

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.

@zimmicz
zimmicz / server.js
Created Aug 6, 2017
PostGIS MVT Express routing
View server.js
const express = require("express")
const app = express()
const { Pool } = require("pg")
const SphericalMercator = require("sphericalmercator")
const pool = new Pool({
host: "localhost",
port: 15432,
user: "postgres",
database: "postgres"
})
@klpx
klpx / splitEither.scala
Last active Jun 18, 2019
Akka Streams. Graph for Split Either[L,R] to L and R flows
View splitEither.scala
/**
Copy left Alexander Hasselbach
Usage:
val E = b.add(splitEither[Throwable,Int])
val parsed = b.add(Flow[Either[Throwable,Int]])
val valids = b.add(Flow[Int])
val invalids = b.add(Flow[Throwable])
View phalka-welcome.md

Welcome to Phalka Posse!

Mission: Create intentional independet positive change

Phalka at Turing:

  • Tuesdays: come eat lunch
  • Fridays: Spikes will be dedicated to project work time or speakers or panels

Phalka outside of Turing

  • As these events come up you'll be notified
@ikhoon
ikhoon / must-watch-talks.md
Last active Jul 19, 2019
Must watch talks - reddit /r/scala
View must-watch-talks.md
You can’t perform that action at this time.