Skip to content

Instantly share code, notes, and snippets.

View Luke-SNAW's full-sized avatar

Luke SNAW Luke-SNAW

View GitHub Profile
@Luke-SNAW
Luke-SNAW / confix.xml
Created September 21, 2020 01:24
[SplashMaintainAspectRatio android] #cordova
<preference name="SplashMaintainAspectRatio" value="true|false" />
@Luke-SNAW
Luke-SNAW / .tmux.conf
Last active January 23, 2022 23:49
[cli tools] #cli #tools
set -g prefix C-a
unbind C-b
set -g mouse on
@Luke-SNAW
Luke-SNAW / .eslintignore
Last active March 23, 2021 23:09
[🌠 eslint prettier setting for next.js]
node_modules
@Luke-SNAW
Luke-SNAW / download.js
Created March 23, 2021 23:11
[How trigger file downloads with JavaScript]
function downloadFile(file) {
// Create a link and set the URL using `createObjectURL`
const link = document.createElement("a");
link.style.display = "none";
link.href = URL.createObjectURL(file);
link.download = file.name;
// It needs to be added to the DOM so it can be clicked
document.body.appendChild(link);
link.click();
@Luke-SNAW
Luke-SNAW / readme.md
Created April 28, 2021 01:57
[⭐️ referrer from wkwebview on google map API] #cordova #google

API 및 서비스> 사용자 인증 정보> API 키

HTTP 리퍼러(웹사이트)로 제한둘 때,

<preference name="scheme" value="app" />
<preference name="hostname" value="hostname" />

로 설정한 app://hostname이 안먹힘.

googling하다가 *://localhost/*로 성공. 앞의 protocol은 file, http 등을 시도해 봤는데 모두 실패

@Luke-SNAW
Luke-SNAW / git.sh
Created June 2, 2021 02:13
[git diff commits, patch] #git
git diff k73ud dj374 > my.patch
git apply my.patch
@Luke-SNAW
Luke-SNAW / javascript-case study.md
Last active November 23, 2022 01:38
[Javascript] #collections #javascript
  • How MDN's autocomplete search works
  • Write Your Own Promise in JavaScript
  • Blocked new shopify tab
    • Q. 최초 구매를 눌렀을때는 쇼피파이가 연결이(새 창) 안됬었는데 구매 재시도를 눌렀을때에는 연결이 되는 이유가 뭘까요?
    • A.
      1. 브라우저에서 사용자 action 없이 새 창 열리는 걸 막습니다.
      2. 현재 구매 버튼을 눌렀을 때 shopify checkout URL을 받아오는데 이 때 시간이 걸립니다.
      3. 아마 일정 시간이 지나면 사용자 action과 별개의 것으로 판단하여 막는 걸로 보입니다.
      4. 구매 재시도는 URL을 저장했기 때문에 URL 받아오는 시간이 없어 브라우저에서 막지 않는 걸로 보입니다.
  • 2번 과정의 시간이 오래 걸리면 차단될 걸로 예상되니 페이지 진입 시 URL 미리 받아오는 걸로 수정하겠습니다.
@Luke-SNAW
Luke-SNAW / auth.md
Last active January 24, 2022 00:36
[Security] #collections #security

Case Study