Skip to content

Instantly share code, notes, and snippets.

View maciekish's full-sized avatar
💭
Flying airplanes

Maciej Swic maciekish

💭
Flying airplanes
View GitHub Profile
@maciekish
maciekish / UIApplication+NetworkActivity.h
Last active November 27, 2021 06:58
UIApplication+NetworkActivity keeps track of how many network operations you currently have and manages the NetworkActivityIndicator for you.
//
// UIApplication+NetworkActivity.h
//
// Created by Maciej Swic on 2013-04-29.
// Released under the MIT license.
//
#import <UIKit/UIKit.h>
@interface UIApplication (NetworkActivity)
@maciekish
maciekish / UINavigationBar+CustomHeight.h
Created September 10, 2014 08:48
Custom UINavigationBar height working in iOS 7 and 8. To use, find your navigation bar reference and just setHeight:200 etc.
//
// UINavigationBar+CustomHeight.h
//
// Copyright (c) 2014 Maciej Swic
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@maciekish
maciekish / Cura Nozzle Switch
Last active July 19, 2022 11:35
T-Rex 3.0 Settings for Simplify3D and Cura
;TOOL 0 START
M109 S{material_print_temperature} T0; Set active extruder to T0 Temperature and wait for it to reach temperature before proceeding.
G1 E10 F500 ; Prime 10mm,
G92 E0 ; Reset Extruder to 0,
G1 E-0.5 F500 ; Retract 3.5mm,
; Wipe nozzle
G1 X0 F5000
G1 X-40
G1 X0
G1 X-40
@maciekish
maciekish / bigpicture.ahk
Last active September 24, 2022 14:07
AutoHotkey Scripts
#SingleInstance, Force
#NoTrayIcon
;-----------------------------ABOUT-------------------------------
; This script switches audio devices and launches Big Picture Mode
;-----------------------------HOW TO------------------------------
;- 1) Download NirCmd and run as admin to install to Win dir. -
;- http://nircmd.nirsoft.net/setdefaultsounddevice.html -
;- 2) Change Device names below to match your playback devices. -
;- 3) Change Steam path below to match where Steam is installed. -
;-----------------------------------------------------------------
@maciekish
maciekish / wifi-password-share.sh
Last active January 10, 2023 08:47
Wifi Password Share for macOS
#!/bin/bash
ssid=$(/Sy*/L*/Priv*/Apple8*/V*/C*/R*/airport -I | awk -F' SSID: ' '/ SSID: / {print $2}')
password=$(security find-generic-password -wga "$ssid")
qrencode "WIFI:S:$ssid;T:WPA;P:$password;;" -t ansiutf8
@maciekish
maciekish / karabiner.json
Created February 27, 2023 14:58
Karabiner-Elements: Keyboard Remapping for Japanese keyboard on macOS
{
"global": {
"ask_for_confirmation_before_quitting": true,
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false,
"unsafe_ui": false
},
"profiles": [
{
@maciekish
maciekish / Anet+A6_settings.inst.cfg
Last active August 1, 2023 14:08
Anet A6 profile for Cura 3.5. Start Cura once, create a custom printer called "Anet A6" without changing any of the settings and close Cura. Save and overwrite both files in "AppData\Roaming\cura\3.1\definition_changes" and start Cura again.
[general]
version = 4
name = Anet A6_settings
definition = custom
[metadata]
setting_version = 5
type = definition_changes
[values]
@maciekish
maciekish / folder_stats.sh
Created September 4, 2023 19:50
unRAID Folder Stats
#!/bin/bash
# Function to convert bytes to human-readable format
to_human_readable() {
local size=$1
if [ $size -lt 1024 ]; then
echo "${size}B"
elif [ $size -lt $((1024*1024)) ]; then
echo "$((size/1024))KB"
elif [ $size -lt $((1024*1024*1024)) ]; then
@maciekish
maciekish / resetXcode.sh
Created August 10, 2016 10:13
Reset Xcode. Clean, clear module cache, Derived Data and Xcode Caches. You can thank me later.
#!/bin/bash
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Caches/com.apple.dt.Xcode/*
open /Applications/Xcode.app