Skip to content

Instantly share code, notes, and snippets.

View antop-dev's full-sized avatar

Antop antop-dev

View GitHub Profile
@antop-dev
antop-dev / fragments.html
Created May 6, 2019 05:47
spring secuirty csrf ajax
<!-- ajax csrf -->
<script type="text/javascript" th:inline="javascript">
/*<![CDATA[*/
if (window.jQuery) {
$.ajaxSetup({
beforeSend: function (xhr) {
xhr.setRequestHeader(/*[[${_csrf.headerName}]]*/ 'csrf-name', /*[[${_csrf.token}]]*/ 'csrf-value');
}
});
}
<html lang="ko">
<head>
<meta charset="utf-8" />
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.8.0/css/bootstrap-datepicker.min.css" />
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.8.0/js/bootstrap-datepicker.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.8.0/locales/bootstrap-datepicker.ko.min.js"></script>
</head>
<!--
/**
# byte.js
byte('5kb') // 5120
byte('10mb') // 104857600
byte('512b') // 512
byte('1024') // 1024
byte(1024) // 1024
byte('3gb') // 3221225472
**/
/**
# ms.js
No more painful `setTimeout(fn, 60 * 4 * 3 * 2 * 1 * Infinity * NaN * '☃')`.
ms('2d') // 172800000
ms('1.5h') // 5400000
ms('1h') // 3600000
ms('1m') // 60000
ms('5s') // 5000
ms('500ms') // 500
ms('100') // 100
@antop-dev
antop-dev / label-syntax
Created April 22, 2019 08:23
같은 라벨 다른 사용법
<input id="save_id" class="chk_box" type="checkbox"><label for="save_id">아이디 저장</label>
<label><input class="chk_box" type="checkbox">아이디 저장</label>
sed 's@archive.ubuntu.com@mirror.kakao.com@' -i /etc/apt/sources.list
@antop-dev
antop-dev / headless.sh
Created December 30, 2018 08:14 — forked from lebedov/headless.sh
Using Xvfb to create a headless display
#!/bin/bash
# Demonstrates how to create a headless display using xvfb.
# Create the display:
Xvfb :100 -ac &
PID1=$!
export DISPLAY=:100.0
# Run the application that needs the display:
@antop-dev
antop-dev / start_docker_registry.bash
Created December 30, 2018 07:03 — forked from PieterScheffers/start_docker_registry.bash
Start docker registry with letsencrypt certificates (Linux Ubuntu)
#!/usr/bin/env bash
# install docker
# https://docs.docker.com/engine/installation/linux/ubuntulinux/
# install docker-compose
# https://docs.docker.com/compose/install/
# install letsencrypt
# https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04
@antop-dev
antop-dev / Update remote repo
Created November 9, 2018 19:06 — forked from mandiwise/Update remote repo
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket