Skip to content

Instantly share code, notes, and snippets.

View Elyorbe's full-sized avatar
🏓

Elyorbek Ibrokhimov Elyorbe

🏓
View GitHub Profile
<template>
<div class="columns">
<div class=" field column is-3">
<label class="label">대 카테고리<span v-if="isRequired">*</span></label>
<multiselect v-model="firstLevelCategory" track-by="id" label="name" placeholder="대 가테고리 검색"
:options="firstLevelCategories" :show-labels="false" :searchable="true" :allow-empty="false">
<span slot="noResult">검색 결과가 없습니다</span>
<span class="multiselect__tag-custom-icon mdi mdi-chevron-down" slot="caret"></span>
</multiselect>
<div v-if="isRequired && $v.firstLevelCategory.$invalid" class="help is-danger">대 카테고리를 선택해주세요</div>
@Elyorbe
Elyorbe / RoleRepository.java
Created January 3, 2023 05:59
MyBatis and Spring Data JDBC. Check out `@EnableJdbcRepositories`
@Repository
public class RoleRepository {
private MyBatisMapper mapper;
private RoleCrudRepository crud;
@Mapper
public interface MyBatisMapper {
Optional<Role> selectByDescription();
}
console.log("___________TRACKING______________");
const iframe = document.getElementsByTagName('iframe')[0]
const myPlayer = new Vimeo.Player(iframe);
// const iframe = null;
if (iframe) {
console.log('[elyor] iframe exists');
const player = new Vimeo.Player(iframe);
const url = iframe.getAttribute("src").split('?')[0];
const vimeoId = extractVimeoId(url);
fetchLastWatchProgress(vimeoId).then((data) => {
@Elyorbe
Elyorbe / vimeo.js
Last active December 23, 2022 12:05
const iframe = document.getElementsByTagName('iframe')[0]
if (iframe) {
const player = new Vimeo.Player(iframe);
const url = iframe.getAttribute("src").split('?')[0];
const vimeoId = extractVimeoId(url);
updateCurrentPlayerTime(vimeoId, player);
trackWatchProgress(vimeoId, player);
}
function updateCurrentPlayerTime(vimeoId, player) {
@Elyorbe
Elyorbe / ReactiveRequestContextFilter.java
Created October 27, 2022 08:22
RequestContextHolder support for reactive Spring Applications
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.server.WebFilter;
import org.springframework.web.server.WebFilterChain;
import reactor.core.publisher.Mono;
@Elyorbe
Elyorbe / ModifiableHttpServletRequestWrapper.java
Created October 26, 2022 09:13
Useful for adding query params
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
/**
* Provides a way to add query parameters to a request
* */
@Elyorbe
Elyorbe / spring-boot-run.sh
Created January 11, 2022 07:31
Sample shell script file to start and stop spring boot jar files
PID_FILE="$(pwd)/api-server.pid"
JAVA_HOME=/usr/lib/jvm/java-11/
JVM_OPTIONS="-Xms512M -Xmx1G -XX:+UseParallelGC"
JAR_FILE="api-server.jar"
SPRING_CONF_DIR="-Dspring.config.additional-location=$(pwd)/conf/ "
SPRING_ACTIVE_PROFILE="-Dspring.profiles.active=dev "
SPRING_OPTIONS="$SPRING_CONF_DIR$SPRING_ACTIVE_PROFILE"
case "$1" in
@Elyorbe
Elyorbe / ssh_dev.ps1
Created December 21, 2021 01:03
ssh into your server with one command.
<#
Add following function to your powershell profile.
Copy your public key to the remote server to login without password
#>
function ssh_dev {
ssh username@host
}
@Elyorbe
Elyorbe / Microsoft.PowerShell_profile.ps1
Last active November 16, 2021 00:33
Change the prompt shell to show without current folder only without full path
<#
1. Add following function to your powershell profile.
If doesn't exist create under $ENV:USERPROFILE\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
#>
function prompt {
$p = Split-Path -leaf -path (Get-Location)
"$p> "
}
<#
2. Save the profile and restart PowerShell
@Elyorbe
Elyorbe / ssh-copy-id-win
Created October 22, 2021 06:51
ssh-copy-id for windows
# First generate public/private key if doesn't exists
ssh-keygen
# For PowerShell
type $ENV:USERPROFILE\.ssh\id_rsa.pub | ssh username@host "cat >> .ssh/authorized_keys"
# For CMD
type %USERPROFILE%\.ssh\id_rsa.pub | ssh username@host "cat >> .ssh/authorized_keys"