Skip to content

Instantly share code, notes, and snippets.

View voluntas's full-sized avatar
🎲
Focusing

voluntas voluntas

🎲
Focusing
View GitHub Profile
@hideaki-t
hideaki-t / nvblas.md
Last active December 14, 2022 03:43
View nvblas.md
View try-d1.md

npm i wrangler -g でアップデートした時に次のログが見えた

The latest release of wrangler is "2.0.15".

Other releases are:
  * pages: 0.0.0-96e612b
  * beta: 0.0.0-ea7ee45
  * wasm: 0.0.0-70a118b
  * d1: 0.0.0-d35c69f
@johnspurlock-skymethod
johnspurlock-skymethod / r2-notes.md
Last active October 26, 2023 21:42
Unofficial R2 notes
View r2-notes.md
@mitchellh
mitchellh / Atlas.zig
Last active September 12, 2023 01:57
Bin-packed texture atlas implementation in Zig. https://en.wikipedia.org/wiki/Texture_atlas
View Atlas.zig
//! Implements a texture atlas (https://en.wikipedia.org/wiki/Texture_atlas).
//!
//! The implementation is based on "A Thousand Ways to Pack the Bin - A
//! Practical Approach to Two-Dimensional Rectangle Bin Packing" by Jukka
//! Jylänki. This specific implementation is based heavily on
//! Nicolas P. Rougier's freetype-gl project as well as Jukka's C++
//! implementation: https://github.com/juj/RectangleBinPack
//!
//! Limitations that are easy to fix, but I didn't need them:
//!
View basic-tcp-chat.zig
const std = @import("std");
const net = std.net;
const Queue = std.atomic.Queue;
const ArenaAllocator = std.heap.ArenaAllocator;
// THIS _MUST_ be placed in your main.zig file
pub const io_mode = .evented;
pub fn main() anyerror!void {
@azu
azu / TypeScriptの設定の良し悪し.md
Last active December 8, 2023 06:25
TypeScriptの設定の良し悪し
View TypeScriptの設定の良し悪し.md

tsconfig.json の設定についてのメモ書きです。

Node.jsのバージョンごとの設定

target は 変換後のコードのECMAScriptバージョンを指定する たとえば、Node.js 14はES2020をサポートしている。そのため、Node.js 14向けのコード(サーバなど)ならtarget: "ES2020"を指定することで、余計なTranspileが省かれててコードサイズや実行時間が最適化される。

@ityonemo
ityonemo / test.md
Last active December 8, 2023 06:07
Zig in 30 minutes
View test.md

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@kprotty
kprotty / ThreadPool.zig
Last active July 16, 2022 14:43
An isolated thread pool implementation for Zig
View ThreadPool.zig
const std = @import("std");
const system = std.os.system;
pub const Scheduler = struct {
pub const InitConfig = struct {
max_threads: ?u16 = null,
};
pub fn init(self: *Scheduler, config: InitConfig) !void {
View 1ヶ月で10,000行くらいのコードを書いた話など.md

この記事はpyspa advent calendar 2020の18日目の記事です。前日は、flagboyの配られたカードで勝負するでした。主旨は異なりますが、徒然草百十段の「双六の名人」が思い出されました。明日はYutaka Matsubara a.k.a. mopemopeさんの記事となります。お楽しみに。

1ヶ月で10,000行くらいのコードを書いた話

行数を書くと「いやいや、私はもっと高い生産性を持っている」、という方は少なくないだろう。登大遊氏に至っては、ネットワークプログラミングという複雑な領域での実装でありながら「1日に少なくとも3,000行程度、多く書くときで10,000行」と述べており、凡才さを思い知らされる。

さて、この記事は、私のような動物でも高効率にコードを書くために何をしたのかを備忘として残しておく主旨である。

開発環境編

View ClockworkBase32.thy
(* This file is to be opened in Isabelle2020 available from
https://isabelle.in.tum.de/
Lots of symbols look nicer there. Instead of ↦, you'll see an arrow.
Moreover, Isabelle checks definitions are definitions and theorems are theorems.
*)
text ‹
Copyright 2020 Yoichi Hirai
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.