Skip to content

Instantly share code, notes, and snippets.

View D4v1X's full-sized avatar

David Santiago Barrera D4v1X

View GitHub Profile

Keybase proof

I hereby claim:

  • I am d4v1x on github.
  • I am d4v1x (https://keybase.io/d4v1x) on keybase.
  • I have a public key ASCREtwqoHBz5qAHd5Pfc554YkMYvuTzaffxibRvMngwYAo

To claim this, I am signing this object:

import java.util.concurrent.atomic.AtomicInteger
import java.util.concurrent.{Executors, ThreadFactory}
import cats.effect._
import cats.syntax.all._
import io.chrisdavenport.log4cats.SelfAwareStructuredLogger
import io.chrisdavenport.log4cats.slf4j.Slf4jLogger
import fs2._
import scala.concurrent.ExecutionContext
@D4v1X
D4v1X / IOMain
Last active June 12, 2019 23:53
Test with Scala Cats IO
import java.time.Instant
import java.util.concurrent.Executors
import cats.effect._
import cats.syntax.all._
import scala.concurrent.duration._
import scala.concurrent.{ExecutionContext, ExecutionContextExecutor}
import scala.util.{Failure, Success}
@D4v1X
D4v1X / DBUtils.scala
Created July 2, 2018 20:45
DBUtils Scala
package utils
import java.sql.Connection
import com.google.inject.Inject
import org.jooq.impl.DSL
import org.jooq.{DSLContext, SQLDialect}
import play.api.db.Database
import scala.concurrent.Future
@D4v1X
D4v1X / application.conf
Created July 2, 2018 20:42
application conf database
# Number of database connections
# See https://github.com/brettwooldridge/HikariCP/wiki/About-Pool-Sizing
# db connections = ((physical_core_count * 2) + effective_spindle_count)
fixedConnectionPool = 9
## Database Connection Pool
# https://www.playframework.com/documentation/latest/SettingsJDBC
play.db {
# The combination of these two settings results in "db.default" as the
# default JDBC pool:
@D4v1X
D4v1X / build.sbt
Created July 2, 2018 20:38
SBT v1.0
import play.sbt.routes.RoutesKeys
val strictScalacOptions = Seq(
"-deprecation", // Emit warning and location for usages of deprecated APIs.
"-encoding", "utf-8", // Specify character encoding used by source files.
"-explaintypes", // Explain type errors in more detail.
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
"-language:existentials", // Existential types (besides wildcard types) can be written and inferred
"-language:experimental.macros", // Allow macro definition (besides implementation and application)
"-language:higherKinds", // Allow higher-kinded types
@D4v1X
D4v1X / lcd.rb
Last active August 29, 2015 14:12
LCD Numbers, Ruby Quiz.
#File : lcd.rb
#Author David Santiago Barrera
#Size = 1
# - - - - - - - -
#| | | | | | | | | | | | | |
# - - - - - - -
#| | | | | | | | | | | | |
# - - - - - -
#Analisis number 0 with size 1
@D4v1X
D4v1X / Sublime Text 2.md
Last active August 29, 2015 14:12
Sublime Text 2

#Shortcut´s

  • Command + Shift + P [Package = Package Control Options]
  • Command + T [Change files in Sublime eg slesp:72]
  • Control + G [Line search (note: control)]
  • Command + R [Method search.]
  • Command + D [Select the next instance]
  • Command + / [Comment out (or in) the current line (or selection).]
  • Command + Shift + D [Duplicate the current line or selection]
  • Command + Option (Alt) + 2 [Switch to a 2 column layout]
  • Command + Option (Alt) + N [AdvancedNewFile]
@D4v1X
D4v1X / Installing Ruby and Rails using RVM, Homebrew and more on Mountain Yosemite 10.10.md
Last active August 29, 2015 14:11
Installing Ruby and Rails using RVM, Homebrew and more on Mountain Yosemite 10.10

#1. Install Xcode

In order to compile Ruby with RVM, as well as many Homebrew packages, you'll need a compilation toolchain. If you are doing Mac or iOS development, you may want to install Xcode in its entirety.

The first command we will run will serve to verify that Xcode successfully installed GCC:

gcc --version
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
@D4v1X
D4v1X / Installing Ruby, Rails, Git & Homebrew on Mountain Lion 10.8.2.md
Last active December 14, 2015 12:08
Installing Ruby, Rails, Git & Homebrew on Mountain Lion 10.8.2

#1. Install Command Line Tools 10.8 for Xcode

In order to compile Ruby with RVM, as well as many Homebrew packages, you'll need a compilation toolchain. If you are doing Mac or iOS development, you may want to install Xcode in its entirety. However if you don't want the hefty Xcode (1.8GB) on your system, the Command Line Tools are a good lightweight (110MB) alternative.

The Command Line Tools installer can be downloaded here (you'll need an Apple ID). After downloading, mount the disk image and run the installer.

The first command we will run will serve to verify that Xcode successfully installed GCC:

gcc --version