Skip to content

Instantly share code, notes, and snippets.

View ajchemist's full-sized avatar
🕶️

ajchemist

🕶️
  • Korean Peninsula
View GitHub Profile
(setq xcycle '#1=(("p1" . "t1") ("p2" . "t2") . #1#))
(cadr (member (assoc-string "p2" xcycle) xcycle))
(setq xcycle '#1=("p1" "t1" "p2" "t2" . #1#))
(cddr (member "p2" xcycle))
(defun rcirc-format-response-string (process sender response target text)
"Return a nicely-formatted response string, incorporating TEXT
\(and perhaps other arguments). The specific formatting used
is found by looking up RESPONSE in `rcirc-response-formats'."
(with-temp-buffer
(insert (or (cdr (assoc response rcirc-response-formats))
(cdr (assq t rcirc-response-formats))))
(goto-char (point-min))
(let ((start (point-min))
(sender (if (or (not sender)
@ajchemist
ajchemist / gist:2e3621cf17450786aa74
Created September 2, 2014 08:03
The EFI Boot Stub
The EFI Boot Stub
---------------------------
On the x86 platform, a bzImage can masquerade as a PE/COFF image,
thereby convincing EFI firmware loaders to load it as an EFI
executable. The code that modifies the bzImage header, along with the
EFI-specific entry point that the firmware loader jumps to are
collectively known as the "EFI boot stub", and live in
arch/x86/boot/header.S and arch/x86/boot/compressed/eboot.c,
@ajchemist
ajchemist / crypto.md
Last active August 10, 2021 10:21 — forked from lifthrasiir/crypto.md
고수준에서 암호학 이해하기

고수준에서 암호학 이해하기

이 글은 메아리 저널에 쓸 목적으로 한동안 작업하던 글입니다. 메아리 특유의 디자인(...)이 싫다면 여기로 링크하셔도 됩니다. 어느 쪽이든간에 의견은 이 아래의 코멘트 란 또는 메아리에 기재되어 있는 메일 주소를 써 주시면 감사하겠습니다. --lifthrasiir

암호학을 사용하는 많은 시스템은 세부적으로 무슨 알고리즘을 쓰는지보다는 그 알고리즘들이 어떻게 연결되어 있는지, 즉 구조가 실제 안전성에 더 큰 영향을 미친다. 따라서 구조와 그 구조를 이루는 빌딩 블럭을 아는 것이 중요한데, 여기에서는 이러한 암호학적 빌딩 블럭과 함께 블럭들이 어떻게 쓰여서 더 큰 구조를 만드는지를 알아 본다.

Key Exchange

키 교환. 두 사람만이 알 수 있는 새로운 키를 만든다. 이 과정이 끝나도 상대방이 내가 아는 사람인진 알 수 없지만 적어도 상대방과 내가 같은 키를 가지고 있다는 건 확신할 수 있다.

(defvar frame-bar-pixel-num (cc-eval-when-compile
(case window-system ((ns) 23))))
(defvar desktop-taskbar-pixel-num (cc-eval-when-compile
(case window-system ((ns) 22))))
(defun mkfparams (direction rframe &optional move)
(let ((horizontalp (memq direction '(left right)))
(fp/left (frame-parameter rframe 'left))
(fp/top (frame-parameter rframe 'top))
@ajchemist
ajchemist / a.cpp
Created March 30, 2015 13:16
MFC utilities
char* ConvertUnicodeToMultybyte(CString strUnicode)
{
int nLen = WideCharToMultiByte(CP_ACP, 0, strUnicode, -1, NULL, 0, NULL, NULL);
char* pMultibyte = new char[nLen];
memset(pMultibyte, 0x00, (nLen)*sizeof(char));
WideCharToMultiByte(CP_ACP, 0, strUnicode, -1, pMultibyte, nLen, NULL, NULL);
return pMultibyte;
(defun check-expansion ()
(save-excursion
(cond ((looking-at "\\_>") t)
((unless (bobp) (backward-char 1) (looking-at "\\.")) t)
((unless (bobp) (backward-char 1) (looking-at "->")) t)
(t nil))))
(defun smart-tab (&optional prefix)
"This smart tab is minibuffer compliant: it acts as usual in
the minibuffer. Else, if mark is active, indents region. Else if
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
window.WebSocket = window.WebSocket || window.MozWebSocket;
var websocket = new WebSocket('ws://127.0.0.1:9999','dumb-increment-protocol');
websocket.onopen = function () {
(defn listen-cigarette-burn []
(if-let [cigaburn-dom (dom/getElement "cigarette-burn")]
(events/listen
cigaburn-dom
EventType.MOUSEMOVE
(fn [_]
(if-let [noticenter-dom (dom/getElement "notification-center")]
(when-not (classes/has noticenter-dom "reveal")
(classes/addRemove noticenter-dom "unreveal" "reveal")
;; (events/listenOnce
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html;">
<link href="app.gss" rel="stylesheet/gss" type="text/gss">
</head>
<body>
<img id="cassowaryImg" src="http://gridstylesheets.org/assets/images/Intro/CassowaryBird.png" />
<h1>Hello!</h1>