Skip to content

Instantly share code, notes, and snippets.

@deivuh
deivuh / clean.gcode
Created February 7, 2021 21:25
Cleans extruder before printing
G90 ; set to absolute positioning
M82 ; set extruder to absolute mode
G28 ; home all axes
; The lines below are to prep the nozzle before a print begins
G1 Z0.2 F1200 ; raise nozzle 0.2mm
G92 E0 ; reset extrusion distance
G1 Y10 ; move Y-Axis (bed) 10mm to prep for purge
G1 X100 E12 F600 ; move X-carriage 100mm while purging 12mm of filament
G92 E0 ; reset extrusion distance
@deivuh
deivuh / highsierra_bootable.sh
Created September 20, 2020 22:51 — forked from agentsim/highsierra_bootable.sh
Create bootable ISO from HighSierra Installer
# Generate a BaseSystem.dmg with 10.13 Install Packages
hdiutil attach /Applications/Install\ macOS\ 10.13\ Beta.app/Contents/SharedSupport/InstallESD.dmg -noverify -mountpoint /Volumes/highsierra
hdiutil create -o /tmp/HighSierraBase.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/HighSierraBase.cdr.dmg -noverify -mountpoint /Volumes/install_build
asr restore -source /Applications/Install\ macOS\ 10.13\ Beta.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
cp -R /Volumes/highsierra/Packages /Volumes/OS\ X\ Base\ System/System/Installation
hdiutil detach /Volumes/OS\ X\ Base\ System/
hdiutil detach /Volumes/highsierra/
mv /tmp/HighSierraBase.cdr.dmg /tmp/BaseSystem.dmg
@namespace html url(http://www.w3.org/1999/xhtml);
@namespace xul url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/*
Author: Twily
Description: Minimal flat styled tabs for Australis
Compitability: Firefox Nightly v31.0a1 - v32.0a1 (Australis)
CSS Variables were introduced to Firefox in v29.0a1
Website: http://twily.info/
*/
@deivuh
deivuh / mpv.conf
Created May 20, 2017 16:07
mpv configuration for osx.
# vim: syntax=config
#
# mpv configuration file
#
# Configuration files are read system-wide from /usr/local/etc/mpv.conf
# and per-user from ~/.config/mpv/mpv.conf, where per-user settings override
# system-wide settings, all of which are overridden by the command line.
#
# Configuration file settings and the command line options use the same
# underlying mechanisms. Most options can be put into the configuration file
@deivuh
deivuh / whitelist.filter
Last active February 21, 2017 04:29
uBlockr Whitelist
#Microsoft Whitelisting
login.live.com
#Kodi Whitelisting
msftncsi.com
#Spotify Whitelisting
spclient.wg.spotify.com
#Google Server Whitelisting
storage.googleapis.com
clients2.google.com
clients3.google.com
@deivuh
deivuh / install-cask-apps.sh
Last active January 4, 2022 07:17
Brew Cask Script
#!/bin/sh
# brew install emacs
# Better version of emacs (w/ GUI)
#brew tap railwaycat/emacsmacport
#brew install emacs-mac --with-no-title-bars # Switched for Emacs-Plus, better maintained and now supports no-title bar option
brew tap d12frosted/emacs-plus
brew install emacs-plus --with-no-titlebar
### Keybase proof
I hereby claim:
* I am deivuh on github.
* I am deivuh (https://keybase.io/deivuh) on keybase.
* I have a public key whose fingerprint is 44E2 08D8 A6CB 8DD3 CCA6 C17A 2F22 BB13 E4A0 8CC2
To claim this, I am signing this object:

Suppose we want to add support for a new iOS 8 API in our framework that replaces an older iOS 7 API. There are a few problems we might face:

  1. The new API will crash if we call it on iOS 7
  2. The new API won't compile if we build it using the iOS 7 SDK
  3. The old API will raise a deprecation warning if built with a deployment target of iOS 8 and up

These three problems require three different technical solutions:

  1. We can avoid calling the new API on an old OS version by using runtime detection (e.g. respondsToSelector:)
  2. We can avoid compiling new APIs on old SDKs using the __IPHONE_OS_VERSION_MAX_ALLOWED macro
@deivuh
deivuh / osx_install.sh
Last active August 29, 2015 14:07 — forked from t-io/osx_install.sh
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
# install wallpaper cli
sudo gem install desktop
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront