Skip to content

Instantly share code, notes, and snippets.

@mazefest
mazefest / ActivityRingView.swift
Created January 21, 2024 04:49
Activity Rings
struct ActivityRingView: View {
@Binding var progress: CGFloat
var mainColor: Color = .red
var lineWidth: CGFloat = 20
var endColor: Color {
mainColor.darker(by: 15.0)
}
@vmartins
vmartins / mame-roms1.md
Created September 27, 2022 17:49
MAME download all roms arcade (1/2)
@vmartins
vmartins / mame-roms2.md
Last active June 5, 2025 00:15
MAME download all roms arcade (2/2)
@frankfka
frankfka / iOSActivityRingSwiftUI.swift
Created April 29, 2020 05:22
iOS Activity Ring in SwiftUI
import SwiftUI
import PlaygroundSupport
extension Double {
func toRadians() -> Double {
return self * Double.pi / 180
}
func toCGFloat() -> CGFloat {
return CGFloat(self)
@tkafka
tkafka / install_git_lfs.sh
Last active May 31, 2019 17:02 — forked from show0k/install_git_lfs.sh
Compile and Install git-lfs on Raspberry Pi (with golang compilation)
install_git_lfs()
{
set -e
# Get out if git-lfs is already installed
if $(git-lfs &> /dev/null); then
echo "git-lfs is already installed"
return
fi
GIT_LFS_BUILD=$HOME/.bin
@metacollin
metacollin / Polycarbonate.ini
Last active March 2, 2025 11:30
Slic3r settings for high quality, low-warp, high-strength printing of polycarbonate without an enclosure on a Prusa i3 MK2S
# generated by Slic3r 1.37.2-prusa3d on Thu Dec 7 09:48:20 2017
# Figured out by trial and error engineer metacollin
# Released as public domain.
# USE GLUESTICK FOR PRINT BED ADHESION
avoid_crossing_perimeters = 0
bed_shape = 0x0,250x0,250x210,0x210
bed_temperature = 110
before_layer_gcode = ;BEFORE_LAYER_CHANGE\n;[layer_z]\n\n
bottom_solid_layers = 8
bridge_acceleration = 1000
@AnalogJ
AnalogJ / download_opds.py
Created August 29, 2017 01:54
download all books in OPDS catalog.
import urllib2
import os
import urllib, urlparse
import xml.etree.cElementTree as et
e = et.ElementTree(file=urllib2.urlopen('https://standardebooks.org/opds/all')).getroot()
print(e)
print("parsing")
for atype in e.iter('{http://www.w3.org/2005/Atom}link'):
@cemolcay
cemolcay / NSBezierPath port
Created February 1, 2017 10:48
UIBezierPath methods missing on NSBezierPath for swift 3
public struct NSRectCorner: OptionSet {
public let rawValue: UInt
public static let none = NSRectCorner(rawValue: 0)
public static let topLeft = NSRectCorner(rawValue: 1 << 0)
public static let topRight = NSRectCorner(rawValue: 1 << 1)
public static let bottomLeft = NSRectCorner(rawValue: 1 << 2)
public static let bottomRight = NSRectCorner(rawValue: 1 << 3)
public static var all: NSRectCorner {
return [.topLeft, .topRight, .bottomLeft, .bottomRight]
@ArseniyShestakov
ArseniyShestakov / add.sh
Last active August 25, 2023 14:14
My compiler alternatives
# Cleanup old alternatives
update-alternatives --remove-all cc
update-alternatives --remove-all c++
update-alternatives --remove-all gcc
update-alternatives --remove-all g++
update-alternatives --remove-all clang
update-alternatives --remove-all clang++
update-alternatives --remove-all icc
update-alternatives --remove-all icc++
@vicrucann
vicrucann / CMakeLists.txt
Created June 14, 2016 18:08
OpenSceneGraph + QOpenGLWidget - minimal example
cmake_minimum_required(VERSION 2.8.11)
project(qtosg)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
find_package(Qt5 REQUIRED COMPONENTS Core Gui OpenGL)
find_package(OpenSceneGraph REQUIRED COMPONENTS osgDB osgGA osgUtil osgViewer)
include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS})