Show HN: Supershields.io – smart, Lua-powered SVG status badges
supershields.io
supershields.io
If you're interested in reading about the somewhat unorthodox product development process, I've written a blog article about it here: https://supershields.io/blog/1
The app is here: https://github.com/marketplace/supershields
Not sure how Github enterprise works though. Can you use regular Github apps with your enterprise installation?
but only for static data passed into query parameters.
Also, the API looks nice. Lots of image manipulation functionality. I've been thinking that the next step for Supershields would be some kind of lower level SVG creation API that lets people build their own SVGs from the ground up. This would also give them the ability to do more advanced stuff with images like your API can do (flipping and skewing etc.)
Yes, I thing they should add a design editor too.
Unless some css didn’t load up, I’ve got a huge horizontal bar.
Now when I remove that and add your "max-width: 100%" I don't see much of a problem. Sure, some content gets slightly misaligned on narrow screens but it looks pretty OK overall.
I just pushed the change now, should be visible within 5 minutes.
Being horribly old and needing glasses to see anything small but never having any glasses around, I find that my phone is pretty much useless for work. I guess I'm an outlier here. I'll just see what I can do to improve the mobile UX!
https://supershields.io/d1a18b018347defeec7b
Two questions:
1. text doesn't fit, how to fix that?
2. quote characters — «"» — get escaped as «"», how to avoid that?
The backend was a bit over-zealous about the HTML escaping...
If you're interested in embedding something like this on GitHub then you might want to check out Repography [1]. There are only a few styles of dashboards at the moment but I'm working on others.
Here’s an example of SVG animation https://github.com/sindresorhus/css-in-readme-like-wat
Also see https://badgen.net which is another alternative to the original post.
I wouldn't ever pay for stuff like this tho, but I hope that is just me.
6px LHS 4px | 4px RHS 6pxHmm, a bit rambling response, this one. I hope you get what I mean (and that I'm not completely clueless - have to look at the shields.io code again!)
I looked at the anafanafo package now and one of the first things they say in the presentation is "Built with Shields in mind"... So this package was custom made for shields.io, apparently. From a very quick check it seems to be a non-trivial amount of code, so not super simple to just port to Golang.
I don't want to have to start running Node and NPM packages, but would be very interested in any way to get this kind of functionality in a Go program.
package main
import (
"fmt"
"github.com/gotk3/gotk3/cairo"
)
var _cr *cairo.Context
func init() {
_cr = cairo.Create(cairo.CreateImageSurface(cairo.FORMAT_RGB24, 1000, 50))
_cr.SelectFontFace("Verdana", cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_NORMAL)
_cr.SetFontSize(11)
}
func measureTextWidth(t string) float64 {
return _cr.TextExtents(t).Width
}
func main() {
measureAndPrint := func(t string) {
fmt.Println(t, measureTextWidth(t))
}
measureAndPrint("build")
// build 24.7177734375
measureAndPrint("passing")
// passing 39.767578125
}
Not sure if performance would be acceptable, though.Some questions about lua:
- What dev environment do u prefer? When I looked last time I didn't really see a dedicated IDE for lua, mostly just plugins for vim/emacs.
- Did you consider lua in nginx? (Or what are you thoughts on it).
- Did you consider moonscript? (Or what are you thoughts on it)
I chose https://github.com/yuin/gopher-lua as the Lua engine because it is Golang-based, while the Nginx Lua VM is C, unless I'm mistaken. Using gopher-lua is just easier when I'm working in a Golang project. I only have to work in a single language and dev environment for all the backend work. Makes both development and testing easier.
Moonscript I might have heard of, but I have no experience with it. I did not consider it here, and I would rarely consider any niche scripting language for a solution I want others to use. It just introduces an unnecessary barrier to adoption.
Is it just a matter of setting headers?
Doesn't GitHub cache every image in their own CDN for security and control purposes?
But to repeat: auto-updating will not work for Github-hosted content AFAIK.
TL;DR is that most Lua engines seem to offer pretty weak support for sandboxing, unfortunately. Gopher-lua, that Supershields is using, makes it hard to adopt a whitelist-approach where you disable more or less everything and then enable just the functionality you want. Blacklisting (where you specify everything you want to disable) is fairly simple though, but not as secure of course.
For Supershields I have used a combination of blacklisting and running the scripts on serverless instances (AWS Lambda), which limits the impact of a breach.
[1] https://docs.aws.amazon.com/lambda/latest/dg/runtimes-contex...
Edit: I'm going to add some cleanup regardless.