Skip to content

Instantly share code, notes, and snippets.

View Ekliptor's full-sized avatar

Ekliptor

View GitHub Profile
Fonts:
BigCaslon.ttf:
Kind: TrueType
Valid: Yes
Enabled: Yes
Location: /Library/Fonts/BigCaslon.ttf
Typefaces:
BigCaslon-Medium:
# Install the gRPC PHP plugin on Mac
#
# See: http://www.grpc.io/docs/quickstart/php.html#install-protobuf-plugin
# Source: https://gist.github.com/johndpope/503029706ed56d5375d1e9469f0135d4
# Install build dependencies
brew install automake libtool
## Clone gRPC repo
git clone --recursive -b v1.4.x https://github.com/grpc/grpc
@Ekliptor
Ekliptor / compile.go
Created April 3, 2021 10:29
Go Web Assembly compile server
func (api *CompileAPI) ServeHTTP(w http.ResponseWriter, r *http.Request) {
defer r.Body.Close()
// Get code from params
type parameters struct {
Code string `json:"code" validate:"required"`
}
decoder := json.NewDecoder(r.Body)
params := parameters{}
err := decoder.Decode(&params)
@Ekliptor
Ekliptor / prompt.js
Last active May 28, 2021 18:18
Listen to "paid" message of prompt.cash iframe and navigate parent page to "return_url"
(function () {
const gatewayOrigin = "https://prompt.cash"; // ignore messages from other frames
const onMessage = (event) => {
if (event.origin !== gatewayOrigin) {
return;
}
let data = event.data;
if (data.func === "onPromptPaid") {
// the iframe says the payment is confirmed