Skip to content

Instantly share code, notes, and snippets.

Avatar
🔥
on fire

Federico Maggi fredmaggiowski

🔥
on fire
View GitHub Profile
@fredmaggiowski
fredmaggiowski / truncate.go
Created Oct 19, 2016
An example of string normalisation with truncation and transformation of first letter to uppercase.
View truncate.go
package main
import (
"bytes"
"fmt"
"unicode"
)
const MaxLength = 50
@fredmaggiowski
fredmaggiowski / octa.css
Created Sep 7, 2016
Octagon HTML/CSS shape
View octa.css
.my-container {
margin-top: 50px;
padding: 20px;
font-size: 18px;
}
.octagon {
display: inline-block;
width: 40px !important;
height: 20px;
@fredmaggiowski
fredmaggiowski / float2rgb.js
Created Sep 7, 2016
A basic function to transform a float into a RGB value (from green to red)
View float2rgb.js
function f2R(f) {
var r = 255
var g = 255
var b = 0
var x = Math.abs(f - 0.5);
var i = Math.ceil(600 * (0.5 - x));
// range between green and yellow
if (f < 0.4) {
r = i
View gist:13e2bea8a5a5a185a796
### Keybase proof
I hereby claim:
* I am FedericoMaggi on github.
* I am fredmaggiowski (https://keybase.io/fredmaggiowski) on keybase.
* I have a public key whose fingerprint is 1920 140A 9579 B5BA 914B 5A03 5432 FBB8 D04F 965E
To claim this, I am signing this object:
View keybase.md

Keybase proof

I hereby claim:

  • I am fredmaggiowski on github.
  • I am fredmaggiowski (https://keybase.io/fredmaggiowski) on keybase.
  • I have a public key ASCtOxWIt4sF-r_yOsMmYts_x2P-ZlEtcW-1-UICMSQu8wo

To claim this, I am signing this object: