Skip to content

Instantly share code, notes, and snippets.

@disgone
disgone / Center on Fence
Last active October 12, 2024 19:29
cncjs macros
; Moves to the basic work location against the fence
; Machine coordinates
; Moves the spindle to the fence @ X center
%SAFE_HEIGHT = -5
%FENCE_X = -419
%FENCE_Y = -724
; Wait until the planner queue is empty
%wait
@disgone
disgone / P12toPEM.txt
Created March 29, 2023 14:12 — forked from shahdhiren/P12toPEM.txt
Convert P12 file for Push Notification to PEM format
Development Phase:
Step 1: Create Certificate .pem from Certificate .p12
Command: openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12
Step 2: Create Key .pem from Key .p12
Command : openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12
Step 3: Optional (If you want to remove pass phrase asked in second step)
Command : openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem
@disgone
disgone / Benchmark.linq
Last active June 14, 2022 22:24
Testing
<Query Kind="Program">
<NuGetReference>BenchmarkDotNet</NuGetReference>
<Namespace>BenchmarkDotNet.Analysers</Namespace>
<Namespace>BenchmarkDotNet.Attributes</Namespace>
<Namespace>BenchmarkDotNet.Characteristics</Namespace>
<Namespace>BenchmarkDotNet.Code</Namespace>
<Namespace>BenchmarkDotNet.Columns</Namespace>
<Namespace>BenchmarkDotNet.Configs</Namespace>
<Namespace>BenchmarkDotNet.ConsoleArguments</Namespace>
<Namespace>BenchmarkDotNet.ConsoleArguments.ListBenchmarks</Namespace>
@disgone
disgone / displaylabb.yaml
Created February 3, 2022 06:55 — forked from tubalainen/displaylabb.yaml
ESPHome with display SSD1306 OLED display
esphome:
name: displaylabb
platform: ESP8266
board: d1_mini
wifi:
ssid: 'meh'
password: 'bbeeeh'
ap:
ssid: "DisplabbFallback Hotspot"
@disgone
disgone / disgone.omp.json
Created September 16, 2021 23:40
Oh My Posh Prompt
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"console_title": true,
"console_title_style": "template",
"console_title_template": "{{if .Root}}(Admin) {{end}}{{.Folder}}",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
@disgone
disgone / JS-LINQ.js
Created January 29, 2020 10:24 — forked from DanDiplo/JS-LINQ.js
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
{ name: "Judy", age: 42 },
{ name: "Tim", age: 8 }
@disgone
disgone / SCSS.md
Created July 13, 2017 16:15 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@disgone
disgone / Encryptor.cs
Last active November 30, 2016 07:38
Dotnet core two way encryption (AES)
using System;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
namespace Crypto.Utilities
{
public class Encryptor
{
public string EncryptToString(string text)
@disgone
disgone / git patterns.md
Created September 10, 2016 04:07 — forked from wayspurrchen/git patterns.md
Useful Git Techniques

History

Show file at certain commit

git show <hash>:<file>

Show history of a file

git log -p <filename>

@disgone
disgone / gist:378da1942fd23cea34a5
Created December 18, 2014 06:50
Unicode test strings.
SOURCE: http://www.cl.cam.ac.uk/~mgk25/ucs/examples/quickbrown.txt
Sentences that contain all letters commonly used in a language
--------------------------------------------------------------
Markus Kuhn <http://www.cl.cam.ac.uk/~mgk25/> -- 2012-04-11
This is an example of a plain-text file encoded in UTF-8.