Skip to content

Instantly share code, notes, and snippets.

View coderkan's full-sized avatar
🏠
Working from home

Erkan Güzeler coderkan

🏠
Working from home
View GitHub Profile
@aoudiamoncef
aoudiamoncef / DataLoaderConfig.java
Last active January 9, 2023 11:00
GraphQL Java Dataloader Redis generic Cachemap (Spring Boot 2 )
@Configuration
public class DataLoaderConfig {
@Autowired
private RedisCacheRepository<String, ObjectId, Home> homeByObjectIdCacheMapRepository;
@Autowired
private RedisCacheRepository<String, String, Home> homeByStringCacheMapRepository;
@Bean
public DataLoaderRegistry dataLoaderRegistry() {
@lisawolderiksen
lisawolderiksen / git-commit-template.md
Last active April 22, 2024 13:01
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@maludwig
maludwig / Application.java
Created November 12, 2018 06:45
Jackson deduping resolver
package hello;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
@biased-badger
biased-badger / Angular 8 HMR
Last active February 2, 2021 16:28
Angular 8 HMR
npm install --save-dev @angularclass/hmr
@shaielc
shaielc / HardwareSerial.cpp
Last active December 20, 2021 13:50
interrupt extension for UART
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include "HardwareSerial.h"
HardwareSerial Serial(0);
HardwareSerial::HardwareSerial(int uart_nr) : _uart_nr(uart_nr), _uart(NULL) {}
void HardwareSerial::setInterrupt(void(*arg)() )
@Havoc24k
Havoc24k / sync.py
Last active September 29, 2023 08:55
Import tables from one PostgreSQL database to another using the INFORMATION_SCHEMA
#!/usr/bin/python3.6
"""Sync PostgreSQL."""
import psycopg2
import sys
from psycopg2.extras import RealDictCursor, execute_values
"""
Usage:
@aziz-blr
aziz-blr / dropzone.js
Created August 1, 2017 08:39
custom events for dropzone including server side rendering & max files upload limit
$(function () {
// Get the template HTML and remove it from the doumenthe template HTML and remove it from the doument
var previewNode = document.querySelector("#referenceTemplate");
previewNode.id = "";
var previewTemplate = previewNode.parentNode.innerHTML;
previewNode.parentNode.removeChild(previewNode);
Dropzone.autoDiscover = false;
var myDropzone = new Dropzone(".uploadReference", {// Make the whole body a dropzone
url: "ajax/upload-file.php", // Set the url
@zakkak
zakkak / .git-commit-template
Last active March 21, 2024 14:26 — forked from adeekshith/.git-commit-template.txt
This commit message template that helps you write great commit messages and enforce it across your team.
# [<tag>] (If applied, this commit will...) <subject> (Max 72 char)
# |<---- Preferably using up to 50 chars --->|<------------------->|
# Example:
# [feat] Implement automated commit messages
# (Optional) Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# (Optional) Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@fernandohu
fernandohu / Reading configuration files before application startup in Angular2 final release.md
Last active May 8, 2023 16:40
Reading configuration files before application startup in Angular2 final release

Reading data before application startup in Angular 2

In this demonstration I will show you how to read data in Angular2 final release before application startup. You can use it to read configuration files like you do in other languages like Java, Python, Ruby, Php.

This is how the demonstration will load data:

a) It will read an env file named 'env.json'. This file indicates what is the current working environment. Options are: 'production' and 'development';

b) It will read a config JSON file based on what is found in env file. If env is "production", the file is 'config.production.json'. If env is "development", the file is 'config.development.json'.

@thomasdarimont
thomasdarimont / App.java
Last active October 27, 2023 07:44
Secure REST API Example with Spring Security, Spring Session, Spring Boot
package demo;
import java.io.Serializable;
import java.security.Principal;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;