Skip to content

Instantly share code, notes, and snippets.

Avatar

Frank Meus fmeus

View GitHub Profile
@jrlucier
jrlucier / creality_cr20pro.def.json
Last active Apr 30, 2020
CR-20 PRO Cura Definition (just put this in your definitions folder to add the printer to the app: ~/.local/share/cura/3.6/definitions)
View creality_cr20pro.def.json
{
"name": "Creality CR20 Pro",
"version": 2,
"inherits": "fdmprinter",
"metadata": {
"visible": true,
"author": "Michael Wildermuth",
"manufacturer": "Creality3D",
"file_formats": "text/x-gcode",
"preferred_quality_type": "draft",
@mahmudahsan
mahmudahsan / ios_detect.h
Created Sep 26, 2017
iPhone X and other iOS device detection by Swift and Objective-C
View ios_detect.h
#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define IS_RETINA ([[UIScreen mainScreen] scale] >= 2.0)
#define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
#define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)
#define SCREEN_MAX_LENGTH (MAX(SCREEN_WIDTH, SCREEN_HEIGHT))
#define SCREEN_MIN_LENGTH (MIN(SCREEN_WIDTH, SCREEN_HEIGHT))
@adoyle
adoyle / raspi-init.sh
Last active Oct 30, 2020
Non-interactive command-line equivalents to raspi-config
View raspi-init.sh
# Non-interactive command-line equivalents to raspi-config
# These are not guaranteed to work under all circumstances.
# I use them in a fabric script to do unattended setup of a
# Raspberry Pi immediately after having booted up a NOOBS
# and installed Raspbian.
#
# 1. Install NOOBS
# 2. When the config screen comes up, hit TAB TAB RETURN to exit from it
# 3. Type 'sudo service ssh start' at the command line (no quotes).
# 4. (Optional) copy a public key to the pi account on the pi.
@bignerdranch
bignerdranch / BNRTimeBlock.h
Created Mar 9, 2012
Timing Utility Post 20120308
View BNRTimeBlock.h
CGFloat BNRTimeBlock (void (^block)(void));