Vidar Hokstad [email protected], 2023. Licensed under the MIT license.
With no options dir-commands looks for Makefile, Rakefile, Gemfile, package.json, .git etc. in
Vidar Hokstad [email protected], 2023. Licensed under the MIT license.
With no options dir-commands looks for Makefile, Rakefile, Gemfile, package.json, .git etc. in
| # Based on TinyWM by Nick Welch | |
| require 'X11' | |
| dpy = X11::Display.new | |
| root = dpy.screens.first.root | |
| # OK, so pure-x11 *really* badly needs built in keysym lookup, | |
| # but I don't want to add that without doing it properly, so this |
| # See https://cachemon.github.io/SIEVE-website/blog/2023/12/17/sieve-is-simpler-than-lru/ | |
| # for a description and the Python version | |
| # *LARGELY UNTESTED* | |
| Node = Struct.new(:value, :visited, :prev, :next) | |
| class SieveCache | |
| def initialize(capacity) | |
| @capacity = capacity | |
| @cache = {} |
For context, you probably want to look at this HN comment[1], and the chain leading up to it from [2], as well as the followup [3]
[1] https://news.ycombinator.com/item?id=38877833 [2] https://news.ycombinator.com/item?id=38862446 [3] https://news.ycombinator.com/item?id=38878014
Basically, it's an exploration in trying and repeatedly failing understand k, and eventually figuring out roughly how to translate this:
| module StateMachine | |
| def self.included(base) = base.extend(ClassMethods) | |
| def transition_to(to) | |
| before = self.class.do_before_transition(state) | |
| send(before) if before | |
| return @state = to | |
| end | |
| def tick args | |
| args.outputs.background_color = [0,0,0] | |
| args.outputs.labels << {x: 20, y: 700, text: "Landscape Test", r: 255, g: 255, b: 255 } | |
| args.pixel_array(:col).width = 1 | |
| args.pixel_array(:col).height = 200 | |
| px = args.pixel_array(:col).pixels | |
| 200.times do |y| | |
| y = y.abs.floor & 0xff | |
| col = y << 8 |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>ER Diagram with JointJS, Metallic Entities, and Drop Shadows (Fixed)</title> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.4.0/backbone-min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/jointjs/3.5.5/joint.min.js"></script> |
| // ==UserScript== | |
| // @name Floating Panel Class | |
| // @namespace http://tampermonkey.net/ | |
| // @version 1.0 | |
| // @description Reusable floating panel with indicators and burger menu | |
| // @author You | |
| // @grant none | |
| // ==/UserScript== | |
| (function() { |
| M = 4 | |
| Result = Data.define(:idx, :val) | |
| def gather(funcs) | |
| ready = Queue.new | |
| funcs.each_with_index {|val,idx| ready << Result.new(val:, idx:) } | |
| result = [] | |
| (0..M).map do | |
| Thread.new do |