Skip to content

Instantly share code, notes, and snippets.

View alexanza's full-sized avatar

Alex alexanza

  • Belgium
View GitHub Profile
@alexanza
alexanza / HOWTO.md
Created October 2, 2021 05:38 — forked from ivanvermeyen/HOWTO.md
Multiple MySQL versions on MacOS with Homebrew

Update - 4 september 2020

Making multiple MySQL versions work with Homebrew was tricky to say the least. Fortunately there are 2 new easy ways that I learned of to achieve this.

DBngin app

As @4unkur and @henrytirla commented below, there is this extremely easy to use app called DBngin, which lets you setup multiple databases (not only MySQL) simultaneously using different ports:

https://dbngin.com/

@alexanza
alexanza / ExpirationDatePickerDialog.java
Last active March 10, 2021 08:11
Expiration date picker for credit card (tested on api 19 and up)
public class ExpirationDatePickerDialog extends DatePickerDialog implements DatePicker.OnDateChangedListener {
public ExpirationDatePickerDialog(Context context, OnDateSetListener callBack, int year, int monthOfYear, int dayOfMonth) {
super(
context,
Build.VERSION.SDK_INT >= 21 ? R.style.MyDialogTheme : 0,
callBack,
year,
monthOfYear,
dayOfMonth
@alexanza
alexanza / gist:94a6c586465d3b60495e470035af0214
Created November 30, 2016 08:40 — forked from fabiofl/gist:5873100
Clear Mac OS X's icon cache.
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \;
@alexanza
alexanza / gist:70c09d9b283c242b834987f2646f8065
Created November 29, 2016 21:08 — forked from jagregory/gist:710671
How to move to a fork after cloning
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork git@github...my-fork.git
@alexanza
alexanza / simulator_populator
Created September 26, 2016 11:43 — forked from cabeca/simulator_populator
This script removes and recreates all simulators in Xcode 6.
#!/usr/bin/env ruby
device_types_output = `xcrun simctl list devicetypes`
device_types = device_types_output.scan /(.*) \((.*)\)/
runtimes_output = `xcrun simctl list runtimes`
runtimes = runtimes_output.scan /(.*) \(.*\) \((com.apple[^)]+)\)$/
devices_output = `xcrun simctl list devices`
devices = devices_output.scan /\s\s\s\s(.*) \(([^)]+)\) (.*)/
@alexanza
alexanza / update_xcode_plugins.sh
Created May 12, 2016 13:30 — forked from mokagio/update_xcode_plugins.sh
Script updating all plugins to be compatible with the latest Xcode and Xcode-beta
#!/bin/bash
#
# Updates all plug-ins to be compatible with the latest Xcode and Xcode-beta
#
plugins_location="~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins"
# Get Xcode's version
current_xcode_version="$(defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID)"
@alexanza
alexanza / install_mysql.sh
Created October 15, 2015 11:55 — forked from rrosiek/install_mysql.sh
Vagrant provision script for php, Apache, MySQL, phpMyAdmin, Laravel, and javascript helpers. Outputs nearly everything to /dev/null since "quiet" on most commands is still noisy.
#! /usr/bin/env bash
# Variables
APPENV=local
DBHOST=localhost
DBNAME=dbname
DBUSER=dbuser
DBPASSWD=test123
echo -e "\n--- Mkay, installing now... ---\n"