Skip to content

Instantly share code, notes, and snippets.

;===== machine: A1 mini =========================
;===== date: 20231226 =====================
;===== start to heat heatbead&hotend==========
M1002 gcode_claim_action : 2
M1002 set_filament_type:{filament_type[initial_no_support_extruder]}
M104 S170
M140 S[bed_temperature_initial_layer_single]
G392 S0 ;turn off clog detect
;=====start printer sound ===================
openapi: 3.0.3
info:
title: API
version: '1.0'
components:
schemas:
Attachment:
title: Attachment
type: object
description: Attachments - file management system

Setup SSL

%DOMAIN% - your domain %EMAIL% - email for Let's Encrypt notifications

Create file /etc/nginx/conf.d/https_custom.conf with below content

server {
  listen       443 default ssl;
@borsch
borsch / gist:e4bd508db0886f63b60bbedc4f35b5a0
Created February 19, 2018 20:03
date format parameters
G Era designator Text AD
y Year Year 1996; 96
Y Week year Year 2009; 09
M Month in year Month July; Jul; 07
w Week in year Number 27
W Week in month Number 2
D Day in year Number 189
d Day in month Number 10
F Day of week in month Number 2
E Day name in week Text Tuesday; Tue
http://zlitos.com/publ/ehlektronika/arduino_i_t_p/nodemcu_upravlenie_4_rele_iz_prilozhenija_android_po_wifi/12-1-0-27
@borsch
borsch / jqeury_ajax_wrapper.js
Last active August 21, 2017 16:55
wrapper for jquery ajax. use this to omit evety time adding beforeSend: function(){..}
(function(exports){
exports.get = function(options){
options = options || {};
options.type = 'GET';
_ajax(options);
};
exports.put = function(options){
putAndPost(options, 'PUT');
@borsch
borsch / script.js
Created August 18, 2017 15:05
upload file with data via ajax to server
var payload = new FormData();
payload.append('file', $('#my_file_input')[0].files[0]);
payload.append('some_field', 'foo');
var request = new XMLHttpRequest();
request.open('PUT'|'POST', '/my/api/upload/url');
request.setRequestHeader('Accept', 'application/json');
request.onload = function () {
var response = request.response;
@borsch
borsch / maven_jar_build
Last active July 13, 2017 19:17
java build maven single jar with dependencies
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
http://arduino-diy.com/arduino-oled-displey
oled -> leonardo
GND -> GND
VDD -> 3.3V
SCK -> D3
SDA -> D2
get i2c port
http://playground.arduino.cc/Main/I2cScanner
@borsch
borsch / rect.js
Created May 15, 2017 20:26
create svg rect
var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
rect.setAttribute('x', x)
rect.setAttribute('y', y)
rect.setAttribute('width', width)
rect.setAttribute('height', height)
rect.setAttribute('fill', 'rgb(1, 100, 1)');