Skip to content

Instantly share code, notes, and snippets.

@olpoco
olpoco / scroll=false.md
Last active March 23, 2016 18:49
css fixed position within ion-content

omg, so fixed position doesn't work in ion-content, which uses zynda scroller... see here

"The ion-scroller is based on the zynga scroller, which really just movies content inside the scroller. Technically, it's not scrolling, but just moving the content inside. "

the workaround is set and then set {'scroll:overflow; height:95%'} to the content you want to scroll inside of it

@olpoco
olpoco / bind.md
Last active March 14, 2016 01:31
js partial function with bind

Awesome trick seen on mongoose doc:

db.on('error', console.error.bind(console, 'connection error:'));

The bind() method creates a new function that, when called, has its this keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called.

so the above is equivalent to console.log with first argument set to 'connection error:', so when errors it prints something like

connection error: { [MongoError: getaddrinfo EIO] name: 'MongoError', message: 'getaddrinfo EIO' }
@olpoco
olpoco / fedora.md
Last active March 3, 2018 10:24
Installing Fedora 23 on Macbook Pro Retina 2016, and attaching Airport Extreme

Installing Fedora on Macbook Pro retina

  1. Download Fedora 23 iso, create a usb bootable media Follow instructions here Basically,
  2. use diskutil list to figure out which drive is the usb, on macbook pro with 1 hardrive, the usb is /dev/disk2
  3. umount the disk using diskutil unmountDisk /dev/disk2 or use Mac's Disk Utility (just umount, don't eject, umount removes it from directory structure and eject disconncet it altogether)
  4. use dd(a low level cp) to write iso content into the usb drive, sudo dd if=~/Downloads/Fedora-Live-Desktop-x86_64-20-1.iso of=/dev/disk2 bs=1m, this will take a bit of time, make sure you wait until it's done, additionally compare the size or checksum to make sure all has been copied (not that necessary since if it weren't copied, it'll err at boot time)
  5. use Disk Utility to shrink Mac's harddrive