Skip to content

Instantly share code, notes, and snippets.

@jacknie84
jacknie84 / prepare-commit-msg
Last active August 27, 2023 10:05
provide default jira issue message
#!/bin/sh
#
# An example hook script to prepare the commit log message.
# Called by "git commit" with the name of the file that has the
# commit message, followed by the description of the commit
# message's source. The hook's purpose is to edit the commit
# message file. If the hook fails with a non-zero status,
# the commit is aborted.
#
# To enable this hook, rename this file to "prepare-commit-msg".
@jacknie84
jacknie84 / email-validation.ts
Created July 24, 2022 03:00
Email Validation
export function isEmail(value: string) {
const splitPosition = value.lastIndexOf("@");
if (splitPosition < 0) {
return false;
}
const localPart = value.substring(0, splitPosition);
const domainPart = value.substring(splitPosition + 1);
if (!isEmailLocalPart(localPart)) {
return false;
}
@jacknie84
jacknie84 / QuerydslPredicateUtils.java
Created March 29, 2022 09:36
조건 별 Querydsl 쿼리 조건 생성 기능
import com.querydsl.core.types.dsl.BooleanExpression;
import org.springframework.lang.Nullable;
import org.springframework.util.ObjectUtils;
import java.util.Collection;
import java.util.Collections;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiFunction;
import java.util.function.BinaryOperator;
https://stackoverflow.com/questions/1057564/pretty-git-branch-graphs
@jacknie84
jacknie84 / cdn-inject-es5.js
Created March 6, 2020 08:28
cdn inject for es5
function injectCdnScript(cdnUrl) {
var script = document.createElement('script')
script.src = cdnUrl
script.onload = function(e) {
console.log('loaded cdn ' + cdnUrl)
}
var head = document.getElementsByTagName('head')[0]
head.appendChild(script)
}
@jacknie84
jacknie84 / gist:67113526bd8dc305d04877cc53938c62
Created February 9, 2020 11:10 — forked from digitaljhelms/gist:4287848
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
go modules: https://blog.puppyloper.com/menus/Golang/articles/Golang%EC%9D%98%20module%20system
build constraints: https://mcauto.github.io/back-end/2019/01/24/go-build-constraints/
data class Search(
var bounds: Bounds?,
var orders: List<Order>?,
var filters: List<Map<String, List<Map<Operator, String>>>>?
)
data class Bounds(
var limit: Long = 0,
var offset: Long = Long.MAX_VALUE
)
@jacknie84
jacknie84 / rest-api-rule.json
Last active January 1, 2020 10:46
Rest API Rules(Pagination, Filters)
{
"pagination": {
"bounds[offset]": {
"value": "int",
"validations": ["positiveOrZero"]
},
"bounds.limit": {
"value": "int",
"validations": ["positive"]
},
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(factory);
}
else if (typeof module === 'object' && module.exports) {
module.exports = factory();
}
else {
root.BufferedPayloadQueue = factory();
}