Skip to content

Instantly share code, notes, and snippets.

Difference between a Factory, Provider and a Service?


Factory: Assembles classes, either by composing a bunch of bits together, or choosing type based on some kind of context

Provider: Provider is something microsoft "invented" (basically an abstract factory pattern) that is a way of doing a factory of factories, or having a common factory interface which allows factories to be swappable. It is used all over in the MS web stack as a way to keep components configurable.

Service: A service is a group of related functionality. Think of it as if you are splitting your architecture horizontally, you have a "Business Logic" layer, if you split that vertically you will have services.
@ryu1
ryu1 / find_gid_and_chown_group.sh
Last active December 21, 2020 05:01
There are shellscripts for changing ower of files or directories..
#/bin/bash
# Finds the object with the specified group ID and changes the owning group.
# _gid : Group ID that remains unchanged
# _grp : Group name you want to change
find_gid_and_chown_group() {
_gid=${1}
_grp=${2}
_buf_ifs=${IFS}
IFS=
@ryu1
ryu1 / HowToInstallMavenToEclipse.md
Last active October 20, 2020 08:19
How To Install Maven To Eclipse

How To Install Maven

Maven Central Repository は、現在、TLSv1.2でないと接続できなくなりました。

JDK1.7(を含めて)以前のバージョンで、Mavenビルドを実行している環境では、デフォルトでは、JDKがTLSv1.2をサポートしていないため、以下のようなエラーが発生していることと思います。

Received fatal alert: protocol_version -> [Help 1]
@ryu1
ryu1 / HowToDisableESET.MD
Last active August 11, 2024 09:22
ESET セキュリティソフトの有効/無効

ESET セキュリティソフトの有効/無効

ときおり、邪魔になるセキュリティソフトを一時的に無効にしたいときに使用する.

Disable

$ sudo killall esets_gui
$ sudo launchctl unload /Library/LaunchDaemons/com.eset.esets_daemon.plist
$ sudo launchctl unload /Library/LaunchDaemons/com.eset.esets_pidmapper.plist
$ sudo launchctl unload /Library/LaunchDaemons/com.eset.remoteadministrator.agent_daemon.plist
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "VPC knowhow template",
"Parameters": {
"KeyName": {
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances",
"Type": "String",
"MinLength": "1",
"MaxLength": "64",
"AllowedPattern": "[-_ a-zA-Z0-9]*",
@ryu1
ryu1 / Makefile
Last active March 26, 2020 07:02
JMeter Master/Slave CloudFormation Template. It is called fullbok by some people.
# ENVIRONMENT=development
STACKNAME=
PROFILE=
S3_BUCKET=
S3_PREFIX=
.PHONY: default
default: deploy
@ryu1
ryu1 / generate-dummy-csv.sh
Created March 13, 2020 07:52
This script can generate dummy CSV file.
#!/bin/bash
echo `date`" start"
for i in `seq 0 7000000`
do
year=$((RANDOM%8+2012))
month=$((RANDOM%12+1))
day=$((RANDOM%29+1))
hour=$((RANDOM%24))
min=$((RANDOM%60))
@ryu1
ryu1 / HowToInstallSHC.md
Last active March 17, 2020 07:11
This shell script can import CSV file to MySQL Table.

How To Install SHC

Amazon Linux

# yum install gcc cc
# wget https://github.com/neurobin/shc/archive/release.zip
# unzip release.zip
# cd shc-release/
@ryu1
ryu1 / hostnamechanger.sh
Created February 13, 2020 02:59
Shell Script Changing Host Name.
#!/bin/bash
# ------------------------------------------------------------------
# [Author] Title
# Description
# ------------------------------------------------------------------
SUBJECT=some-unique-id
VERSION=0.1.0
USAGE="Usage: command -hv args"
@ryu1
ryu1 / macaddrchanger.sh
Created February 13, 2020 02:42
Shell Script Chainging MAC Address.
#!/bin/bash
# ------------------------------------------------------------------
# Change MAC Adress For MacOS
# ------------------------------------------------------------------
SUBJECT=macaddrchanger
VERSION=0.1.0
USAGE="Usage: [random|origin] -hv args"
# --- Option processing --------------------------------------------