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, { Component } from 'react'; | |
export default function withPropsChecker(WrappedComponent) { | |
return class PropsChecker extends Component { | |
componentWillReceiveProps(nextProps) { | |
Object.keys(nextProps) | |
.filter(key => { | |
return nextProps[key] !== this.props[key]; | |
}) | |
.map(key => { |
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 const copyToClipboard = (url: string) => { | |
document.addEventListener('copy', (e: ClipboardEvent) => { | |
e.clipboardData.setData('text/plain', url); | |
e.preventDefault(); | |
document.removeEventListener('copy'); | |
}); | |
document.execCommand('copy'); | |
}; |
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
# -*- coding: utf-8 -*- | |
import os | |
import numpy as np | |
import subprocess as sp | |
import re | |
def polar(afile, re, *args,**kwargs): | |
"""calculate airfoil polar and load results |
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
/* | |
sketch : sniffer_433_RX (sister of "sniffer_433_TX") | |
Author : Peter Matthews (CurlyWurly) May 2017 | |
Desc : When a static 433 transmission is received, a "int codez[]=.." line is output to the serial bus. | |
Copy this line and paste it into the the sister sketch "sniffer_433_TX" | |
INFORMATION | |
N.B. Connect pin 2 (rxpin) to the RX module output | |
N.B. Copy the output "int codez[] = ...." from serial bus and copy into the sister sketch "Sniffer_433_TX" | |
N.B. This sniffer sketch just outputs a set value of 35 in code[0]. This means that you may have to | |
experiment using a different "repeat" value (usually a value of 15 - 45) when used in the "TX" sketch |
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
from geventwebsocket.handler import WebSocketHandler | |
from gevent.pywsgi import WSGIServer | |
from flask import Flask, request, render_template_string | |
from flask_sockets import Sockets | |
import json | |
app = Flask(__name__) | |
sockets = Sockets(app) | |
template = """ |