Skip to content

Instantly share code, notes, and snippets.

View shhyou's full-sized avatar
💭
Alive

shuhung shhyou

💭
Alive
View GitHub Profile
@dvanhorn
dvanhorn / syntax-rules-eval.rkt
Created October 21, 2020 03:46
A CPS interpreter for a CBV language written in syntax-rules
#lang racket
;; A CPS interpreter for a CBV language written in syntax-rules
;; e ::= 'd literal
;; | x variable
;; | (e e) application
;; | (λ (x) e) abstraction
;; (eval e) interprets e in an environment
@ekmett
ekmett / TypedNBE.hs
Last active September 7, 2020 19:37
Typed normalization-by-evaluation using a slowed category action
{-# Language CPP #-}
{-# Language BlockArguments #-}
{-# Language GADTs #-}
{-# Language RankNTypes #-}
{-# Language ViewPatterns #-}
{-# Language TypeApplications #-}
{-# Language BangPatterns #-}
{-# Language TypeOperators #-}
{-# Language TypeFamilyDependencies #-}
{-# Language DataKinds #-}
@liamoc
liamoc / Fun.lean
Last active October 5, 2022 07:09
section
parameters {α : Type}
variable [ a_dec : decidable_eq α]
include a_dec
open nat
definition replicate (a : α) : ℕ → list α
| 0 := []
| (succ n) := a :: replicate n
@shhyou
shhyou / syntax-parse-disarm.rkt
Created March 9, 2020 21:57
Disarming Syntax Objects Before Parsing in syntax/parse
#|
By: @ryanc
From: https://racket.slack.com/archives/C06V96CKX/p1583783757431900?thread_ts=1583782250.431100&cid=C06V96CKX
In thread: https://racket.slack.com/archives/C06V96CKX/p1583782250431100
sorawee Today at 2:30 PM
Question (particularly for @ryanc I think): is there a way to make `syntax-parse`
works nicely with `syntax-disarm`? I’m trying to do something similar to
errortrace which needs to disarm/rearm syntax object for each depth
(https://github.com/racket/errortrace/blob/master/errortrace-lib/errortrace/stacktrace.rkt#L385).
@Bogdanp
Bogdanp / codesign.sh
Created January 1, 2020 22:07
Codesigning a Racket executable for inclusion in a macOS app
codesign --force \
--timestamp \
--entitlements="$CODE_SIGN_ENTITLEMENTS" \
--sign="$EXPANDED_CODE_SIGN_IDENTITY_NAME" \
-o runtime \
"${PROJECT_DIR}/Resources/core/lib/Racket.framework/Versions/7.5_3m/Racket"
codesign --force \
--timestamp \
--entitlements="$CODE_SIGN_ENTITLEMENTS" \
#lang rosette/safe
(require rosette/lib/angelic ; provides `choose*`
rosette/lib/destruct) ; provides `destruct`
; Tell Rosette we really do want to use integers.
(current-bitwidth #f)
@saelo
saelo / 3_years_of_attacking_javascript_engines.txt
Created October 27, 2019 16:04
3 Years of Attacking JavaScript Engines
|=-----------------------------------------------------------------------=|
|=-------------=[ 3 Years of Attacking JavaScript Engines ]=-------------=|
|=-----------------------------------------------------------------------=|
|=------------------------------=[ saelo ]=------------------------------=|
|=-----------------------------------------------------------------------=|
The following are some brief notes about the changes that have taken place
since the release of the "Attacking JavaScript Engines" paper [1]. In
general, no big conceptional changes have happened since. Mitigations have
been added to break some of the presented techniques and, as expected, a
Joshua Rifkin/Scott Joplin Piano Rags/17 - Magnetic Rag - Synchopations Classiques.mp3
../copied//18 Magnetic Rag - Frank Livolsi.mp3
Joshua Rifkin/Scott Joplin Piano Rags/11 - Solace - A Mexican Serenade.mp3
Richard Dowling/The Complete Piano Works of Scott Joplin/(Disc 1) 09 - Bethena.mp3
Joshua Rifkin/Scott Joplin Piano Rags/05 - Fig Leaf Rag.mp3
Joshua Rifkin/Scott Joplin Piano Rags/11 - Solace - A Mexican Serenade.mp3
Joshua Rifkin/Scott Joplin Piano Rags/09 - Bethena - A Concert Waltz.mp3
Joshua Rifkin/Scott Joplin Piano Rags/17 - Magnetic Rag - Synchopations Classiques.mp3
../copied//18 Magnetic Rag - Frank Livolsi.mp3
Joshua Rifkin/Scott Joplin Piano Rags/01 - Maple Leaf Rag.mp3
@andy0130tw
andy0130tw / subprocess_safe.py
Last active November 8, 2024 15:01
Finally I made it. A customized Popen to support limiting the size of stdout/stderr! (Works on non-Windows only, for now)
import contextlib
import io
import logging
import os
import queue
import selectors
import subprocess
import tempfile
import threading
from time import monotonic as _time
@MattPD
MattPD / analysis.draft.md
Last active July 20, 2025 18:26
Program Analysis Resources (WIP draft)