Skip to content

Instantly share code, notes, and snippets.

View SeonHyungJo's full-sized avatar
πŸ”
Searching...

snyung SeonHyungJo

πŸ”
Searching...
View GitHub Profile
@preinpost
preinpost / home_screen.dart
Created March 3, 2023 15:49
headers override
// μ—λŸ¬μ˜ 원인
// λ”°λ‘œ User-Agent 값을 μΆ”κ°€ν•˜μ§€ μ•ŠμœΌλ©΄ κΈ°λ³Έκ°’μœΌλ‘œ `Dart/<version> (dart:io)` κ°€ λ“€μ–΄κ°‘λ‹ˆλ‹€.
// (https://api.flutter.dev/flutter/dart-io/HttpClient/userAgent.html)
// 이 값을 μ§€μš°κ³  λΈŒλΌμš°μ €μ—μ„œ μ‚¬μš©ν•˜λŠ” κ°’μœΌλ‘œ λ°”κΏ”μ€λ‹ˆλ‹€.
// (λΈŒλΌμš°μ € 값이 μ•„λ‹ˆλ©΄ λ„€μ΄λ²„μ—μ„œ μ°¨λ‹¨ν•˜λŠ”κ±Έλ‘œ λ³΄μž…λ‹ˆλ‹€)
// 방법 1. (local? override)
// [home_screen.dart]
@ninanung
ninanung / login-with-github.md
Last active September 20, 2023 16:16
Github둜 λ‘œκ·ΈμΈν•˜κΈ°!

Github둜 λ‘œκ·ΈμΈν•˜κΈ° feat.Vue and Node.js

1. Github둜 λ‘œκ·ΈμΈν•˜κΈ°?

μš”μ¦˜λ“€μ–΄ "~둜 λ‘œκ·ΈμΈν•˜κΈ°" κ°€ λ§Žμ•„μ§€κ³  μžˆλ‹€. νŽ˜μ΄μŠ€λΆμ΄λ‚˜ ꡬ글이 λŒ€ν‘œμ μ΄κ³ , ν•œκ΅­μ—μ„œλŠ” 넀이버도 많이 μ‚¬μš©ν•˜λ©° 개발자 κ΄€λ ¨ μ›Ήμ—μ„œλŠ” κΉƒν—ˆλΈŒλ„ κ»΄μžˆλŠ” κ²½μš°κ°€ λ§Žλ‹€. 이런 μ‹μ˜ λ‹€λ₯Έ μ„œλΉ„μŠ€λ₯Ό 톡해 μΈμ¦ν•˜λŠ” 방식을, OAuth 인증 방식이라고 ν•˜λŠ” λͺ¨μ–‘이닀. λ‚΄κ°€ νšŒμ‚¬ 업무λ₯Ό μœ„ν•΄ μ‚¬μš©ν•˜λŠ” λͺ‡λͺ‡ μ†Œν”„νŠΈμ›¨μ–΄λ„ μ΄λŸ¬ν•œ 인증을 μ§€μ›ν•˜λŠ” κ²½μš°κ°€ λ§Žλ‹€. 이 κΈ€μ—μ„œλŠ” κ·ΈλŸ¬ν•œ 인증을 κ΅¬ν˜„ν•˜μ§€λŠ”κ²Œ μ•„λ‹ˆλΌ κ·ΈλŸ¬ν•œ 인증을 μ‚¬μš©ν•΄ λ³΄μžλŠ” 것에 λͺ©μ μ„ λ‘”λ‹€. μ–΄λ–€ λ°©μ‹μœΌλ‘œ μΈμ¦ν•˜λŠ”μ§€λ₯Ό 직접 μ‚¬μš©ν•΄λ³΄κ³  OAuth방식 인증의 절차λ₯Ό μ•Œμ•„λ³΄λŠ” κΈ°νšŒλ„ 될것이닀.

2. λͺ©ν‘œ

