This Gist was automatically created by Carbide, a free online programming environment.
This file contains 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
-- Number of steps in the sequence | |
num_steps = 8 | |
-- Length of each step in seconds | |
step_length = 0.125 | |
-- Maximum pitch variation per step | |
pitch_variation = 0.02 | |
-- Filter cutoff frequency range (Hz) | |
filter_min = 100 | |
filter_max = 5000 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
import { useEffect, useRef } from "react"; | |
export function useKeyPress(key: string, handler: (evt: Event) => void) { | |
const eventListenerRef = useRef<(evt: KeyboardEvent) => void>(); | |
useEffect(() => { | |
console.log("redefine movement"); | |
eventListenerRef.current = (event: KeyboardEvent) => { | |
if (event.key === key) { | |
handler?.(event); |
This file contains 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
import os | |
import requests | |
import time | |
import datetime | |
import sys | |
import signal | |
from papirus import PapirusComposite | |
screen = PapirusComposite(False) |
This file contains 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* fib(a, b) { | |
let c = 0 | |
yield a | |
yield b | |
while (true) { | |
c = a + b | |
a = b | |
b = c | |
yield c |
This file contains 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
import React from 'react'; | |
import Camera from './Camera'; | |
import Shake from 'shake.js'; | |
class Player extends Component { | |
componentDidMount() { | |
this.shaker = new Shake({ | |
threshold: 5, | |
timeout: 250, | |
}); |
This file contains 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
var something = require('hello'); | |
var letter = 'A'; | |
function FooBar(words) { | |
var b = words || 'hello there'; | |
return something(b + "WOOOO"); | |
} | |
FooBar(letter); |
This file contains 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 toRad(deg) { | |
return deg * (Math.PI / 180); | |
} | |
function toDeg(rad) { | |
return rad / (Math.PI / 180); | |
} | |
const EARTH_R = 6378.1; | |
function getNewCoords(initLoc, distance, bearing) { | |
const bearingR = toRad(bearing); |
NewerOlder