Skip to content

Instantly share code, notes, and snippets.

@aganov
aganov / marlin.patch
Last active January 4, 2024 13:02
Ender 3 Marlin Config (SKR 1.3, CR-Touch)
diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index 9acdc107ca..2a53d61ff9 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -61,14 +61,14 @@
// @section info
// Author info of this build printed to the host during boot and M115
-#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
+#define STRING_CONFIG_H_AUTHOR "(Alex)" // Who made the changes.
@adripo
adripo / change_filament_without_ams.gcode
Last active April 19, 2024 11:32
G-code to manually change filament without AMS. See https://github.com/bambulab/BambuStudio/issues/278
;===== Change filament G-code without AMS ===
;===== version: 1.2 =========================
;===== original version date: 20230719 ======
;===== description ==========================
; Everything between M620 and M621 is executed only if AMS is connected.
; All M620, M620.x and M621 commands are removed to enable manual filament change.
; first filament change is skipped
{if toolchange_count > 1}
@yefim
yefim / Dockerrun.aws.json
Last active April 7, 2023 16:11
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "443"
}
@zvlex
zvlex / app.js
Last active December 30, 2023 07:09
Vue Comments Example
// CommentBox component
Vue.component('comment-box', {
template: '#comment-box',
props: ['comments'],
events: {
'signal:addComment': function(comment) {
this.comments.push(comment);
}
@whatnick
whatnick / Energy_Monitor_Real.ino
Last active October 1, 2022 20:10
ESP8266 Energy Monitor Real Power
/*
* This sketch sends ads1115 current sensor data via HTTP POST request to thingspeak server.
* It needs the following libraries to work (besides the esp8266 standard libraries supplied with the IDE):
*
* - https://github.com/adafruit/Adafruit_ADS1X15
*
* designed to run directly on esp8266-01 module, to where it can be uploaded using this marvelous piece of software:
*
* https://github.com/esp8266/Arduino
*
@dermotmcguire
dermotmcguire / A4 CSS page template.markdown
Created September 14, 2015 08:48
A4 CSS page template
@whatnick
whatnick / Energy_Monitor.ino
Created September 3, 2015 13:08
ESP8266 Energy Monitor
/*
* This sketch sends ads1115 current sensor data via HTTP POST request to thingspeak server.
* It needs the following libraries to work (besides the esp8266 standard libraries supplied with the IDE):
*
* - https://github.com/adafruit/Adafruit_ADS1X15
*
* designed to run directly on esp8266-01 module, to where it can be uploaded using this marvelous piece of software:
*
* https://github.com/esp8266/Arduino
*
@danielgtaylor
danielgtaylor / gist:0b60c2ed1f069f118562
Last active April 2, 2024 20:18
Moving to ES6 from CoffeeScript

Moving to ES6 from CoffeeScript

I fell in love with CoffeeScript a couple of years ago. Javascript has always seemed something of an interesting curiosity to me and I was happy to see the meteoric rise of Node.js, but coming from a background of Python I really preferred a cleaner syntax.

In any fast moving community it is inevitable that things will change, and so today we see a big shift toward ES6, the new version of Javascript. It incorporates a handful of the nicer features from CoffeeScript and is usable today through tools like Babel. Here are some of my thoughts and issues on moving away from CoffeeScript in favor of ES6.

While reading I suggest keeping open a tab to Babel's learning ES6 page. The examples there are great.

Punctuation

Holy punctuation, Batman! Say goodbye to your whitespace and hello to parenthesis, curly braces, and semicolons again. Even with the advanced ES6 syntax you'll find yourself writing a lot more punctuatio

@marcboeren
marcboeren / 1.postToIp.swift
Created March 19, 2015 22:43
Use Alamofire & SwiftyJSON to POST to a JSON API, retry every second unless cancelled or successful
import Alamofire
class Something {
var postCancelled: Bool = false
func postToIp(ip: String) {
let parameters = [
"a": "value 1",
@Jogan
Jogan / FloatingActionButton.java
Last active December 4, 2023 12:48
Implementation of Android L's floating action button pattern. API 14+
package your_package;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;