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 w = canvas.width; | |
var h = canvas.height; | |
var body = 30; | |
var x0=0,y0=0,x1=0,y1=body; | |
var angle = 0; | |
var cx = 300,cy = 300; | |
var pp0 = []; | |
var pp1 = []; | |
var total = 100; | |
setInterval(()=>{ |
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 canvas = document.getElementById("canvas"); | |
var ctx = canvas.getContext("2d"); | |
ctx.strokeStyle = "#000"; | |
ctx.strokeWidth = 1; | |
var cx = 400, | |
cy = 400, | |
r = 200.0; | |
function scale(cosλcosφ) { | |
return 1 / (1 + cosλcosφ); | |
} |
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
[profile] | |
layer_height = 0.2 | |
wall_thickness = 0.8 | |
retraction_enable = True | |
solid_layer_thickness = 0.6 | |
fill_density = 40 | |
print_speed = 45 | |
print_temperature = 218 | |
print_temperature2 = 0 | |
print_temperature3 = 0 |
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 {execFile} = require('child_process'); | |
const gifsicle = require('gifsicle'); | |
execFile(gifsicle, ['--resize-fit-width', '200','-o', 'output.gif', 'input.gif'], err => { | |
console.log('Image minified!'); | |
}); |
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 "MeMegaPi.h" | |
#include <SoftwareSerial.h> | |
Me7SegmentDisplay disp(PORT_8); | |
MeInfraredReceiver infraredReceiverDecode(PORT_7); | |
MeStepperOnBoard stepper(SLOT_1); | |
int i = 0; | |
void setup() | |
{ | |
infraredReceiverDecode.begin(); |
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
###USAGE### | |
# pip3 install makeblock --upgrade | |
########### | |
from time import sleep | |
from makeblock import MegaPi,SerialPort | |
megapi = MegaPi.connect() # or megapi = MegaPi.connect(SerialPort.connect("/dev/ttyXXXX")) | |
A6 = 60 | |
A7 = 61 | |
A8 = 62 | |
A9 = 63 |
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
###USAGE### | |
# pip3 install makeblock | |
########### | |
from time import sleep | |
from makeblock import MegaPi,SerialPort | |
megapi = MegaPi.connect() # or megapi = MegaPi.connect(SerialPort.connect("/dev/ttyXXXX")) | |
motor1 = megapi.DCMotor(1,1) | |
motor2 = megapi.DCMotor(1,2) | |
motor3 = megapi.DCMotor(2,1) | |
motor4 = megapi.DCMotor(2,2) |
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 webview | |
webview.create_window('Stellarium-Web', 'https://stellarium-web.org/') | |
webview.start() |
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 fs = require("fs") | |
let buf = fs.readFileSync("file.bin"); | |
let arr = []; | |
for(let i=0;i<buf.length;i++) | |
{ | |
arr.push('0x'+buf[i].toString(16)); | |
} | |
fs.writeFileSync("file.txt","["+arr.join(",")+"]") |
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
###USAGE### | |
# pip3 install makeblock --upgrade | |
########### | |
from time import sleep | |
from random import random | |
import math | |
from makeblock import MegaPi,SerialPort | |
A6 = 60 | |
A7 = 61 | |
A8 = 62 |
OlderNewer