Skip to content

Instantly share code, notes, and snippets.

View boban100janovski's full-sized avatar
🎯

Boban Stojanovski boban100janovski

🎯
View GitHub Profile
@dhh
dhh / linux-setup.sh
Last active June 10, 2024 12:03
linux-setup.sh
# THIS LINUX SETUP SCRIPT HAS MORPHED INTO A WHOLE PROJECT: HTTPS://OMAKUB.ORG
# PLEASE CHECKOUT THAT PROJECT INSTEAD OF THIS OUTDATED SETUP SCRIPT.
#
#
# Libraries and infrastructure
sudo apt update -y
sudo apt install -y \
docker.io docker-buildx \
build-essential pkg-config autoconf bison rustc cargo clang \
@eneajaho
eneajaho / config.md
Last active May 27, 2024 21:51
Angular ESLint & Prettier Configuration

Install Angular ESLint

ng add @angular-eslint/schematics

Install Prettier and Prettier-ESLint dependencies

npm install prettier prettier-eslint eslint-config-prettier eslint-plugin-prettier --save-dev

ESLint configuration

Filename: .eslintrc.json

@danielhunex
danielhunex / hosted-services-dotnet-core.md
Last active February 21, 2023 20:48
Hosted Services in .Net Core
 
public class HelloContext
{
   private ISomething _smh ; 
     void Foo(string key)
    {
       switch(key)
        {
 case "A":
@samsch
samsch / stop-using-jwts.md
Last active May 26, 2024 19:07
Stop using JWTs

Stop using JWTs!

TLDR: JWTs should not be used for keeping your user logged in. They are not designed for this purpose, they are not secure, and there is a much better tool which is designed for it: regular cookie sessions.

If you've got a bit of time to watch a presentation on it, I highly recommend this talk: https://www.youtube.com/watch?v=pYeekwv3vC4 (Note that other topics are largely skimmed over, such as CSRF protection. You should learn about other topics from other sources. Also note that "valid" usecases for JWTs at the end of the video can also be easily handled by other, better, and more secure tools. Specifically, PASETO.)

A related topic: Don't use localStorage (or sessionStorage) for authentication credentials, including JWT tokens: https://www.rdegges.com/2018/please-stop-using-local-storage/

The reason to avoid JWTs comes down to a couple different points:

  • The JWT specification is specifically designed only for very short-live tokens (~5 minute or less). Sessions
@matdcooper
matdcooper / gitflow-cheatsheet.md
Created January 10, 2019 14:50
Git-Flow Cheat-Sheet

Creating git repo

  • Create directory
  • Go into new directory
  • Create bare repo
    • git init --bare
  • Clone repo somewhere
    • git clone <repo>
  • Go into repo folder
  • Create .gitignore file
@qoomon
qoomon / conventional_commit_messages_cheatsheet.md
Last active June 10, 2024 06:52
Conventional Commit Messages - Cheatsheet

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@nrobinaubertin
nrobinaubertin / app.component.ts
Created January 17, 2017 13:36
Exemple of ngb-date-parser-formatter implementation (ng-bootstrap)
import { NgbDatepickerConfig, NgbDateParserFormatter } from '@ng-bootstrap/ng-bootstrap';
import { NgbDateFRParserFormatter } from "./ngb-date-fr-parser-formatter"
@Component({
providers: [{provide: NgbDateParserFormatter, useClass: NgbDateFRParserFormatter}]
})
export class AppComponent {}
[CmdletBinding(SupportsShouldProcess)]
param (
# Only one of these may be used.
[Parameter(ParameterSetName='Major')]
[switch]$Major,
[Parameter(ParameterSetName='Minor')]
[switch]$Minor,
[Parameter(ParameterSetName='Patch')]
[switch]$Patch,
[Parameter(ParameterSetName='Version')]
@adamrecsko
adamrecsko / highlight.pipe.ts
Created May 1, 2016 20:28
Angular2 text highlight pipe
import {PipeTransform, Pipe} from 'angular2/core';
@Pipe({ name: 'highlight' })
export class HighLightPipe implements PipeTransform {
transform(text: string, [search]): string {
return search ? text.replace(new RegExp(search, 'i'), `<span class="highlight">${search}</span>`) : text;
}
}
/** Usage:
@gorangajic
gorangajic / es6-spread-immutable-cheatsheet.md
Last active April 11, 2024 08:32
es6 spread immutable cheatsheet

update object

var state = {
    id: 1,
    points: 100,
    name: "Goran"
};

var newState = {