Skip to content

Instantly share code, notes, and snippets.

@Ravaelles
Ravaelles / numberToColor
Created April 16, 2018 09:51
PHP function that converts number from given range into a color from given gradient of multiple colors
// See example: https://image.prntscr.com/image/cTIv8JkLR7yWEQxVev9SyA.jpeg
function numberToColor($value, $min, $max, $gradientColors = null)
{
// Ensure value is in range
if ($value < $min) {
$value = $min;
}
if ($value > $max) {
$value = $max;
@thurt
thurt / revprox.go
Last active August 4, 2025 13:41 — forked from JalfResi/revprox.go
Simple reverse proxy in Go (forked from original to use a struct instead of a closure)
package main
import(
"log"
"net/url"
"net/http"
"net/http/httputil"
)
func main() {
@ego008
ego008 / multiple-host-reverse-proxy.go
Last active September 20, 2024 09:14
Multiple host reverse proxy in Go
package main
import (
"log"
"net/http"
"net/http/httputil"
"net/url"
)
var (
@marshyon
marshyon / README.md
Last active May 17, 2021 11:11
Golang web server VueJS App in history mode and Go web services

Golang web server VueJS App in history mode and Go web services

vuejs cli

with the vuejs cli installed (https://github.com/vuejs/vue-cli)

vue init webpack my-project

answer questions for project setup, optionally installing unit tests but yes to vue-router

@asukakenji
asukakenji / go-stdlib-interface-selected.md
Last active July 19, 2025 10:43
Go (Golang) Standard Library Interfaces (Selected)

Go (Golang) Standard Library Interfaces (Selected)

This is not an exhaustive list of all interfaces in Go's standard library. I only list those I think are important. Interfaces defined in frequently used packages (like io, fmt) are included. Interfaces that have significant importance are also included.

All of the following information is based on go version go1.8.3 darwin/amd64.

@Lewiscowles1986
Lewiscowles1986 / dh-diagram.svg
Last active November 16, 2021 06:22
SSH with asymmetric key UML Sequence
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@posener
posener / go-shebang-story.md
Last active July 28, 2025 07:58
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@collinjackson
collinjackson / main.dart
Last active January 29, 2025 06:06
Demonstrates scrolling a focused widget into view
// Copyright 2017, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:async';
import 'package:meta/meta.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
/// A widget that ensures it is always visible when focused.
{
"female" : [
"Saanvi",
"Anya",
"Aadhya",
"Aaradhya",
"Ananya",
"Pari",
"Anika",
"Navya",