Skip to content

Instantly share code, notes, and snippets.

View PiterWeb's full-sized avatar
🤔
Cavilando

PiterDev PiterWeb

🤔
Cavilando
View GitHub Profile
@mondain
mondain / public-stun-list.txt
Last active July 25, 2024 15:19
Public STUN server list
23.21.150.121:3478
iphone-stun.strato-iphone.de:3478
numb.viagenie.ca:3478
s1.taraba.net:3478
s2.taraba.net:3478
stun.12connect.com:3478
stun.12voip.com:3478
stun.1und1.de:3478
stun.2talk.co.nz:3478
stun.2talk.com:3478
@nathan-osman
nathan-osman / win32.go
Last active July 18, 2024 16:55
Simple Windows GUI application written in Go
package main
import (
"log"
"syscall"
"unsafe"
)
var (
kernel32 = syscall.NewLazyDLL("kernel32.dll")
@egonelbre
egonelbre / glfw_example.go
Last active August 21, 2023 15:15
Input handling in Go for games
// adjust the input/controller to your own liking
type Device interface {
Update(input *Controller, window *glfw.Window)
}
// this is the general
type Controller struct {
ID int
Device Device
@aguilarcarlos
aguilarcarlos / swipe.js
Last active February 24, 2024 13:52
Swipe JS for Mobile App
/**
* @name _swipe
* Small event handler for swipe in mobile phones using javascript, this handler is based on http://stackoverflow.com/a/27115070
* This handler supports classes, ids and elements.
* @author David Aguilar
* @example
*
* _swipe("#element", function(dir, elem) {
* console.info("You're swiping to %s direction.", dir.type);
* });
@cs8425
cs8425 / keyemu.go
Last active February 1, 2024 15:26
simple keyboard & mouse binding over web in golang
// build:
// GOOS=windows GOARCH=386 go build -o keyemu.exe keyemu.go
// GOOS=windows GOARCH=amd64 go build -o keyemu-x64.exe keyemu.go
// pre-build: https://mega.nz/#F!c9M0VaqK!sjUh5jwAU1tYkVv8z9YqaQ
// ref: https://github.com/micmonay/keybd_event
package main
@trusktr
trusktr / image-grid.md
Last active July 2, 2024 15:25
Image grid in Markdown
screen shot 2017-08-07 at 12 18 15 pm blah screen shot 2017-08-07 at 12 18 15 pm screen shot 2017-08-07 at 12 18 15 pm
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active July 20, 2024 05:29
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@sevkin
sevkin / getfreeport.go
Last active July 9, 2024 17:41
get free port in golang
// GetFreePort asks the kernel for a free open port that is ready to use.
func GetFreePort() (port int, err error) {
var a *net.TCPAddr
if a, err = net.ResolveTCPAddr("tcp", "localhost:0"); err == nil {
var l *net.TCPListener
if l, err = net.ListenTCP("tcp", a); err == nil {
defer l.Close()
return l.Addr().(*net.TCPAddr).Port, nil
}
}
@OrionReed
OrionReed / dom3d.js
Last active July 22, 2024 08:58
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