Skip to content

Instantly share code, notes, and snippets.

View gist:94a6c586465d3b60495e470035af0214
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \;
@alexanza
alexanza / gist:70c09d9b283c242b834987f2646f8065
Created Nov 29, 2016 — forked from jagregory/gist:710671
How to move to a fork after cloning
View gist:70c09d9b283c242b834987f2646f8065
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 Sep 26, 2016 — forked from cabeca/simulator_populator
This script removes and recreates all simulators in Xcode 6.
View simulator_populator
#!/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 — forked from mokagio/update_xcode_plugins.sh
Script updating all plugins to be compatible with the latest Xcode and Xcode-beta
View update_xcode_plugins.sh
#!/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 / ExpirationDatePickerDialog.java
Last active Mar 10, 2021
Expiration date picker for credit card (tested on api 19 and up)
View ExpirationDatePickerDialog.java
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 / install_mysql.sh
Created Oct 15, 2015 — 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.
View install_mysql.sh
#! /usr/bin/env bash
# Variables
APPENV=local
DBHOST=localhost
DBNAME=dbname
DBUSER=dbuser
DBPASSWD=test123
echo -e "\n--- Mkay, installing now... ---\n"