Skip to content

Instantly share code, notes, and snippets.

View matteocrippa's full-sized avatar

Matteo Crippa matteocrippa

View GitHub Profile
@matteocrippa
matteocrippa / mac-setup.sh
Last active December 17, 2025 10:17
A script to automate the setup of a development oriented Macbook machine
#!/usr/bin/env bash
# Brew
echo "Installing 🍺 Brew!"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo "eval $(/opt/homebrew/bin/brew shellenv)" >> ~/.zshrc
# Disable brew analytics
brew analytics off
@matteocrippa
matteocrippa / server.py
Last active January 27, 2023 09:37
A simple local http sever from a Mac
# Python
python -m SimpleHTTPServer 8080
# Python 3.x
python3 -m http.server --cgi 8080
@matteocrippa
matteocrippa / keybase.md
Created January 29, 2017 15:39
keybase.md

Keybase proof

I hereby claim:

  • I am matteocrippa on github.
  • I am matteocrippa (https://keybase.io/matteocrippa) on keybase.
  • I have a public key whose fingerprint is 4F14 8EAB 6806 F7F7 F695 C95B F056 A606 8F1B 38FA

To claim this, I am signing this object:

@matteocrippa
matteocrippa / uistackview-extended.swift
Last active May 12, 2017 13:54
UIStackView add backgroundColor
// fix issue UIStackView that background doesn't work
private var bkgColor: UIColor?
override public var backgroundColor: UIColor? {
get { return bkgColor }
set {
bkgColor = newValue
setNeedsLayout()
}
}
import UIKit
var aString: String?
print(aString)
@matteocrippa
matteocrippa / kitura_helloworld.swift
Created December 31, 2016 20:31
Kitura Hello World
import Kitura
// Create a new router
let router = Router()
// Handle HTTP GET requests to /
router.get("/") {
request, response, next in
response.send("Hello, World!")
next()
@matteocrippa
matteocrippa / hide_back_title.swift
Created December 17, 2016 08:29
Hide back title from UINavigation
let barAppearace = UIBarButtonItem.appearance()
barAppearace.setBackButtonTitlePositionAdjustment(UIOffsetMake(0, -60), for: .default)
@matteocrippa
matteocrippa / docker.md
Last active December 6, 2016 16:51
docker compose faq
docker-compose up # start with cli support
docker-compose up -d # start as daemon, if reboot it will stay up
docker-compose start # start 
docker-compose build # rebuild dockers
docker-compose pull # pull new images
docker-compose stop # stop dockers
@matteocrippa
matteocrippa / MacProWindows.md
Last active August 19, 2016 08:27
Mac Pro 5.1 install Windows 10 & macOS

Install Windows & macOS

Create bootable USB for Windows If not working, open Info.plist file, then edit PreUSBBootSupportedModels with USBBootSupportedModels

Create 2 partition in your SSD both for OS X

In Windows delete all partition except for EFI, create a new partition 40GB for windows Install Windows

#Fish Shell

Delete all containers

docker rm (docker ps -a -q)

Delete all images

docker rmi (docker images -q)

Normal shell

Delete all containers