Skip to content

Instantly share code, notes, and snippets.

@pestbarn
pestbarn / Permanently disable startup chime on macOS.md
Last active January 3, 2019 09:42
Permanently disable startup chime on macOS

How to do it

Complete the following steps (with sudo permissions):

  1. Add sound-off.sh and sound-on.sh to /Library/Scripts/
  2. Run the following commands:
sudo chmod u+x /Library/Scripts/sound-off.sh /Library/Scripts/sound-on.sh
sudo defaults write com.apple.loginwindow LogoutHook /Library/Scripts/sound-off.sh
sudo defaults write com.apple.loginwindow LoginHook /Library/Scripts/sound-on.sh
@pestbarn
pestbarn / IE11-grid-with-autoprefixer.md
Last active January 23, 2019 18:56
CSS Grid for IE11 using Autoprefixer

About: CSS Grid for IE11

CSS Grid in IE11 is an implementation based on the 2011 spec, which means we aren't really able to use grids out of the box according to the newer spec. However, Autoprefixer automates a lot of work for us with getting the correct IE11 properties, and it has support for most (if not all?) -ms-grid properties.

There are still some gotchas which Autoprefixer can't help with though:

  • There is no auto-placement behaviour in the 2011 spec. This means that for IE11, you have to position everything. rather than use the autoplacement ability of grid.
  • Using minmax() with an auto value is not supported, and will break things - e.g. minmax(auto, 1200px) will not work. To use minmax, you have to specify two positive values - e.g. minmax(500px, 1200px).
  • grid-gap properties were added in a later spec. To create grid-gaps in IE11, you will need to create separate
@pestbarn
pestbarn / menu-to-cross.css
Last active January 4, 2019 10:36
Menu to cross (pseudo elements and CSS transforms)
ul#hitbox {
list-style: none;
padding: 20px 10px; // padding to make a hitbox
height: 20px;
width: 20px;
cursor: pointer;
}
li#cross {
background: #e04681;