Skip to content

Instantly share code, notes, and snippets.

@willurd
willurd / web-servers.md
Last active July 5, 2024 18:32
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@petrklus
petrklus / rgb_to_kelvin.py
Last active April 10, 2024 11:20
Kelvin to RGB in python
"""
Based on: http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/
Comments resceived: https://gist.github.com/petrklus/b1f427accdf7438606a6
Original pseudo code:
Set Temperature = Temperature \ 100
Calculate Red:
If Temperature <= 66 Then
@nalgeon
nalgeon / cities.md
Last active March 28, 2024 01:19
Города России с координатами
@thomasbnt
thomasbnt / code_colors_discordjs.md
Last active June 26, 2024 15:22
Code colors for embed discord.js

Here is an updated list of the colors that are currently implemented with a name. To using colors on discord.js, this is a typedef Colors, Colors.Aqua to get the Aqua color.

Name Int value Hex Code
Default 0 #000000
Aqua 1752220 #1ABC9C
DarkAqua 1146986 #11806A
Green 5763719 #57F287
DarkGreen 2067276 #1F8B4C
@ctron
ctron / tekton-cleanup.yaml
Last active May 10, 2024 12:18
Cleaning up Tekton pipeline runs
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: cleaner
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: cleaner
@MRLokop
MRLokop / money-hotel-calculator.js
Last active July 20, 2022 17:30
Калькулятор цены с условием Гоши
const total = 35852 // Цена всего
const night = total / 4 // Цена одной ночи
const withoutGosha = night / 3 // Цена для 1 участника, при условии что участников 3
const withGosha = night / 4 // Цена для 1 участника, при условии что участников 4
console.log( "Gosha: " + withGosha * 2 ) // Сколько Георгий должен за 2 ночи
console.log( "Other: " + ((withoutGosha * 2) + (withGosha * 2)) ) // Сколько должен каждый другой участник