Simple loan calulator, just run in the browser
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
<!doctype html> | |
<html> | |
<head> | |
<!-- Based on http://codepen.io/lbebber/pen/ypgql --> | |
<link href="http://necolas.github.io/normalize.css/3.0.2/normalize.css" rel='stylesheet'/> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script> | |
<style> | |
/* Just colors and font sizes */ | |
* { | |
font-family: sans-serif; |
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 pyaudio | |
p = pyaudio.PyAudio() | |
info = p.get_host_api_info_by_index(0) | |
numdevices = info.get('deviceCount') | |
for i in range(0, numdevices): | |
if (p.get_device_info_by_host_api_device_index(0, i).get('maxInputChannels')) > 0: | |
print("Input Device id ", i, " - ", | |
p.get_device_info_by_host_api_device_index(0, i).get('name')) |
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
''' | |
Run an efficient loop that checks on the RP2 temperature every second. | |
If the tempt exceeds a threshold, turn the fan on until the next check. | |
pip install gpiozero | |
''' | |
from gpiozero import LED | |
from time import sleep |
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
.link-underline a { | |
border-bottom: 3px solid #b4e7f8; | |
box-shadow: inset 0 -5px 0 #b4e7f8; | |
color: inherit; | |
transition: background .15s cubic-bezier(.33,.66,.66,1); | |
} | |
.link-underline a:hover { | |
background: #b4e7f8; | |
} |
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
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
const crypto = require('crypto'); | |
const serverless = require('serverless-http'); | |
const app = express(); | |
const KEY = 'YOUR_KEY'; | |
app.use(bodyParser.raw({ | |
type: '*/*', |
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
export default class Toggle extends Component { | |
static TOGGLE = 'TOGGLE'; | |
state = { on: false } | |
onClick = (e) => { | |
e.preventDefault(); | |
this.internalSetState(state => ({ | |
on: !state.on, |
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
class App extends Component { | |
stateReducer = (prevState, nextState) => { | |
switch (nextState.type) { | |
case Toggle.TOGGLE: { | |
const count = prevState.count || 0; | |
const isOn = count < 4 ? nextState.on : false; | |
return { | |
...prevState, | |
...nextState, |
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
(state, action) => { | |
switch (action.type) { | |
case TOGGLE: { | |
const count = state.count || 0; | |
const isOn = count < 4 ? action.changes.on : false; | |
return { | |
...state, | |
...action.changes, | |
count: isOn ? count + 1 : count, |
NewerOlder