Skip to content

Instantly share code, notes, and snippets.

View vicaba's full-sized avatar

vicaba

View GitHub Profile
@vicaba
vicaba / solid-lsp.scala
Created December 3, 2023 09:40
Liskov Substitution Principle in Scala
case class User(name: String, email: String)
val dummyUser = User("Dummy", "[email protected]")
// Not using LSP
object NotUsingLsp {
trait UserRepository {
def insert(user: User): Int
def read(id: Int): User
}
@vicaba
vicaba / docker-compose.yml
Created October 8, 2017 11:43 — forked from ahromis/docker-compose.yml
Gogs docker-compose.yml
version: '2'
services:
postgres:
image: postgres:9.5
restart: always
environment:
- "POSTGRES_USER=${POSTGRES_USER}"
- "POSTGRES_PASSWORD=${POSTGRES_PASSWORD}"
- "POSTGRES_DB=gogs"
volumes:
@vicaba
vicaba / GitHub-Forking.md
Created November 30, 2016 19:00 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, when I started going through the process of forking and issuing pull requests, I had some trouble figuring out the proper method for doing so and made quite a few mistakes along the way. I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your

@vicaba
vicaba / geo.js
Created September 13, 2016 12:21 — forked from mkhatib/geo.js
A Javascript utility function to generate number of random Geolocations around a center location and in a defined radius.
/**
* Generates number of random geolocation points given a center and a radius.
* @param {Object} center A JS object with lat and lng attributes.
* @param {number} radius Radius in meters.
* @param {number} count Number of points to generate.
* @return {array} Array of Objects with lat and lng attributes.
*/
function generateRandomPoints(center, radius, count) {
var points = [];
for (var i=0; i<count; i++) {