This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isWorn() { | |
console.log(Bangle.isCharging(), E.getTemperature(), Bangle.getAccel().mag); | |
if (Bangle.isCharging()) | |
return false; | |
if (E.getTemperature() >= 33.1) | |
// https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8266026/table/T2/ | |
return true; | |
if (Bangle.getAccel().mag >= 1.02) | |
return true; | |
return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GNU GENERAL PUBLIC LICENSE | |
Version 3, 29 June 2007 | |
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> | |
Everyone is permitted to copy and distribute verbatim copies | |
of this license document, but changing it is not allowed. | |
Preamble | |
The GNU General Public License is a free, copyleft license for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:root { | |
--bg-color: #ffffff; | |
--font-color: #000000; | |
/* highest contrast colors | |
for light and dark themes */ | |
--red: #ec0000; | |
--green: #008900; | |
--blue: #5f5fff; | |
--gray: #757575; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; Personal configuration -*- lexical-binding: t -*- | |
;; Save the contents of this file under ~/.emacs.d/init.el | |
;; Do not forget to use Emacs' built-in help system: | |
;; Use C-h C-h to get an overview of all help commands. All you | |
;; need to know about Emacs (what commands exist, what functions do, | |
;; what variables specify), the help system can provide. | |
;; Add the NonGNU ELPA package archive | |
(require 'package) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node: | |
def __init__(self, info): | |
self.info = info | |
self.left = None | |
self.right = None | |
self.level = None | |
def __str__(self): | |
return str(self.info) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python3 | |
import math | |
import os | |
import random | |
import re | |
import sys | |
# | |
# Complete the 'equalStacks' function below. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
collatz :: Integer -> Integer | |
collatz n = | |
if even n | |
then n `div` 2 | |
else 3 * n + 1 | |
collatzSeq :: Integer -> [Integer] | |
collatzSeq n = | |
if n == 1 -- base case | |
then 1 : [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def temperature_blink(temp_sensor, fahrenheit=True): | |
# get 16 bit unsigned integer | |
reading = temp_sensor.read_u16() | |
# conversion factor from 3.3V battery | |
to_volts = 3.3 / 65535 | |
# scale temperature | |
ADC_voltage = reading * to_volts | |
# approximate temperature (C) | |
temperature = 27 - (ADC_voltage - 0.706) / 0.001721 | |
# optional temperature conversion (F) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/tls" | |
"fmt" | |
"log" | |
"net/http" | |
"time" | |
"github.com/NYTimes/gziphandler" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.