Skip to content

Instantly share code, notes, and snippets.

@JakeWharton
JakeWharton / AspectRatioImageView.java
Created June 2, 2012 02:14
ImageView that respects an aspect ratio applied to a specific measurement.
// Copyright 2012 Square, Inc.
package com.squareup.widgets;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.widget.ImageView;
/** Maintains an aspect ratio based on either width or height. Disabled by default. */
public class AspectRatioImageView extends ImageView {
@mattt
mattt / uiappearance-selector.md
Last active March 19, 2024 12:52
A list of methods and properties conforming to `UIAppearance` as of iOS 12 Beta 3

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
 sed 's/UI_APPEARANCE_SELECTOR//g' | \
ACTION
AD_HOC_CODE_SIGNING_ALLOWED
ALTERNATE_GROUP
ALTERNATE_MODE
ALTERNATE_OWNER
ALWAYS_SEARCH_USER_PATHS
ALWAYS_USE_SEPARATE_HEADERMAPS
APPLE_INTERNAL_DEVELOPER_DIR
APPLE_INTERNAL_DIR
APPLE_INTERNAL_DOCUMENTATION_DIR
@rxaviers
rxaviers / gist:7360908
Last active May 5, 2024 12:57
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@SlaunchaMan
SlaunchaMan / build.sh
Last active February 21, 2019 08:34
Enumerate all schemes in a project, archive them, and export as IPAs.
#!/bin/bash
# Builds all targets and places IPAs in build/
# Constants
SIGNING_IDENTITY="iPhone Distribution: Detroit Labs, LLC"
# Get a list of all schemes, then build each.
xcodebuild -project PROJECT.xcodeproj -list | \
sed -n '/Schemes/,/^$/p' | \
@chaitanyagupta
chaitanyagupta / re-sign-ios-app.md
Last active October 20, 2023 08:28
How to re-sign an iOS app with another developer account

WARNING These steps are probably out dated and will not work.

To re-sign an iOS app with another developer account, ensure that the following are in place first.

  1. Distribution certificate of the other developer account
  2. A provisioning profile from the other developer account

Note that the Apple requires bundle IDs to be globally unique, even across accounts. So a bundle ID i.e. CFBundleIdentifier from one account can't be used in a different account, even though the team id/prefix would be different.

Ensure that the new distribution certificate is in your keychain and the new provisioning profile on your disk.

@andymatuschak
andymatuschak / CollectionViewDataSource.swift
Last active February 12, 2021 09:44
Type-safe value-oriented collection view data source
//
// CollectionViewDataSource.swift
// Khan Academy
//
// Created by Andy Matuschak on 10/14/14.
// Copyright (c) 2014 Khan Academy. All rights reserved.
//
import UIKit
@sjones94549
sjones94549 / Multiple_GCM_Senders.md
Last active November 13, 2017 01:18
How to handle multiple GCM senders in the same app

Multiple GCM Senders in the Same App

Google does support multiple GCM senders (Layer, etc.) for a single app, but you have to account for it. If not, one or more GCM sender will fail to send GCM intents, and GCM intents that do come in may randomly fail to reach GCM receivers in your manifest.

GCM Registration

GCM registration happens in two phases. First, the device supplies a Sender ID to Google, and Google gives the device back a Registration ID. The Registration ID is what the device sends to Layer so we can send GCM to that device. The trick is, each app can only have one current Registration ID assigned by Google at a time; previously assigned Registration IDs will no longer work. And, the Registration ID is based on the Sender ID supplied at registration time. So, if multiple senders (e.g. Layer and another service) register for GCM, one will register last and invalidate the other.

Option 1: Handling GCM Registration Yourself

The first method is documented:

@VictorLaskin
VictorLaskin / Dockerfile
Created July 5, 2015 12:24
Compile static libs: OpenSSL and CURL with https support for Android using clang3.6 (armv7)
# THIS DOCKERFILE TRIES TO COMPILE CURL/OPENSSL FOR ANDROID
#
# 5 july 2015
#
# More detals could be found here:
# http://vitiy.info/dockerfile-example-to-compile-libcurl-for-android-inside-docker-container/
FROM ubuntu
MAINTAINER Victor Laskin "victor.laskin@gmail.com"
@artzub
artzub / make.sh
Last active November 30, 2022 11:41
Install JetBrains Hub + YouTrack + UpSource + Nginx
#!/bin/bash
apt-get install mc htop git unzip wget curl -y
echo
echo "====================================================="
echo " WELCOME"
echo "====================================================="
echo
echo "Hub"