Skip to content

Instantly share code, notes, and snippets.

@markruler
markruler / unregisterServiceWorkers.js
Created March 6, 2025 03:02 — forked from mrienstra/unregisterServiceWorkers.js
Unregister service workers, verbose
navigator.serviceWorker.getRegistrations().then(function (registrations) {
if (!registrations.length) {
console.log('No serviceWorker registrations found.')
return
}
for(let registration of registrations) {
registration.unregister().then(function (boolean) {
console.log(
(boolean ? 'Successfully unregistered' : 'Failed to unregister'), 'ServiceWorkerRegistration\n' +
(registration.installing ? ' .installing.scriptURL = ' + registration.installing.scriptURL + '\n' : '') +
@markruler
markruler / install_cursor.sh
Created February 4, 2025 08:46 — forked from Kinyugo/install_cursor.sh
Cursor AI IDE Installer and Updater Script
#!/bin/bash
installCursor() {
local CURSOR_URL="https://downloader.cursor.sh/linux/appImage/x64"
local ICON_URL="https://miro.medium.com/v2/resize:fit:700/1*YLg8VpqXaTyRHJoStnMuog.png"
local APPIMAGE_PATH="/opt/cursor.appimage"
local ICON_PATH="/opt/cursor.png"
local DESKTOP_ENTRY_PATH="/usr/share/applications/cursor.desktop"
echo "Checking for existing Cursor installation..."
#!/usr/bin/env bash
# 경로를 입력하지 않으면 에러 메시지를 출력하고 종료
if [ -z "$1" ]; then
echo "Usage: $0 <directory_path>"
exit 1
fi
# 파라미터로 받은 경로를 TARGET_DIR로 설정
# 인코딩을 변경하고자 하는 디렉토리 경로를 설정합니다.
@markruler
markruler / cmake-tutorial.md
Created September 4, 2022 12:09 — forked from luncliff/cmake-tutorial.md
CMake 할때 쪼오오금 도움이 되는 문서

CMake를 왜 쓰는거죠?
좋은 툴은 Visual Studio 뿐입니다. 그 이외에는 전부 사도(邪道)입니다 사도! - 작성자

주의

  • 이 문서는 CMake를 주관적으로 서술합니다
  • 이 문서를 통해 CMake를 시작하기엔 적합하지 않습니다
    https://cgold.readthedocs.io/en/latest/ 3.1 챕터까지 따라해본 이후 기본사항들을 속성으로 익히는 것을 돕기위한 보조자료로써 작성되었습니다
@markruler
markruler / healthcheck
Last active August 16, 2022 04:48
healthcheck
#!/usr/bin/env bash
while ! curl --silent --output /dev/null --head --fail --max-time 3 --location ${1}; do
echo "Healthchecking...${1}"
sleep 2
done
@markruler
markruler / AutowiringSpringBeanJobFactory.java
Created February 24, 2022 12:05 — forked from jelies/AutowiringSpringBeanJobFactory.java
Quartz (2.1.6) java config with spring (3.2.1). Using a SpringBeanJobFactory to automatically autowire quartz classes.
package com.jelies.spring3tomcat7.config.quartz;
import org.quartz.spi.TriggerFiredBundle;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.scheduling.quartz.SpringBeanJobFactory;
/**
* This JobFactory autowires automatically the created quartz bean with spring @Autowired dependencies.
@markruler
markruler / prepare-commit-msg-with-jira.md
Last active December 16, 2022 06:55
GitHub 커밋 메세지에 JIRA 이슈번호 자동으로 넣어주기
#!/usr/bin/env bash
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop release hotfix)
fi
PROJECT_ID=ASA
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"
JIRA_ID=`echo $BRANCH_NAME | egrep -o "$PROJECT_ID-[0-9]+"`
#On macOS Mojave, this script must run in root, otherwise you will
#get a runtime error due to "No permission" error when create raw socket
import socket
import io
import struct
import sys
class flushfile(io.FileIO):
def __init__(self, f):