Skip to content

Instantly share code, notes, and snippets.

@doppiomacchiatto
doppiomacchiatto / LettuceRedisClientConnectionPooling.java
Created August 31, 2021 16:17 — forked from riteshmodi/LettuceRedisClientConnectionPooling.java
Lettuce Redis Connection pooling through Spring RedisTemplate
import org.apache.commons.pool.impl.GenericObjectPool.Config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.connection.lettuce.DefaultLettucePool;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
@Component
public class LettuceRedisClientConnectionPooling {
@doppiomacchiatto
doppiomacchiatto / Dockerfile
Created March 30, 2021 14:19 — forked from Manikandan-K/Dockerfile
alpine gradle chrome
FROM alpine:3.13
CMD ["/bin/sh"]
ENV LANG=C.UTF-8
RUN { echo '#!/bin/sh'; echo 'set -e'; echo; echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; } > /usr/local/bin/docker-java-home && chmod +x /usr/local/bin/docker-java-home
ENV JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin
ENV JAVA_VERSION=8u282
ENV JAVA_ALPINE_VERSION=8.282.08-r0
RUN set -x && apk add --no-cache openjdk8 && [ "$JAVA_HOME" = "$(docker-java-home)" ]
RUN apk update
@doppiomacchiatto
doppiomacchiatto / -Terminal and Oh My Zsh.md
Created October 9, 2020 14:13
OS X Terminal and Oh My Zsh configuration

Readme

  • Install Oh My Zsh
    • Add the theme file martinbuberl.zsh-theme to ~/.oh-my-zsh/themes
    • Open the configuration file ~/.zshrc (via Terminal $ ls -al and $ subl .zshrc)
      • Set theme to ZSH_THEME=martinbuberl
      • Set plugins to plugins=(bower brew git npm nyan sublime)
  • Import/Use with Terminal profile martinbuberl.terminal
  • Type upgrade_oh_my_zsh to update Oh My Zsh
  • Type touch .hushlogin to remove the "Last login" message
@doppiomacchiatto
doppiomacchiatto / zshenv.sh
Created August 27, 2020 00:56 — forked from wisq/zshenv.sh
My zshrc & zshenv
# Custom PATH to avoid every utility prepending more duplicate entries to it:
export PATH="$HOME/bin:$HOME/.rbenv/shims:$HOME/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

Salesforce OAuth 2.0 JWT Bearer Token Flow Walk-Through

This document will walk you through how to create or configure a Salesforce application for use with JWT authentication. These configuration steps and the example code works as of Salesforce API version 42.0.

Prerequisites

Create an RSA x509 private key/certification pair

@doppiomacchiatto
doppiomacchiatto / docker-clean.sh
Created March 20, 2020 19:42 — forked from GnsP/docker-clean.sh
Clean docker space for mac osx
#!/bin/bash
# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs docker rm -v
# remove unused images:
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs docker rmi
# remove unused volumes:
docker volume ls -qf dangling=true | xargs docker volume rm

Build docker image

$ cd /path/to/Dockerfile
$ sudo docker build .

View running processes

Build docker image

$ cd /path/to/Dockerfile
$ sudo docker build .

View running processes

@doppiomacchiatto
doppiomacchiatto / Integration_BasicAuthRestCallout.cls
Created March 9, 2020 21:51
This is a quick overview of an Apex REST Callout using Basic Authentication from within Salesforce
// Method to perform callouts
public String MakeCallout(string description, string keyToVerify){
// define a response to caller
String outcomeMsg;
// define basic information for later, store these in a protected custom setting
string endpoint = 'http://api.yourendpoint.com/'; // be sure this is configured in "Remote Site Settings"
string resource = 'products/';
string username = 'api_user';