Skip to content

Instantly share code, notes, and snippets.

View SeonHyungJo's full-sized avatar
๐ŸŽฏ
Focusing

snyung SeonHyungJo

๐ŸŽฏ
Focusing
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 March 17, 2025 14:25
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 August 30, 2024 19:57
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 November 13, 2024 22:30
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 May 3, 2024 07:30
TensorFlow ์‹œ์ž‘ํ•˜๊ธฐ

ํ…์„œํ”Œ๋กœ์šฐ ์‹œ์ž‘ํ•˜๊ธฐ

๊ธ€์“ด์ด: ๊น€์ •์ฃผ([email protected])

์ด ๋ฌธ์„œ๋Š” ํ…์„œํ”Œ๋กœ์šฐ ๊ณต์‹ ํŽ˜์ด์ง€ ๋‚ด์šฉ์„ ๋ฐ”ํƒ•์œผ๋กœ ๋งŒ๋“ค์–ด์กŒ์Šต๋‹ˆ๋‹ค.


์†Œ๊ฐœ

ํ…์„œํ”Œ๋กœ์šฐ(TensorFlow)๋Š” ๊ธฐ๊ณ„ ํ•™์Šต๊ณผ ๋”ฅ๋Ÿฌ๋‹์„ ์œ„ํ•ด ๊ตฌ๊ธ€์—์„œ ๋งŒ๋“  ์˜คํ”ˆ์†Œ์Šค ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์ž…๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ ํ”Œ๋กœ์šฐ ๊ทธ๋ž˜ํ”„(Data Flow Graph) ๋ฐฉ์‹์„ ์‚ฌ์šฉํ•˜์˜€์Šต๋‹ˆ๋‹ค.

@paulirish
paulirish / what-forces-layout.md
Last active May 5, 2025 08:05
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 May 1, 2025 17:28
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);