Skip to content

Instantly share code, notes, and snippets.

View Lhadalo's full-sized avatar

Ola Dahl Lhadalo

  • Smart Refill AB
  • Helsingborg, Sweden
View GitHub Profile
@Lhadalo
Lhadalo / macos-bootstrap-android.sh
Last active August 19, 2019 11:10
Script for setting up macOS as an Android developer
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - Twitter (app store)
@Lhadalo
Lhadalo / bad_input.cpp
Created October 26, 2017 16:31
Prevent the user to input values of incorrect type
int nbr_elements;
std::cin >> nbr_elements;
while (std::cin.fail())
{
std::cin.clear();
std::cin.ignore(1000, '\n');
std::cout << "Bad input. Enter a number: "
std::cin >> nbr_elements;
}