This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> RUBY_YJIT_ENABLE=1 ruby -e "puts RubyVM::YJIT.enabled?" | |
true | |
> ruby -e "puts RubyVM::YJIT.enabled?" | |
false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from re import sub, match | |
from os.path import join, relpath | |
def echo(message): | |
# print(message) | |
pass | |
PIKU_INTERNAL_NGINX_STATIC_MAPPING = """ | |
location $static_url { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Google docs query command-line sample. | |
require 'google/apis/drive_v2' | |
require 'google/api_client/client_secrets' | |
require 'google/api_client/auth/installed_app' | |
require 'google/api_client/auth/storage' | |
require 'google/api_client/auth/storages/file_store' | |
require 'logger' | |
require 'json' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ❯ ruby foo_test.rb | |
# Run options: --seed 44288 | |
# # Running: | |
# F. | |
# Finished in 0.000679s, 2945.5069 runs/s, 2945.5069 assertions/s. | |
# 1) Failure: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sqlite3.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#define MAX_FILE_SIZE 1000000 | |
// build with | |
// cc run_sqlite3_deserialize.c -lsqlite3 -o sqlite3_deserialize | |
// create db with: | |
// echo "create table pizza(name, color); insert into pizza(name, color) values ('margarita', 'red');" | sqlite3 pizza.db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# requires python > 3.11rc1 for sqlite3.{serialize, deserialize} | |
import sqlite3 | |
def serialize(): | |
con = sqlite3.connect(":memory:") | |
cur = con.cursor() | |
cur.execute("CREATE TABLE movie(title, year, score)") | |
cur.execute(""" | |
INSERT INTO movie VALUES | |
('Monty Python and the Holy Grail', 1975, 8.2), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install -y build-essential certbot git \ | |
libjpeg-dev libxml2-dev libxslt1-dev zlib1g-dev nginx \ | |
python3-certbot-nginx python3-dev python3-pip python3-virtualenv \ | |
python3-dev python3-pip python3-click python3-virtualenv \ | |
uwsgi uwsgi-plugin-asyncio-python3 uwsgi-plugin-gevent-python3 \ | |
uwsgi-plugin-python3 uwsgi-plugin-tornado-python3 \ | |
uwsgi-plugin-lua5.1 uwsgi-plugin-lua5.2 uwsgi-plugin-luajit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.configure do | |
config.hosts << /[a-z\-]+\.trycloudflare\.com/ | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sequenceDiagram | |
Browser->>+Server: Generate and store the WebAuthn User ID | |
Server->>+Server: generate challenge, and store in session | |
Server-->>+Browser: options | |
Browser->>+User: create (local call to device) | |
User-->+Browser: PublicKeyCredential |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://docs.micropython.org/en/v1.18/develop/natmod.html | |
# python env setup | |
pyenv local 3.10.2 #version doesn't matter so much | |
python -m venv venv # setup venv | |
source venv/bin/activate | |
# install python build tools | |
pip install 'pyelftools>=0.25' | |
# setup micropython env |