Skip to content

Instantly share code, notes, and snippets.

View catwell's full-sized avatar

Pierre Chapuis catwell

View GitHub Profile
@catwell
catwell / cloc.txt
Created March 19, 2024 10:26
Lines of code in Python, Lua, PHP and Ruby
=== Python-3.12.2 ===
github.com/AlDanial/cloc v 2.00 T=5.10 s (775.6 files/s, 446163.8 lines/s)
---------------------------------------------------------------------------------------
Language files blank comment code
---------------------------------------------------------------------------------------
Python 1946 136288 157620 635104
C 365 60311 57289 411210
C/C++ Header 492 21539 11893 206768
reStructuredText 490 85145 106460 102226
Text 133 2830 0 96064
@catwell
catwell / johnny-refiners.txt
Created December 14, 2023 15:44
Refiners dependency graph (all extras) w/ JohnnyDep
name summary
-------------------------------------------------- -------------------------------------------------------------------------------------------------------
refiners[conversion,test,training] The simplest way to train and run adapters on top of foundational models
├── bitsandbytes<0.42.0,>=0.41.0 k-bit optimizers and matrix multiplication routines.
├── datasets<3.0.0,>=2.14.0 HuggingFace community-driven open-source library of datasets
│ ├── aiohttp Async http client/server framework (asyncio)
│ │ ├── aiosignal>=1.1.2 aiosignal: a list of registered asynchronous callbacks
│ │ │ └── frozenlist>=1.1.0 A list-like structure which implements collections.abc.MutableSequence
│ │ ├── attrs>=17.3.0 Classes Without Boilerplate
│ │ ├── frozenlist>=1.1.1 A list
@catwell
catwell / bearer-seg.log
Created March 7, 2023 13:44
Bearer segfault
[bearer_1.0.0_linux_amd64 14:43] ./bearer scan bear-publishing
Loading rules
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x1d93a0 pc=0x7fc16c092f16]
runtime stack:
runtime.throw({0x1520dac?, 0x352?})
/opt/hostedtoolcache/go/1.19.6/x64/src/runtime/panic.go:1047 +0x5d fp=0x7fc16d518fc8 sp=0x7fc16d518f98 pc=0x43c55d
runtime.sigpanic()
/opt/hostedtoolcache/go/1.19.6/x64/src/runtime/signal_unix.go:819 +0x369 fp=0x7fc16d519018 sp=0x7fc16d518fc8 pc=0x452189
@catwell
catwell / 2022-11-27.rb
Created November 29, 2022 13:53
Binary tree serialization 😈
# Evil answer, don't try this at home 😈
def serialize(node, inbuf = nil)
buf = inbuf || StringIO.new
buf.write('Node.new(')
buf.write(node.val.inspect)
if node.left
buf.write(', ')
serialize(node.left, buf)
if node.right
@catwell
catwell / 2022-11-26.rb
Created November 28, 2022 13:51
smlpth daily 2022-11-26
def efficient_part2(input)
n = input.length
r = Array.new(n, 1)
p_up, p_down = 1, 1
0.upto(n - 1) do |i|
j = n - i - 1
r[i] *= p_up
r[j] *= p_down
p_up *= input[i]
p_down *= input[j]
@catwell
catwell / multipart.lua
Created November 9, 2022 09:12
Helping nodecentral with multipart post
-- see https://github.com/catwell/lua-multipart-post/issues/8#issuecomment-1307934583
-- fixed version (see diff)
local http = require("socket.http")
local ltn12 = require("ltn12")
local lfs = require "lfs"
http.TIMEOUT = 5
local function upload_file ( url, filename )
local fileHandle = io.open( filename,"rb")
@catwell
catwell / plnutil.d.tl
Created October 12, 2022 08:37
Pallene routines used in a backpropagation algorithm in Teal
local record plnutil
vec_zeros: function(integer): {number}
mat_zeros: function(integer, integer): {{number}}
mat_vec_mul: function({{number}}, {number}): {number}
mat_t_vec_mul: function({{number}}, {number}): {number}
vec_vec_2d_mul: function({number}, {number}): {{number}}
vec_pointwise_mul: function({number}, {number}): {number}
vec_add_inplace: function({number}, {number}, number)
mat_add_inplace: function({{number}}, {{number}}, number)
vec_clip_inplace: function({number},number, number)
@catwell
catwell / inch-staff-eng-public.md
Last active February 18, 2023 16:52
Staff Software Engineer chez Inch (version publique)

Staff Software Engineer chez Inch

Objet du document

Ce document décrit le poste de Staff Software Engineer chez Inch. Cette version est quasiment identique à la version interne à part à quelques endroits indiqués par le mot SNIP.

Généralités sur les ladder techniques

Les niveaux de début de carrière d'un ingénieur logiciel (on va dire dev par la suite) sont relativement bien connus, en gros :

@catwell
catwell / tiobe.md
Last active April 20, 2021 12:59
TIOBE Proficiency
  • 0 : (Almost) never used
  • 1 : I know the basics
  • 2 : I can code in it
  • 3 : Used professionally
Language Proficiency
C 3
Java 1
Python 3
@catwell
catwell / mercury-new.sh
Last active February 1, 2020 18:53
Use Mercury
wget https://raw.githubusercontent.com/oploadk/localua/master/localua.sh
sh localua.sh lua 5.1.5
./lua/bin/luarocks install https://raw.githubusercontent.com/catwell/mercury/master/rockspecs/mercury-scm-0.rockspec
wget https://raw.githubusercontent.com/catwell/mercury/master/samples/greetings.lua
./lua/bin/mercury greetings