Skip to content

Instantly share code, notes, and snippets.

@kikito
kikito / grid.lua
Created May 29, 2014 12:48
Grid traversal
local grid = {}
local function grid_toCell(cellSize, x, y)
return math.floor(x / cellSize) + 1, math.floor(y / cellSize) + 1
end
-- grid_traverse* functions are based on "A Fast Voxel Traversal Algorithm for Ray Tracing",
-- by John Amanides and Andrew Woo - http://www.cse.yorku.ca/~amana/research/grid.pdf
-- It has been modified to include both cells when the ray "touches a grid corner",
-- and with a different exit condition
@kikito
kikito / Console editor ideas.md
Last active May 25, 2021 10:45
Console editor ideas

Single executable which works out-of-the box.

  • Extra libraries could add extra features. I/e if no regex library available, then only text is available.
  • Space for logs/temp files. If not available/writable, editor is still able to work, with diminished functions.

Plugin-based

  • Core functionality is single-file, single-screen editing, with client-server. Almost everything else is plugins.
  • Should have good defaults. Not minimal, but can be made minimal. Not an IDE either. Walk the thin line.
  • You can replace core plubins with other plugins from the community
  • a list

  • of items with paragraphs

  • another item with a paragraph

    and another line

  • and now a last item

  • this time with a subitem

[
{
"traceId": "5ab6dfe40fd2d7844cceed129c087c01",
"parentId": "9258d475e01f9b85",
"id": "5f65af42e0735adf",
"name": "get (balancer try 1)",
"timestamp": 1578931517364000,
"localEndpoint": {
"serviceName": "kong"
},
@kikito
kikito / tl.svg
Created March 12, 2019 14:07
tl.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kikito
kikito / assert_contains.lua
Created August 29, 2014 11:44
Lua Busted table contains assertion
local s = require("say")
local function contains(container, contained)
if container == contained then return true end
local t1,t2 = type(container), type(contained)
if t1 ~= t2 then return false end
if t1 == 'table' then
for k,v in pairs(contained) do
if not contains(container[k], v) then return false end
@kikito
kikito / tools.md
Last active March 19, 2018 21:39
Comparison of JS charting libraries for an Angular-based JS project

I got this list from wikipedia. Then I removed all the libraries that where not MIT, Apache or BSD and those with no sourcecode metrics (i.e. not on github, bitbucket, or trak). And then I added the columns I wanted.

Library Source Last Commit Last Closed Issue Stars Forks Ng-bindings Dependencies
ricksaw github 1 month ago 1 month ago 4309 685 Yes D3.js
nvd3 github 2 days ago 1 day ago 2433 814 Yes D3.js
Flot github 14 days ago 9 days ago 3349 842 Yes 1, [2](https://git
@kikito
kikito / within_cells_interlinked.md
Last active February 9, 2018 23:21
Blade Runner 2049: The Complete Experience

Ok here's what I recommend for before watching Blade Runner 2049:

  • Watch Blade Runner: The Final Cut (from 2007). Beware that there are other versions but they are worse. The original one that aired on the cinema was especially bad, since they changed the ending to make it "happy".

  • Listen to this episode of iddle weekend (they start discussing BRTFC @ 54:40).

  • There's actually more things you can watch before BR 2049; they created 3 free short movies as well. They "link" the events between the original one and the new one. Here they are:

    1. Black Out 2022
  1. 2036: Nexus Dawn
@kikito
kikito / gui.txt
Last active June 8, 2016 04:51
rummagings about gui design
An UI has several parts:
1. The "Layout": Defines the space each control takes. "This button is 32x32 px and is located in 100,100"
2. The "Function": what happens when a control is used. "This needs to happen when this button is pressed"
3. The "Skin": how each control is displayed. "This button, with this state, is a red circle"
4. Bells and whistles: Things like state animations, or playing a sound when a button is hovered.
5. Current focus.
6. A way to handle input: Move focus to next item. "There is a pointer pressing on this position".
Problems: