Skip to content

Instantly share code, notes, and snippets.

View Mimerme's full-sized avatar
🛠️
Stuff-ing.

Yaros Mimerme

🛠️
Stuff-ing.
View GitHub Profile
@cryptolok
cryptolok / dbm2m.py
Last active August 19, 2023 12:29
convert WiFi signal strength (dBm) to distance (meters)
#!/usr/bin/env python2
# a simple script for one of my articles - https://cryptolok.blogspot.com/2017/08/practical-wifi-hosts-triangulation-with.html
from math import log10
MHz=raw_input('MHz FREQUENCY (2417, 5200, ...) : ')
MHz=int(MHz)
dBm=raw_input('dBm TRANSMITTER POWER (23, 63, ...) : ')
@DarinM223
DarinM223 / main.rs
Created January 16, 2017 05:12
Glium drawing a textured rectangle
#[macro_use]
extern crate glium;
extern crate cgmath;
extern crate image;
use cgmath::{Vector2, Matrix4};
use glium::glutin;
use glium::{DisplayBuild, Surface};
use std::io::Cursor;
@jupdike
jupdike / IntersectTwoCircles.js
Last active April 19, 2024 06:13
Find the intersections (two points) of two circles, if they intersect at all
// based on the math here:
// http://math.stackexchange.com/a/1367732
// x1,y1 is the center of the first circle, with radius r1
// x2,y2 is the center of the second ricle, with radius r2
function intersectTwoCircles(x1,y1,r1, x2,y2,r2) {
var centerdx = x1 - x2;
var centerdy = y1 - y2;
var R = Math.sqrt(centerdx * centerdx + centerdy * centerdy);
if (!(Math.abs(r1 - r2) <= R && R <= r1 + r2)) { // no intersection
@simias
simias / triangle.rs
Created February 9, 2015 21:30
Example program for gl-rs + rust-sdl2
// Copyright 2013 The gl-rs developers. For a full listing of the authors,
// refer to the AUTHORS file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software