View gist:50d83311519898fb0f9635b87bbf1c22
This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am firedev on github. | |
* I am firedev (https://keybase.io/firedev) on keybase. | |
* I have a public key ASAx0EdMDYGlPGXQUvWIvi76fKLc6n5oeYeFyPAhfqlB3Ao | |
To claim this, I am signing this object: |
View .md
With the introduction of the function type() it is now possible to know the type of the variable.
So I tried to find a way to implement a simple class system and I think I found a way
First we need a function to copy tables
function copy(o)
local c
View .p8
This file contains 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://twitter.com/lucatron_/status/1252171663883423745 | |
-- https://gist.github.com/lucatronica/5d1b2bdceced5d5f1315b8e2f252146e | |
for i=1,8 do pal(i,({8,11,10,140,14,12,7})[i],1)end | |
::_::cls() | |
?"#pico8♥",0,0,8 | |
for i=0,2 do | |
k=.25+i/60+cos(t()/8)/5 | |
for y=0,5,.25 do | |
for x=0,30,.25 do |
View asyncWrap.js
This file contains 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
const asyncWrap = (promise) => ( | |
promise.then(res => [res]).catch(err => [undefined, err]) | |
) | |
const func = async () => { | |
const [result, error] = await asynced( doStuff()) ) | |
} |
View collision.p8
This file contains 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
--[[ collision detection ]]-- | |
-- point inside the rectangle | |
function is_point_in_rect(x,y,left,top,right,bottom) | |
return top<y and y<bottom and left<x and x<right | |
end | |
function lines_overlapping(min1, max1, min2, max2) | |
return min1>min2 and max2>min1 | |
end |
View icons.rb
This file contains 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
require 'ostruct' | |
css = File.read('apps/src/stylesheets/sagamore/_buttons.scss').split("\n") | |
find_images = -> line { line[/"(.+)"/]; $1 } | |
check_for_file = -> name { OpenStruct.new(name: name, exists: File.exists?("apps/src/images/icons/#{name}.png")) } | |
format_filenames = -> file_exists { OpenStruct.new(name: (file_exists.name + '.png' + ' ' * 20)[0, 20], exists: file_exists.exists) } | |
print_results = -> file_exists { puts "#{file_exists.name}\t #{file_exists.exists ? '✅' :'⛔'}" } | |
css.map(& find_images).compact.map(& check_for_file).map(& format_filenames).map(& print_results) |
View bottomless_spec.rb
This file contains 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
class BottomlessHash < Hash | |
def initialize | |
super &-> h, k { h[k] = self.class.new } | |
end | |
def self.from_hash(hash) | |
new.merge(hash) | |
end | |
end |
View colors.rb
This file contains 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
#!/usr/bin/env ruby | |
require 'paleta' | |
to_paleta = ->(color) { Paleta::Color.new(:hex, color) rescue nil } | |
to_div = ->(str) { | |
"<div style='font-family: sans-serif; width: 5em; height: 3em; | |
line-height: 3em; display: inline-block; text-align: center; | |
margin: 0.25em; border-radius: 0.25em; padding: 1em; | |
background: ##{str}'> |
View gist:5bc7de39c7407eaad105
This file contains 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
# global $ | |
React = require('react') | |
class Drawer extends React.Component | |
@defaultProps: -> | |
payload: null, | |
drawerOpened: false | |
notFound: -> |
NewerOlder