Skip to content

Instantly share code, notes, and snippets.

View btastic's full-sized avatar

Ben Konsemüller btastic

View GitHub Profile
/* Magic Mirror
* Module: MMM-GoogleCalendar
*
* adaptation of MM default calendar module for Google Calendar events
* MIT Licensed.
*/
Module.register("MMM-GoogleCalendar", {
// Define module defaults
defaults: {
maximumEntries: 10, // Total Maximum Entries
@btastic
btastic / gist:4bd8e78a107d8733f802168398a506a3
Created September 30, 2022 09:44
DutchDudes Automatic Bed Selection (fixed)
[gcode_macro _LOAD_MESH_TEMP]
gcode:
{% set BED_TEMP = params.BED_TEMP|default(0)|int %}
{% set FORCE = params.FORCE|default(0)|int %}
{% set SAVE = params.SAVE|default(0)|int %}
{action_respond_info("- AUTOMATED BED MESH GENERATOR -")}
{% if BED_TEMP|int < 30 %}
{action_respond_info("Your bed temp is to low, make sure it is at least 30 or higher")}
{% else %}
const std::string moveCodes[18] = {
"R",
"L",
"B",
"F",
"U",
"D",
"R2",
"L2",
"B2",
@btastic
btastic / VideoExtensions.cs
Created July 6, 2020 21:49
Get chapters from youtube explode
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text.Json;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using AngleSharp.Dom;
using AngleSharp.Html.Dom;
using YoutubeExplode;
// reference commercetools.NET.SDK via nuget
using System;
using System.Threading.Tasks;
using commercetools.Categories;
using commercetools.Common;
using commercetools.ProductProjections;
using commercetools.ProductProjectionSearch;
using commercetools.Products;
using commercetools.Products.UpdateActions;
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'package:flutter_native_image/flutter_native_image.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@btastic
btastic / main.dart
Created May 15, 2019 20:24
Repro flutter_native_image repro 47
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'package:flutter_native_image/flutter_native_image.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@btastic
btastic / New-DotNet.ps1
Last active October 11, 2018 22:19
A simple script to generate a new dotnet project with a default project hierarchy
param(
[Parameter(Mandatory = $true)]
[string]$ProjectName,
[Parameter(Mandatory = $true)]
[string]$SolutionName,
[Parameter(Mandatory = $true)]
[string]$DotNetTemplateName
)
$ErrorActionPreference = "Stop"
@btastic
btastic / Pagination.cs
Last active October 17, 2023 11:44
Pagination with dots in C#
public class Pagination
{
public int PageIndex { get; private set; }
public int TotalPages { get; private set; }
public List<object> RangeWithDots { get; private set; } = new List<object>();
public bool HasPreviousPage
{
get
{
@btastic
btastic / remove-docker-containers.md
Created July 3, 2018 08:00 — forked from ngpestelos/remove-docker-containers.md
How to remove unused Docker containers and images

May 8, 2018

I wrote this four years ago, so instead use this command:

$ docker rmi $(docker images -q -f dangling=true)