Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am aavina on github.
  • I am avina (https://keybase.io/avina) on keybase.
  • I have a public key ASAD7eKurcNtsyCBulXwu12hwCk1BC_dQN8skrNG2-27bQo

To claim this, I am signing this object:

@aavina
aavina / cart_diff.sh
Created June 27, 2016 23:12
Carthage Cartfile diff script
function runCarthageAndCopyResolved {
echo "Running Carthage.."
/usr/local/bin/carthage bootstrap "$SRCROOT" --platform iOS
# Copies the Cartfile.resolved file to /Carthage directory
cp "$SRCROOT"/Cartfile.resolved "$SRCROOT"/Carthage/.Cartfile.resolved
echo "Copied Cartfile.resolved to /Carthage directory."
echo "This will be used to check Carthage dependency updates in the future."
}
command -v carthage >/dev/null 2>&1 || {
@aavina
aavina / gist:48fae343b9973c278813
Created October 7, 2014 05:20
C Compound Literals
// Reference: http://nickdesaulniers.github.io/blog/2013/07/25/designated-initialization-with-pointers-in-c/
struct point a;
a.x = 1;
a.y = 2; // C89 (too verbose)
struct point b = { 3, 4 }; // initializer list (struct member order specific)
struct point c = { .x = 5, .y = 6 }; // designated initializer (non struct member order specific)
struct point d = (struct point) { .x = 7, .y = 8 }; // compound literal (cast + designated initialization)