Skip to content

Instantly share code, notes, and snippets.

View metehus's full-sized avatar
Trying to do something

Matheus Dias metehus

Trying to do something
View GitHub Profile
@fpillet
fpillet / scale.js
Created May 26, 2011 12:07
Javascript value scaling between two ranges
/* Scale a value from one range to another
* Example of use:
*
* // Convert 33 from a 0-100 range to a 0-65535 range
* var n = scaleValue(33, [0,100], [0,65535]);
*
* // Ranges don't have to be positive
* var n = scaleValue(0, [-50,+50], [0,65535]);
*
* Ranges are defined as arrays of two values, inclusive
@pedrofracassi
pedrofracassi / ginconecta_cade.js
Created April 8, 2020 18:52
Script usado pra formatar as respostas de um .txt pra tarefa "Cadê" da Ginconecta 2020.
const clipboardy = require('clipboardy');
const fs = require('fs')
let last = ''
setInterval(() => {
fs.readFile('palavras.txt', 'utf8', function(err, data) {
const resposta = `Equipe: Oficina / Resposta: ${data.split('\r\n').map(w => w.charAt(0).toUpperCase() + w.slice(1)).sort().join(', ')}`
if (resposta !== last) {
last = resposta
@th0mk
th0mk / export.json
Created June 24, 2020 08:24
.fmbot grafana dashboard
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@metehus
metehus / theme.css
Created February 19, 2022 18:48
JSONVue extension theme
body {
white-space: pre-wrap;
word-break: break-word;
font-family: 'Jetbrains Mono', monospace;
}
.property {
font-weight: bold;
}