Skip to content

Instantly share code, notes, and snippets.

View dgomesbr's full-sized avatar
🏠
Working from home

Diego Magalhães dgomesbr

🏠
Working from home
View GitHub Profile
@rponte
rponte / gist:1332286
Created November 1, 2011 23:39
Spring Advice: autowiring interface types rather than class types
There's another good reason to autowire interface types rather than class types, which is that if Spring needs
to generate a proxy object around the bean before injecting it, then if the bean's class defines any
interfaces, then the proxy will implement those interfaces, and will not be type-compatible with the bean class
itself. If you then try and autowire that bean by class type, it will fail. The easiest way to avoid this
annoying scenario is to always autowire by interface type, that way it will lways work as you expect.
http://stackoverflow.com/questions/5288153/using-spring-to-wire-directly-a-concrete-class
@samklr
samklr / TontonMartin.scala
Created September 27, 2012 10:24
ScalaFistes
object FuncourseWithUncleMartin{
*/
object Setsss{
def contains(s: Set, elem: Int): Boolean = s(elem)
def singleton(elem: Int): Set = Set(elem)//(x :Int) => x == elem
def union(s: Set, t: Set): Set = (x : Int) => s(x) || t(x)
@jpe42
jpe42 / JedipusBulkReplyOffLoading.java
Last active June 2, 2016 18:35
Bulk REPLY OFF Loading w/ Jedipus
private static int runWithJedipus(final IntStream keys) {
int count = 0;
try (final RedisClient client =
RedisClientFactory.startBuilding().create(Node.create("127.0.0.1", 6379))) {
client.sendCmd(Cmds.FLUSHALL);
final long start = System.currentTimeMillis();
@archie
archie / ddd_cqrs_es.md
Last active May 20, 2019 07:36
Draft blog post about ddd, cqrs, and es.

DDD, CQRS and Event Sourcing

In preparation for a new gig I'm reading up on the terms Domain-Driven Design, Command-Query Responsibility Segregation, and Event Sourcing. Here are a list of useful texts and talks that I've discovered so far. If anything is missing please leave a comment.

DDD

@cosmincatalin
cosmincatalin / install-rstudio-server.sh
Last active October 27, 2022 11:07
AWS EMR bootstrap to install RStudio Server along with sparklyr
#!/bin/bash
# These variables can be overwritten using the arguments below
VERSION="1.1.463"
# drwho is listed as user in YARN's Resource Manager UI.
USER="drwho"
# Depending on where the EMR cluster lives, you might have to change this to avoid security issues.
# To change the default password (and user), use the arguments bellow.
# If the cluster is not visible on the Internet, you can just leave the defaults for convenience.
PASS="tardis"
@bryanjswift
bryanjswift / UAgentInfo.java
Created March 1, 2010 09:43
User Agent detection in Java
/* *******************************************
// LICENSE INFORMATION
// The code, "Detecting Smartphones Using PHP"
// by Anthony Hand, is licensed under a Creative Commons
// Attribution 3.0 United States License.
//
// Updated 01 March 2010 by Bryan J Swift
// - Remove un-needed if statements instead just returning the boolean
// inside the if clause
//
@nuzayets
nuzayets / vax.js
Last active January 12, 2024 03:45
Automatically book 2nd & booster dose vaccine at closest location Ontario
/***
* Automated Vaccine Booker Thing
*
* I wish everything had an API.
*
* ____________________
* / PLEASE \
* ! READ !
* ! ENTIRELY !
* \____________________/
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active April 22, 2024 01:47
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@leonardofed
leonardofed / README.md
Last active April 24, 2024 01:47
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@SzymonPobiega
SzymonPobiega / gist:5220595
Last active April 25, 2024 17:19
DDD/CQRS/ES/Architecture videos

If you have two days to learn the very basics of modelling, Domain-Driven Design, CQRS and Event Sourcing, here's what you should do:

In the evenings read the [Domain-Driven Design Quickly Minibook]{http://www.infoq.com/minibooks/domain-driven-design-quickly}. During the day watch following great videos (in this order):

  1. Eric Evans' [What I've learned about DDD since the book]{http://www.infoq.com/presentations/ddd-eric-evans}
  2. Eric Evans' [Strategic Design - Responsibility Traps]{http://www.infoq.com/presentations/design-strategic-eric-evans}
  3. Udi Dahan's [Avoid a Failed SOA: Business & Autonomous Components to the Rescue]{http://www.infoq.com/presentations/SOA-Business-Autonomous-Components}
  4. Udi Dahan's [Command-Query Responsibility Segregation]{http://www.infoq.com/presentations/Command-Query-Responsibility-Segregation}
  5. Greg Young's [Unshackle Your Domain]{http://www.infoq.com/presentations/greg-young-unshackle-qcon08}
  6. Eric Evans' [Acknowledging CAP at the Root -- in the Domain Model]{ht