Skip to content

Instantly share code, notes, and snippets.

@zachisit
zachisit / main.dart
Created December 1, 2020 12:08
Dart utility methods to convert a gps coordinate to Cardinal
void main() {
Map<String,dynamic> toDegreesMinutesAndSeconds(double coord) {
double absolute = coord.abs();
int degrees = absolute.floor();
double minutesNotTruncated = (absolute - degrees) * 60;
int minutes = minutesNotTruncated.floor();
double seconds = ( (minutesNotTruncated - minutes) * 60 );
return {
@tdegrunt
tdegrunt / bt-agent.service
Created June 28, 2019 05:56 — forked from rcarmo/bt-agent.service
Set up PAN networking on Raspbian Stretch (use sudo to create these files and run all commands)
# in /etc/systemd/system
[Unit]
Description=Bluetooth Agent
[Service]
ExecStart=/usr/bin/bt-agent -c NoInputNoOutput
Type=simple
[Install]
WantedBy=multi-user.target
@pdp7
pdp7 / BB-LCD-ADAFRUIT-18-SPI1-00A0.dts
Last active December 22, 2023 08:34
src/arm/BB-LCD-ADAFRUIT-18-SPI1-00A0.dts overlay for Adafruit 1.8" TFT LCD with tinydrm st7735 driver with PWM backlight
/*
* Copyright (C) 2013 CircuitCo
* Copyright (C) 2018 Drew Fustini <[email protected]>
*
* Adafruit 1.8" TFT LCD on SPI1 bus using tinydrm st7735r driver
*
* LICENSE:
* --------
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@madox2
madox2 / draw_lines_using_div.js
Created August 7, 2016 15:29
draw lines on html page using div elements
/**
* Creates line element on given position, with given length and angle.
*/
function createLineElement(x, y, length, angle) {
var line = document.createElement("div");
var styles = 'border: 1px solid black; '
+ 'width: ' + length + 'px; '
+ 'height: 0px; '
+ '-moz-transform: rotate(' + angle + 'rad); '
+ '-webkit-transform: rotate(' + angle + 'rad); '
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active June 6, 2025 14:36
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@myrtleTree33
myrtleTree33 / install-node-pi.sh
Last active March 8, 2024 22:37
Install Node JS in 30 seconds for Raspberry Pi / ARM
#!/bin/bash
## Check for versions compiled with ARM at http://nodejs.org/dist/
## Inspired by http://oskarhane.com/raspberry-pi-install-node-js-and-npm/
## Fill in the Node Version here:
##########################################################################
NODE_VERSION="v0.10.21"