Skip to content

Instantly share code, notes, and snippets.

View cometkim's full-sized avatar
πŸ›Œ
sleeping

Hyeseong Kim cometkim

πŸ›Œ
sleeping
View GitHub Profile
@scottyab
scottyab / SaferWebViewClient.java
Created May 14, 2014 15:36
Make Webview safer - some of the code based on recommendations in article https://labs.mwrinfosecurity.com/blog/2012/04/23/adventures-with-android-webviews/
/**
* Implements whitelisting on host name
*/
public class SaferWebViewClient extends WebViewClient {
private String[] hostsWhitelist;
public SaferWebViewClient(String hostsWhitelsit){
super();
this.hostsWhitelist = hostsWhitelist;
@scottjehl
scottjehl / noncritcss.md
Last active August 12, 2023 16:57
Comparing two ways to load non-critical CSS

I wanted to figure out the fastest way to load non-critical CSS so that the impact on initial page drawing is minimal.

TL;DR: Here's the solution I ended up with: https://github.com/filamentgroup/loadCSS/


For async JavaScript file requests, we have the async attribute to make this easy, but CSS file requests have no similar standard mechanism (at least, none that will still apply the CSS after loading - here are some async CSS loading conditions that do apply when CSS is inapplicable to media: https://gist.github.com/igrigorik/2935269#file-notes-md ).

Seems there are a couple ways to load and apply a CSS file in a non-blocking manner:

@tsl0922
tsl0922 / .tmux.conf
Last active August 31, 2026 08:34
vim style tmux config
# vim style tmux config
# use C-a, since it's on the home row and easier to hit than C-b
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
set -g base-index 1
# Easy config reload
bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
@staltz
staltz / introrx.md
Last active September 1, 2026 09:40
The introduction to Reactive Programming you've been missing
@ReedD
ReedD / ec2-startup.sh
Last active December 30, 2024 20:52
User data for EC2 to set up Docker and Compose (Fig) for ec2-user
#!/bin/sh
export PATH=/usr/local/bin:$PATH;
yum update
yum install docker -y
service docker start
# Docker login notes:
# - For no email, just put one blank space.
# - Also the private repo protocol and version are needed for docker
# to properly setup the .dockercfg file to work with compose
@ajchemist
ajchemist / crypto.md
Last active August 10, 2021 10:21 — forked from lifthrasiir/crypto.md
κ³ μˆ˜μ€€μ—μ„œ μ•”ν˜Έν•™ μ΄ν•΄ν•˜κΈ°

κ³ μˆ˜μ€€μ—μ„œ μ•”ν˜Έν•™ μ΄ν•΄ν•˜κΈ°

이 글은 메아리 저널에 μ“Έ λͺ©μ μœΌλ‘œ ν•œλ™μ•ˆ μž‘μ—…ν•˜λ˜ κΈ€μž…λ‹ˆλ‹€. 메아리 특유의 λ””μžμΈ(...)이 μ‹«λ‹€λ©΄ μ—¬κΈ°λ‘œ λ§ν¬ν•˜μ…”λ„ λ©λ‹ˆλ‹€. μ–΄λŠ μͺ½μ΄λ“ κ°„에 μ˜κ²¬μ€ 이 μ•„λž˜μ˜ μ½”λ©˜νŠΈ λž€ λ˜λŠ” 메아리에 κΈ°μž¬λ˜μ–΄ μžˆλŠ” 메일 μ£Όμ†Œλ₯Ό 써 μ£Όμ‹œλ©΄ κ°μ‚¬ν•˜κ² μŠ΅λ‹ˆλ‹€. --lifthrasiir

μ•”ν˜Έν•™μ„ μ‚¬μš©ν•˜λŠ” λ§Žμ€ μ‹œμŠ€ν…œμ€ μ„ΈλΆ€μ μœΌλ‘œ 무슨 μ•Œκ³ λ¦¬μ¦˜μ„ μ“°λŠ”μ§€λ³΄λ‹€λŠ” κ·Έ μ•Œκ³ λ¦¬μ¦˜λ“€μ΄ μ–΄λ–»κ²Œ μ—°κ²°λ˜μ–΄ μžˆλŠ”μ§€, 즉 ꡬ쑰가 μ‹€μ œ μ•ˆμ „μ„±μ— 더 큰 영ν–₯을 λ―ΈμΉœλ‹€. λ”°λΌμ„œ ꡬ쑰와 κ·Έ ꡬ쑰λ₯Ό μ΄λ£¨λŠ” λΉŒλ”© λΈ”λŸ­μ„ μ•„λŠ” 것이 μ€‘μš”ν•œλ°, μ—¬κΈ°μ—μ„œλŠ” μ΄λŸ¬ν•œ μ•”ν˜Έν•™μ  λΉŒλ”© λΈ”λŸ­κ³Ό ν•¨κ»˜ λΈ”λŸ­λ“€μ΄ μ–΄λ–»κ²Œ μ“°μ—¬μ„œ 더 큰 ꡬ쑰λ₯Ό λ§Œλ“œλŠ”μ§€λ₯Ό μ•Œμ•„ λ³Έλ‹€.

Key Exchange

ν‚€ κ΅ν™˜. 두 μ‚¬λžŒλ§Œμ΄ μ•Œ 수 μžˆλŠ” μƒˆλ‘œμš΄ ν‚€λ₯Ό λ§Œλ“ λ‹€. 이 과정이 λλ‚˜λ„ μƒλŒ€λ°©μ΄ λ‚΄κ°€ μ•„λŠ” μ‚¬λžŒμΈμ§„ μ•Œ 수 μ—†μ§€λ§Œ 적어도 μƒλŒ€λ°©κ³Ό λ‚΄κ°€ 같은 ν‚€λ₯Ό κ°€μ§€κ³  μžˆλ‹€λŠ” 건 ν™•μ‹ ν•  수 μžˆλ‹€.

@Mischa-Alff
Mischa-Alff / AABB.cpp
Last active July 7, 2024 01:03
Simple AABB implementation using SIMD instructions for x86-64
#include <chrono>
#include <ctime>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <random>
struct AABB{int32_t left, top, right, bottom;};
extern "C" bool check_aabb(AABB *a, AABB *b);
extern "C" bool check_aabb_conventional(AABB *a, AABB *b);
@mfuerstenau
mfuerstenau / zigzag-encoding.README
Last active July 12, 2026 07:18
ZigZag encoding/decoding explained
ZigZag-Encoding
---------------
Maps negative values to positive values while going back and
forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...)
(i >> bitlength-1) ^ (i << 1)
with "i" being the number to be encoded, "^" being
XOR-operation and ">>" would be arithemtic shifting-operation
@paulirish
paulirish / what-forces-layout.md
Last active September 4, 2026 08:51
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
@OlegIlyenko
OlegIlyenko / Event-stream based GraphQL subscriptions.md
Last active April 29, 2026 22:22
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.