Skip to content

Instantly share code, notes, and snippets.

@ceving
ceving / Web Component for Copyright Years.md
Last active March 29, 2024 14:44
Web Component for Copyright Years
@kmobs
kmobs / frequencytester.md
Last active March 29, 2024 14:44
Frequency Tester

Frequency Testing

This will allow you to test a specific frequency that you hear when you do your resonance testing in Klipper and potentially track down where extra peaks are coming from. If something is rattling at a specific frequency, you can specify that frequency and feel around the printer until you track it down.

Code was adopted by zifnab from somewhere in Klipper.

Usage

You have to have [resonance_holder] in your printer.cfg.

The command is HOLD_RESONANCE AXIS=<axis> FREQ=int SECONDS=<seconds>

@graninas
graninas / haskell_design_showcase_projects.md
Last active March 29, 2024 14:43
Software Design Showcase Projects in Haskell

Software Design Showcase Projects in Haskell

(WIP)

  • Automatic White-Box Testing with Free Monads | Alexander Granin
    • Description: Article and showcase project about an approach to whitebox testing. Describes the idea of recordable and replayable business scenarios based on the Free Monad approach.
    • Design Approach: [Free Monads]
    • Technologies: [free, aeson]
    • Teaches for: How to make a Free monad based business logic recordable and replayable. How to use the recordings for automatic whitebox testing. How to configure this system to do integration testing.
@alexpchin
alexpchin / Setting_upa_new_repo.md
Last active March 29, 2024 14:42
Create a new repository on the command line

Setting up a new Git Repo

##Create a new repository on the command line

touch README.md
git init
git add README.md
git commit -m "first commit"

git remote add origin git@github.com:alexpchin/.git

@unixzii
unixzii / trapping_rain_water_tmp.cc
Last active March 29, 2024 14:38
A "Trapping Rain Water" implementation using C++ template metaprogramming.
template <int, typename>
struct List;
struct Nil {
template <int _NValue>
using Append = List<_NValue, Nil>;
};
template <int _Value, typename _Next>
struct List {
@Yegorov
Yegorov / ya.py
Created January 13, 2018 16:08
Download file from Yandex.Disk through share link
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# https://toster.ru/q/72866
# How to
# wget http://gist.github.com/...
# chmod +x ya.py
# ./ya.py download_url path/to/directory
import os, sys, json
@rene-d
rene-d / colors.py
Last active March 29, 2024 14:34
ANSI color codes in Python
# SGR color constants
# rene-d 2018
class Colors:
""" ANSI color codes """
BLACK = "\033[0;30m"
RED = "\033[0;31m"
GREEN = "\033[0;32m"
BROWN = "\033[0;33m"
BLUE = "\033[0;34m"
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active March 29, 2024 14:32
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@ravijo
ravijo / pdf2jpg_recursive.sh
Last active March 29, 2024 14:32
This shell script converts all PDF files to JPG files
#!/bin/bash
# author: ravi joshi
# date: 19 mar 2020
# this shell script converts all PDF files to JPG files
# it walks recursively inside the given directory
# requirement: it uses ImageMagick command line tool for PDF to JPG convertion.
# check here (https://github.com/ravijo/image-video-editing#install-imagemagick-on-ubuntu-1404)
# for more information
if [ $# -eq 0 ]; then
@gustavohenrique
gustavohenrique / telnet-imap
Created June 6, 2013 14:00
playing with gmail via telnet
openssl s_client -crlf -connect imap.gmail.com:993
tag login user@gmail.com passwordhere
tag list "" "*"
tag select "inbox"
tag fetch 1:3 body[header]
tag fetch 3 body[header]
tag fetch 3 body[text]
tag fetch 2 all
tag fetch 2 fast
tag fetch 2 full