Skip to content

Instantly share code, notes, and snippets.

View fynntimes's full-sized avatar

Fynn fynntimes

View GitHub Profile
@fynntimes
fynntimes / sharing.txt
Created March 14, 2022 00:56
Sharing the ROS includes stuff to host machine from Docker
First open a `cmr shell`.
Then run `docker cp [container_name]:/opt/ros/melodic ~/ros-melodic`.
Then run `docker cp [container_name]:/usr/include ~/ros-includes`.
Then run `sudo mv ~/ros-melodic/* /opt/ros/melodic`
Then run `sudo mv -vn ~/ros-includes/* /usr/include`
The -vn flag will make sure we don't overwrite anything we already have (because that would make some issues with versions)
@fynntimes
fynntimes / park_script.js
Created June 14, 2020 19:53
A fun little script to find the optimal park. Built on NodeJS
function haversine(lat1, lon1, lat2, lon2) {
const R = 3963.1676; // miles
const phi1 = lat1 * Math.PI / 180; // φ, λ in radians
const phi2 = lat2 * Math.PI / 180;
const deltaPhi = (lat2 - lat1) * Math.PI / 180;
const deltaLam = (lon2 - lon1) * Math.PI / 180;
const a = Math.sin(deltaPhi / 2) * Math.sin(deltaPhi / 2) +
Math.cos(phi1) * Math.cos(phi2) *
Math.sin(deltaLam / 2) * Math.sin(deltaLam / 2);

Keybase proof

I hereby claim:

  • I am faizaand on github.
  • I am sirfaizdat (https://keybase.io/sirfaizdat) on keybase.
  • I have a public key ASD8WVv7RFc134E-Im3i6JlAQJhJQYjvy7dOk8yW5UnKdAo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am faizaand on github.
  • I am sirfaizdat (https://keybase.io/sirfaizdat) on keybase.
  • I have a public key ASBYrFnRcfC9IYzSyNDW6hefSNT7ty9G9s4jSwkR-0PbMgo

To claim this, I am signing this object:

@fynntimes
fynntimes / simulations.py
Last active August 5, 2019 00:32
A general AP Statistics probability simulation script.
# Faizaan Datoo Pd3
# A very simple example of using technology to automate simulations :)
# I /could/ have made it more complicated, but that would defeat the point!
import random
print "Enter a range of digits."
# Get those numbers...
minVal = input("\tYour minimum value: ")
@fynntimes
fynntimes / sim_num25.py
Last active December 1, 2017 01:00
A simple script I threw together quickly to run simple AP Statistics simulations with probability.
# Faizaan Datoo Pd3
# A very simple example of using technology to automate simulations :)
# I /could/ have made it more complicated, but that would defeat the point!
import random
print "Enter a range of digits."
# Get those numbers...
minVal = input("\tYour minimum value: ")
@fynntimes
fynntimes / Calculator.kt
Created November 11, 2017 21:08
A rudimentary mathematical expression evaluator in Kotlin.
import java.util.*
import javax.script.ScriptEngine
import javax.script.ScriptEngineManager
import javax.script.ScriptException
// Instance variables
val engine: ScriptEngine = ScriptEngineManager().getEngineByName("JavaScript")
val jsMathMap = hashMapOf("sin" to "Math.sin", "cos" to "Math.cos", "tan" to "Math.tan", "pi" to "Math.PI")
fun main(args: Array<String>) {

Keybase proof

I hereby claim:

  • I am faizaand on github.
  • I am sirfaizdat (https://keybase.io/sirfaizdat) on keybase.
  • I have a public key whose fingerprint is 07E9 87D3 6C24 5A55 E5CE 0137 65C5 FDEE 203E EAFD

To claim this, I am signing this object:

// Imports, I just wrote this up quick in Gist
public class Cooldowns extends JavaPlugin {
private Map<UUID, Long> cooldowns = new HashMap<>();
private long cooldownDurationMillis = 3000; // 3 seconds (1000 millis = 1 second)
@Override public void onEnable() {
}

Keybase proof

I hereby claim:

  • I am SirFaizdat on github.
  • I am sirfaizdat (https://keybase.io/sirfaizdat) on keybase.
  • I have a public key whose fingerprint is 07E9 87D3 6C24 5A55 E5CE 0137 65C5 FDEE 203E EAFD

To claim this, I am signing this object: