Skip to content

Instantly share code, notes, and snippets.

struct ContentView: View {
@State var currentIndex: Int = 0
var body: some View {
HStack {
TextButtonUnderline(currentIndex: $currentIndex, index: 0, title: "Playlists")
TextButtonUnderline(currentIndex: $currentIndex, index: 1, title: "Artists")
TextButtonUnderline(currentIndex: $currentIndex, index: 2, title: "Albums")
Spacer()
}
}
@Matheus193dn
Matheus193dn / CircularImageView.swift
Created May 13, 2018 08:31 — forked from bishalg/CircularImageView.swift
Circular Image View UIImageView Subclass
// Created by Bishal Ghimire on 5/15/16.
import UIKit
@IBDesignable
class CircularImageView: UIImageView {
override func prepareForInterfaceBuilder() {
super.prepareForInterfaceBuilder()
makeCircularImage()
@Matheus193dn
Matheus193dn / fix-homebrew-npm.md
Created January 4, 2018 13:11 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.

@Matheus193dn
Matheus193dn / gist:2b03370bd3ab3592cab1f56ca6e685a2
Created January 3, 2018 15:55 — forked from tonymtz/gist:d75101d9bdf764c890ef
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*