Skip to content

Instantly share code, notes, and snippets.

View samyouaret's full-sized avatar

Samy Ouaret samyouaret

View GitHub Profile
@victorcrbt
victorcrbt / Client.ts
Last active September 27, 2024 19:33
TypeORM ManyToMany relation with custom pivot table and column names.
import { Entity, PrimaryGeneratedColumn, Column, ManyToMany, JoinTable } from 'typeorm';
import Company from './Company';
@Entity('clients')
export default class Client {
@PrimaryGeneratedColumn()
id: number;
@Column()
@ArtDu
ArtDu / CMakeLists.txt
Last active February 25, 2022 17:41
CLION add compiler flag -pthread
//for c compiler
set(GCC_COVERAGE_COMPILE_FLAGS "-pthread")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}" )
//for c++
SET(CMAKE_CXX_FLAGS -pthread)
@zcaceres
zcaceres / Eyeballing-This.md
Last active August 17, 2023 23:38
Understanding Binding and 'this' in Javascript by zach.dev

How to Eyeball Your ‘This’ Context in Javascript

The early programmer struggles with the Javascript keyword this. But understanding your this context is easier than it seems.

This is all about where a function is invoked. Often, early programmers worry about where the function was declared. Perhaps the function was declared in a specific file or a particular object. Surely this changes it's this!

Nope.

@nrollr
nrollr / nginx.conf
Last active April 19, 2025 18:42
NGINX config for SSL with Let's Encrypt certs
# UPDATED 17 February 2019
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
listen [::]:80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
}
# SSL configuration
@adeekshith
adeekshith / .git-commit-template.txt
Last active October 20, 2024 21:10 — forked from Linell/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23