λͺ©ν‘œ
μœ„μ™€ 같이 λ²„νŠΌμ„ λˆ„λ₯΄λ©΄ Githubμ—μ„œ 인증을 μ‹€ν–‰ν•˜κ³  κ΄€λ ¨ 데이터λ₯Ό λ°›μ•„μ˜€λŠ” λ™μž‘μ„ κ΅¬ν˜„ν•΄ λ³Ό 것이닀.

iOS restrictions re: bringing up the keyboard on programmatic focus

I can't find exact specifications on this, but it seems that iOS restricts bringing up the keyboard via programmatically focusing on <input>. It only brings up the keyboard in response to explicit user interaction.

  1. iOS focus on input field only brings up keyboard when called inside a click handler.
  2. It doesn’t work if the focus is async.

This presents a curious problem when you want to autofocus an input inside a modal or lightbox, since what you generally do is click on a button to bring up the lightbox, and then focus on the input after the lightbox has been opened. Without anything fancy, it actually works ok. The problem shows up when you try to add something fancy like a setTimeout or a promise.then(). I don't know why people would want to use a setTimeout here, but waiting for a promise is actually a pretty common use case. E.g. we try to batch dom manipulations like getting a lightbox to show up inside `requestAnimati

@javilobo8
javilobo8 / download-file.js
Last active May 13, 2025 05:55
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@indiesquidge
indiesquidge / pull_request_template.md
Last active October 19, 2025 06:32
An example PR template
Status Type Env Vars Change Review App Ticket
Ready/Hold Feature/Bug/Tooling/Refactor/Hotfix Yes/No Link Link

⚠️ NOTE: use notes like this to emphasize something about the PR. This could include other PRs this PR is built on top of; new or removed environment variables; reasons for why the PR is on hold; or anything else you would like to draw attention to.

Problem

What problem are you trying to solve?

@felquis
felquis / url-schemes.md
Last active October 15, 2025 23:20
iOS, Android browser apps URL Schemes to handle URL between browsers, and apps..

Assume the user is on a mobile device iOS Safari (Or other browser), but you want a link to open into any other specific mobile browser app like Chrome, Safari, Firefox, Opera, Arc... How do you do that?

Chrome

To open on Chrome

<a href="googlechrome://example.com">try it on Chrome</a>

check out Chrome iOS Docs for more information

@haje01
haje01 / TensorFlow μ‹œμž‘ν•˜κΈ°.md
Last active November 22, 2025 10:00
TensorFlow μ‹œμž‘ν•˜κΈ°

ν…μ„œν”Œλ‘œμš° μ‹œμž‘ν•˜κΈ°

글쓴이: κΉ€μ •μ£Ό(haje01@gmail.com)

이 λ¬Έμ„œλŠ” ν…μ„œν”Œλ‘œμš° 곡식 νŽ˜μ΄μ§€ λ‚΄μš©μ„ λ°”νƒ•μœΌλ‘œ λ§Œλ“€μ–΄μ‘ŒμŠ΅λ‹ˆλ‹€.


μ†Œκ°œ

ν…μ„œν”Œλ‘œμš°(TensorFlow)λŠ” 기계 ν•™μŠ΅κ³Ό λ”₯λŸ¬λ‹μ„ μœ„ν•΄ κ΅¬κΈ€μ—μ„œ λ§Œλ“  μ˜€ν”ˆμ†ŒμŠ€ λΌμ΄λΈŒλŸ¬λ¦¬μž…λ‹ˆλ‹€. 데이터 ν”Œλ‘œμš° κ·Έλž˜ν”„(Data Flow Graph) 방식을 μ‚¬μš©ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

@paulirish
paulirish / what-forces-layout.md
Last active December 8, 2025 09:19
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@tonymtz
tonymtz / gist:d75101d9bdf764c890ef
Last active July 24, 2025 16:11
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@tejainece
tejainece / LinkedHashMapValueByIndexArray.java
Last active March 9, 2023 21:21
Get element by index in LinkedHashMap
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
public class LinkedHashMapValueByIndexArray {
public static void main(String []args){
LinkedHashMap<String, Integer> map = new LinkedHashMap<String, Integer>();
map.put("Qatar", 98814);