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
#include <IRremote.h> | |
/* | |
Send infrared commands from the Arduino to the iRobot Roomba | |
by probono | |
2013-03-17 Initial release | |
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 http.server | |
import cgi | |
import base64 | |
import json | |
from urllib.parse import urlparse, parse_qs | |
class CustomServerHandler(http.server.BaseHTTPRequestHandler): | |
def do_HEAD(self): |
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
## Delete a remote branch | |
$ git push origin --delete <branch> # Git version 1.7.0 or newer | |
$ git push origin :<branch> # Git versions older than 1.7.0 | |
## Delete a local branch | |
$ git branch --delete <branch> | |
$ git branch -d <branch> # Shorter version | |
$ git branch -D <branch> # Force delete un-merged branches | |
## Delete a local remote-tracking branch |
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
// | |
// Adafruit Feather M0 Express ADC data logging | |
// | |
// Based on the Adafruit SdFat_circuitpython example | |
// | |
// The files can be accessed by double pressing the reset button and | |
// copying the circuitpython uf2 file (https://circuitpython.org/board/feather_m0_express/) | |
// into the featherboot drive (must be connected to the computer USB port :P) | |
// If you want to keep your arduino code, save the CURRENT.UF2 file before copying | |
// the circuitpython one from the link above. |
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 storage | |
storage.remount("/", readonly=True) # to enable the code to save data to the flash this needs to be False | |
# After the system is reset with the above line set to False, it will not allow to update | |
# anything using the virtual USB drive. Therefore it's necessary to connect using the serial USB (minicom), | |
# enter the REPL (contr+c to cancel code.py if it's running and any key) and paste the line below: | |
# import os; os.remove("/boot.py"); fs=open("/boot.py", "w"); fs.write("import storage\nstorage.remount(\"/\", readonly=True)"); fs.close() | |
# | |
# Usage |
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
def ransac_polyfit(x, y, order=3, n=20, k=100, t=0.1, d=100, f=0.8): | |
# Thanks https://en.wikipedia.org/wiki/Random_sample_consensus | |
# n – minimum number of data points required to fit the model | |
# k – maximum number of iterations allowed in the algorithm | |
# t – threshold value to determine when a data point fits a model | |
# d – number of close data points required to assert that a model fits well to data | |
# f – fraction of close data points required | |
besterr = np.inf |
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
# from : https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/graph_editor/examples/edit_graph_example.py | |
import numpy as np | |
import tensorflow as tf | |
from tensorflow.contrib import graph_editor as ge | |
# create a graph | |
g = tf.Graph() | |
with g.as_default(): |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.