Skip to content

Instantly share code, notes, and snippets.

View ahmetcetin's full-sized avatar

Ahmet Cetin ahmetcetin

View GitHub Profile
@ahmetcetin
ahmetcetin / cache.ts
Created September 18, 2022 08:23 — forked from steveruizok/cache.ts
weak map gist
export class Cache<T extends object, K> {
items = new WeakMap<T, K>()
get<P extends T>(item: P, cb: (item: P) => K) {
if (!this.items.has(item)) {
this.items.set(item, cb(item))
}
return this.items.get(item)!
}
@ahmetcetin
ahmetcetin / DESIGN.md
Created April 22, 2021 10:43 — forked from yosriady/DESIGN.md
OAuth2 Authentication Microservices Design

Auth

Disclaimer

Creating an OAuth2 server is not a task that should be taken lightly. There are many security loopholes that could be exploited, and regular examinations are critical to handle possible vulnerabilities.

Introduction

Auth is an authentication microservice based on the OAuth2 identity delegation protocol.

@ahmetcetin
ahmetcetin / 1_kubernetes_on_macOS.md
Created January 31, 2021 15:27 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@ahmetcetin
ahmetcetin / cpm.js
Created March 4, 2020 14:50 — forked from perico/cpm.js
Critical Path Method Implementation Javascript
/**
* Implementation of the Critical Path Method (CPM) with variation
* @see http://en.wikipedia.org/wiki/Critical_path_method
*
* Shows all the critical Paths, returns a subset of the graph
* containing the critical activities
*/
/**
* Activity Class

Building Evolutionary Architectures

Chapter 1 - Software Architecture

Architecture is 'the important stuff, whatever that is' or 'the parts that are hard to change later'. An architect analyzes business, domain, and other requirements to develop solutions that satisfy a list of prioritized architectural characteristics (-ilities). We should consider time and change with respect to architecture, or evolvability.

Software ecosystems are in a state of dynamic equilibrium. New languages, tools, methods constant force new equilibriums to emerge (free OS, linux, + free operations, puppet, led to the shift to containers). The pace of change in technology is constantly and rapidly changing in unexpected ways. We should architect systems knowing the landscape will change. Make ease of change a principal of architecture, remove the 'hard to change' definition of architecture.

An evolutionary architecture supports guided, incremental change across multiple dimensions. Evolvability is a meta characteristic that

Keybase proof

I hereby claim:

  • I am ahmetcetin on github.
  • I am ahmetcetin (https://keybase.io/ahmetcetin) on keybase.
  • I have a public key whose fingerprint is 9E44 AA1B E2FB ADFA 6FA4 F20C A7E3 94F5 60CA C2A3

To claim this, I am signing this object:

@ahmetcetin
ahmetcetin / 01-override-User-model.js
Created April 18, 2016 09:43 — forked from pulkitsinghal/01-override-User-model.js
Strongloop/Loopback - Override User model via boot script
module.exports = function(app) {
var User = app.models.User;
// TODO: (1) find an example of how to add new "properties" to the built-in User mode via boot script
// (2) This is how you can add a "relationship" to the built-in User model via boot script
var SomeOtherModel = app.models.SomeOtherModel;
User.hasMany(SomeOtherModel, {as: 'someOtherModels', foreignKey: 'someOtherModelId'});
// (3) This is how you can add "remote methods" to the built-in User model via boot script
@ahmetcetin
ahmetcetin / .eslintrc.js
Created September 22, 2015 18:15 — forked from dmnsgn/.eslintrc.js
.eslintrc Google JavaScript Style Guide (eslint v0.24.1)
{
// http://eslint.org/docs/rules/
"env": {
"browser": true, // browser global variables.
"node": false, // Node.js global variables and Node.js-specific rules.
"worker": false, // web workers global variables.
"amd": false, // defines require() and define() as global variables as per the amd spec.
"mocha": false, // adds all of the Mocha testing global variables.
"jasmine": false, // adds all of the Jasmine testing global variables for version 1.3 and 2.0.
@ahmetcetin
ahmetcetin / .eslintrc
Created September 22, 2015 18:12 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names