Skip to content

Instantly share code, notes, and snippets.

@xposedbones
xposedbones / map.js
Last active May 1, 2024 11:15
Javascript Map range of number to another range
Number.prototype.map = function (in_min, in_max, out_min, out_max) {
return (this - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
@yayoF
yayoF / gist:224c43e34705a6e51afc725d760f7a53
Last active May 1, 2024 11:14
Install Telegram Desktop in Ubuntu
Download the telegram Desktop client here https://desktop.telegram.org/
Go to the client location in terminal and extract the package with < tar xf archive.tar.xz >
Now you have a folder called < Telegram >
Move this folder to /opt
Double-click the telegram binary in /opt/Telegram/Telegram.
Bonus: to add Telegram to de "applications" menu, right-click the icon of the runing app and choose "lock to launcher"
bon appetit
sources:
@qoomon
qoomon / conventional_commit_messages.md
Last active May 1, 2024 11:12
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@pmkay
pmkay / installing-postman.md
Created April 27, 2020 02:49 — forked from ba11b0y/installing-postman.md
Installing Postman on Ubuntu/Gnome

Since Chrome apps are now being deprecated. Download postman from https://dl.pstmn.io/download/latest/linux

Although I highly recommend using a snap

sudo snap install postman

Installing Postman

tar -xzf Postman-linux-x64-5.3.2.tar.gz
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 1, 2024 11:13
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@kingsh2012
kingsh2012 / 01-storage-class.yaml
Created May 1, 2024 11:07 — forked from mauriballes/01-storage-class.yaml
Kubernetes PostgreSQL StatefulSet
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: local-storage
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer

If you're using clojure.tools.logging with SLF4J.

It's often useful to 'switch on' logging for a given web request, or during the evaluation of a given form, etc.

Add this to your logback.xml configuration:

  <turboFilter class="ch.qos.logback.classic.turbo.MDCFilter">
    <MDCKey>logging</MDCKey>
    <Value>on</Value>